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

Avoid deploying the operator with default label #701

Merged
merged 6 commits into from
Feb 14, 2024

Conversation

spilchen
Copy link
Collaborator

@spilchen spilchen commented Feb 13, 2024

Any operator that is built with the operator-sdk framework will have default selector labels added for the operator like this:

  control-plane: controller-manager

When the operator is deployed in the same namespace as other operator, that also continue using the default label, then the service object for the operator fails to work. The service object is used by the webhook, so it will route webhook requests to the wrong pod.

This change is to use the following label instead:

  control-plane: verticadb-operator

I also took the opportunity to rename the operator objects. The deployment object was renamed from verticadb-operator-controller-manager to verticadb-operator-manager.

Closes #694

Matt Spilchen added 6 commits February 12, 2024 10:41
Any operator that is built with the operator-sdk framework will have
default selector labels added for the operator like this:
  control-plane: controller-manager

When the operator is deployed in the same namespace as other operator,
that also continue using the default label, then the service object for
the operator fails to work. It will route webhook requests to the wrong
pod.

This change is to use the following label instead:
  control-plane: verticadb-operator

I also took the opportunity to rename the operator objects. The
deployment object was renamed from verticadb-operator-controller-manager
to verticadb-operator-manager.
We changed the serviceAccount for pods with the new 2.0.2 operator. So,
some operator upgrade tests can fail due to a caching issue. The
statefulset was updated, but the sts controller was still trying to use
the old serviceaccount. I could have fixed this by increasing the
timeout of the test, but I opted to delete the sts to avoid the cache
issue.
@spilchen spilchen self-assigned this Feb 13, 2024
Copy link
Collaborator

@roypaulin roypaulin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@@ -15,7 +15,7 @@ apiVersion: v1
kind: Pod
metadata:
labels:
control-plane: controller-manager
control-plane: matt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this on purpose?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actulally it is. With the change of the control-plane label, it can now be templated in the helm chart. So, in this testcase, which sets the nameOverride parameter, the label will be set to the value of that parameter.

@spilchen spilchen merged commit 8c4d910 into main Feb 14, 2024
30 checks passed
@spilchen spilchen deleted the spilchen/controller-manager-cleanup branch February 14, 2024 01:50
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.

Migration to v24.1 issues
2 participants