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

Ctrl manager labels for webhooks and logging #191

Merged

Conversation

abays
Copy link
Contributor

@abays abays commented Apr 11, 2023

For initial webhook work, we found that we needed to remove the control-plane: controller-manager label and label-selector from the controller-manager pod and its associated peripherals in order to properly direct webhook traffic to the appropriate webhook server for our various operators' CRDs. This had the unfortunate side effect of removing a label that could be used for bulk-selecting all our controller-manager pods. This was noted here [1]. We therefore have opted to reintroduce the control-plane: controller-manager default label (originally added by operator-sdk scaffolding) and instead use another unique label (also added by operator-sdk scaffolding, at least in newer version of operator-sdk) for routing webhook traffic. This unique label takes the form of app.kubernetes.io/name: <operator name> and can be used with label-selectors to ensure webhooks and other peripheral k8s services work correctly.

[1] openshift/release#37084 (comment)

@openshift-ci openshift-ci bot requested review from ASBishop and stuggi April 11, 2023 18:04
@abays abays requested review from fmount and Akrog April 11, 2023 18:04
control-plane: cinder-controller-manager
control-plane: controller-manager
app.kubernetes.io/name: cinder-operator
app.kubernetes.io/component: cinder
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this 'app.kubernetes.io/component' label used?

While it may not be a big deal, we already use a generic 'component' label on several resources that designates the specific cinder service (API, Backup, Scheduler, Volume). I don't know if others will be confused when we use the term "component" in a different way that depends on the context. In the app.kubernetes context, "component" means cinder, but in the cinder context, "component" means [API|Backup|Scheduler|Volume].

I'm not saying this is a problem, but am curious how others thing about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be honest, the app.kubernetes.io/component: <openstack service name> label doesn't seem to be used anywhere within the operator itself. It would be the same case for the app.kubernetes.io/name: <openstack service name>-operator label if we were not now using it as a unique label selector. The operator-sdk added these sorts of labels to other operators (Keystone and Placement, for example) and for some reason they were missing here and in other operators. My guess is that these labels are added via newer versions of operator-sdk. Since this Cinder operator was actually scaffolded back in 2020, the labels are simply missing. I suppose we could exclude adding app.kubernetes.io/component: cinder since it's not referenced elsewhere though. It just initially seemed prudent to repeat the newer scaffolded pattern and include it. I wonder if these new labels are added by the scaffolding because newer versions of OLM will try to look for them and thus use them for certain operations?

All that being said, I see what you mean regarding the potential "component" confusion (as an example: [1]). I'm not immediately sure what the right approach is, whether that's leaving it as-is, explicitly excluding/removing it, adding a comment to help dispel ambiguity, etc.

[1]

common.ComponentSelector: cinderapi.Component,

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 11, 2023

@abays: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/cinder-operator-build-deploy-kuttl 8938f07 link false /test cinder-operator-build-deploy-kuttl

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 12, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abays, fmount

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit f8d492c into openstack-k8s-operators:master Apr 12, 2023
ASBishop pushed a commit to ASBishop/cinder-operator that referenced this pull request Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants