I'm developing a Kubernetes system that needs to support multiple use cases, and I'm looking for ways to dynamically provision Deployment, Service, and Ingress resources through an API. I'm considering either having the API interact directly with the Kubernetes API or creating manifests that are pushed to a Git repository. I want each resource set to be properly labeled so that ArgoCD can manage them all under one application, while ensuring the deployment process remains straightforward, easy to maintain, and aligned with GitOps practices. Since there isn't a fixed number of use cases, having a values file for each one might become unwieldy. I'm eager for suggestions on whether to use the Kubernetes API, build a simple API service to create templates for Git commits, or leverage any specific tools or patterns to help streamline this process. Any advice or examples of how to structure this would be greatly appreciated!
1 Answer
Have you thought about using the Kubernetes operator pattern? You could design a custom CRD to manage your resources, and the operator could roll out the required manifests automatically. This way, you just deploy your operator and create CRDs specific to your use cases. It could simplify the management significantly.
I'm not familiar with that pattern yet. If you have any resources on it, I'd love to check them out. My main concern is exposing these CRDs via an API, since creating them manually for each use case might get complicated.