Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Envoy and Cruisecontrol custom label addition #951

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

saishivau
Copy link

@saishivau saishivau commented Mar 13, 2023

Q A
Bug fix? no
New feature? yes
API breaks? no
Deprecations? no
Related tickets fixes #945 , partially #Y, mentioned in #Z
License Apache 2.0

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

  • Implementation tested
  • Error handling code meets the guideline
  • Logging code meets the guideline
  • User guide and development docs updated (if needed)

To Do

  • If the PR is not complete but you want to discuss the approach, list what remains to be done here

@saishivau saishivau requested a review from a team as a code owner March 13, 2023 18:45
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@panyuenlau
Copy link
Member

panyuenlau commented Mar 13, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Envoy and Cruisecontrol are not having custom label config in the CRD.
3 participants