
Okteto Push – Your Code to Kubernetes in Seconds - pchico83
https://okteto.com/blog/okteto-push-code-to-kubernetes-in-seconds/
======
verdverm
How do you achieve "in seconds" when you are still building and image, pushing
to a registry, and then deploying to k8s?

Docker build alone makes me believe this is a false statement.

This mostly seems like the same steps my bash script runs, perhaps in cluster?

Does this require some base container of yours running in my cluster? Any
place I can audit that container and code?

~~~
Ramiro
Hey, I'm Ramiro, one of the maintainers. We do several things to speed the
whole cycle up.

When you are using Okteto Cloud to run your apps, you get all this:

\- Build is run in big servers in the Okteto Cloud infra. It's based on
buildkit, and it's heavily cached and optimized towards development scenarios.
The build context is sent from your local machine to the service and
everything else happens there. \- The registry in the same infrastructure as
the build services. The image is pushed from the build service to the
registry, instead of from your machine. \- The deployment runs in the same
cluster as well, to speed up the time it takes to pull the image.

You can also use "okteto push" with your own infra, by providing your own
buildkit service, registry and k8s cluster. Depending on where they are
located with respect to each other this might be slower or faster (e.g using
dockerhub for registry will be slower than using a dedicated one in your own
cluster, mainly due to network speed and proximity).

The biggest benefits of this approach are being able to move all this to the
k8s cluster, where you can leverage more compute power and faster network
transmission. That way you are not pulling and pushing images across the
internet.

~~~
verdverm
How do you build containers safely in a multi tenant setup?

Any open source repos to check out?

My environment has the things in the cloud, but it is still not seconds. Even
npm watch takes several seconds, let alone docker builds almost always take
minutes

~~~
Ramiro
> Even npm watch takes several seconds, let alone docker builds almost always
> take minutes

That's where caching, container layers and build stages can help a lot.
Specially for development, where you might be rebuilding the same container
over and over.

