How can I dynamically provision Deployment, Service, and Ingress objects in Kubernetes?

0
4
Asked By TechyNerd101 On

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

Answered By CloudGazer42 On

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.

K8sExplorer99 -

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.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.