Fabrice Jammes
Fabrice Jammes

Reputation: 3195

How to synchronize Custom resource when its specification is updated

In a Kubernetes operator based on operator-sdk, do you know how to write code to synchronize CR resource when CR specification is updated with kubectl apply? Could you please provide some code samples?

Upvotes: 0

Views: 658

Answers (2)

Fabrice Jammes
Fabrice Jammes

Reputation: 3195

Implementing it a go-lang based operator is pretty complex, and I would recommand studying the kubebuilder documentation and example in order to achieve that: https://book.kubebuilder.io/cronjob-tutorial/controller-implementation.html#implementing-a-controller

Upvotes: 0

coderanger
coderanger

Reputation: 54191

It is mostly up to how you deploy things. The default skeleton gives you a Kustomize-based deployment structure so kustomize build config/default | kubectl apply -f. This is also wrapped up for you behind make deploy. There is also make install for just installing the generated CRD files.

Upvotes: 1

Related Questions