Skip to content

What is the recommended way to create a "custom controller" to manage Deployments based on a database state? #708

Answered by buehler
64J0 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @64J0

This is not the "Kubernetes" way, nor are operators built for such tasks.

The state should be a desired state and documented in the Kubernetes API. So, if you change a resource, that will update your other objects.

You can either create your custom resource for such things, or have a database, but anyway, you'll need a running controller for this.

To fully use an operator, you should use existing resources (you can attach an operator to a V1Deployment if you want), or really create a cronjob that does what you stated, but then you won't need an operator. The normal Kubernetes client is sufficient to execute these tasks for you.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@64J0
Comment options

@buehler
Comment options

Answer selected by 64J0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants