Envoy and Cruisecontrol custom label addition#951
Envoy and Cruisecontrol custom label addition#951saishivau wants to merge 1 commit intobanzaicloud:masterfrom
Conversation
|
|
|
Hey @saishivau, thanks for trying to help us out. Having the field defined in the CRD is not enough, the operator must react to the newly introduced fields when it tries to deploy the K8s resources for CruiseControl and Envoy. Here is how the operator handles those customized annotations for Cruise Control pod: https://github.com/banzaicloud/koperator/blob/master/pkg/resources/cruisecontrol/cruisecontrol.go#L138-L143 Take CruiseControl as an example, the operator currently creates some labels for the pod, see here: https://github.com/banzaicloud/koperator/blob/master/pkg/resources/cruisecontrol/deployment.go#L68, therefore, you must merge the user-specified label(s) in the CRD to the existing labels that the operator creates, one useful function can be used is this MergeLabels Same principle applies to the Envoy deployment, you will need to take the user-specified labels and apply to the Envoy deployment - https://github.com/banzaicloud/koperator/blob/master/pkg/resources/envoy/deployment.go#L75-L79 |
What's in this PR?
Envoy and Cruisecontrol pods are not accepting customized labels. So added them and updated CRD to accept the labels for the pods.
Why?
This will enable the custom labels addition support on envoy and cruisecontrol pods.
Additional context
Checklist
To Do