I'm looking for a way to manage multiple service dependencies in Kubernetes, similar to how I do it with Docker Compose. In Docker Compose, I can define services like databases or Kafka, and they are automatically removed when I stop the entire setup. How can I replicate this functionality in Kubernetes?
3 Answers
Using tools like custom Helm charts, Argo, or FluxCD can help manage dependencies in Kubernetes pretty effectively. Helm allows you to package subcharts, while Argo and Flux can help you set up interdependencies between Helm charts and other YAMLs or Kustomizations.
You might want to check out Kompose. It can really help you convert your Docker Compose files to Kubernetes manifests, so you understand the structure better. Hope this helps!
If you want a set of co-dependent services that can be deployed and cleaned up together, just put them in a single file or directory and then use `kubectl apply` or `kubectl delete` on that path. Creating a Helm chart for them works as well.
Exactly! Keeping everything in one manifest allows you to spin it up or down together, just like a Docker Compose file.
But how would I start creating my own resource files for something installed with Helm?
Yeah, but be careful using Helm dependencies. They aren't great for things like databases that you want to keep persistent. They're more suited for lightweight services like Redis.