Wednesday, May 1, 2024

How to deploy incremental code change straight into AKS Pod?

 How to develop code inside a running pod without redeploying an image?

My problem is, that once I want to try a code change, I always need to build a new image, push it to a registry, patch a Kubernetes Operator CRD, let it redeploy, let it reconcile, wait for the new pod to startup and see if the change worked once traffic is routed to the new instance. That's quite time consuming.

I want something that has mount drive like docker desktop, every .net solution build package or publish artifacts should checked for changed file and push to the target AKS POD namespace hosted website.

Developing code inside a running pod without redeploying the entire image can indeed be time-consuming and cumbersome, especially in restricted environments. Fortunately, there are some tools and techniques that can help streamline this process. Let’s explore a few options:

  1. Skaffold:

    • Skaffold is a popular tool for local development with Kubernetes. It automates the build, push, and deployment process, allowing you to iterate quickly.

    • You can set up Skaffold to watch your local code and automatically rebuild and redeploy your application whenever changes are detected.

    • Skaffold works well with Kubernetes clusters, including OpenShift1.

  2. Telepresence:

  3. DevSpace:

  4. Code-Server:

Remember that each tool has its own trade-offs, and the best choice depends on your specific requirements and constraints. Experiment with a few options to find the one that fits your workflow best. Happy coding! 😊

If you want to know how exactly it happens, please refer to this fragment of the official Kubernetes documentation on postStart handlers.

 

No comments:

Post a Comment