STOR-2884: Add service to generate a TLS cert for SMB operator#520
STOR-2884: Add service to generate a TLS cert for SMB operator#520jsafrane wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
@jsafrane: This pull request references STOR-2884 which is a valid jira issue. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds a new Kubernetes Service manifest 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
config/samba/manifests/stable/smb-csi-driver-operator.clusterserviceversion.yaml (1)
369-371: Consider addingoptional: trueto handle startup race condition.The secret
smb-csi-driver-operator-metrics-serving-certis created by service-ca-operator after it observes the Service. Withoutoptional: true, the pod may fail to start if the Deployment is scheduled before the secret exists.♻️ Proposed fix
- name: metrics-serving-cert secret: secretName: smb-csi-driver-operator-metrics-serving-cert + optional: true🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@config/samba/manifests/stable/smb-csi-driver-operator.clusterserviceversion.yaml` around lines 369 - 371, The secret volume entry for "metrics-serving-cert" currently references secretName "smb-csi-driver-operator-metrics-serving-cert" but lacks optional handling; update the secret spec under the "metrics-serving-cert" volume (where secretName is defined) to include optional: true so the pod won't fail if the service-ca-operator hasn't created the secret yet; modify the secret block that contains secretName smb-csi-driver-operator-metrics-serving-cert to add optional: true.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@config/samba/manifests/stable/smb-csi-driver-operator.clusterserviceversion.yaml`:
- Around line 369-371: The secret volume entry for "metrics-serving-cert"
currently references secretName "smb-csi-driver-operator-metrics-serving-cert"
but lacks optional handling; update the secret spec under the
"metrics-serving-cert" volume (where secretName is defined) to include optional:
true so the pod won't fail if the service-ca-operator hasn't created the secret
yet; modify the secret block that contains secretName
smb-csi-driver-operator-metrics-serving-cert to add optional: true.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3fbc25df-b247-4e31-8930-cbd074546ae1
📒 Files selected for processing (3)
config/samba/bundle.Dockerfileconfig/samba/manifests/stable/smb-csi-driver-operator-metrics-service.yamlconfig/samba/manifests/stable/smb-csi-driver-operator.clusterserviceversion.yaml
|
/test help |
|
/test smb-operator-e2e |
|
/retest-required |
|
@jsafrane , if you compare your new Service for smb with existing one for CSO, you can see a few discrepancies:
while SMB one has:
Do you think it's good idea to have some uniformity for metrics Service-s among storage components? (we could fix CSO one in a NO-JIRA PR if you think new SMB Service is better). I think it will be hard exercise for any future code-reader to understand why two similar Service-s differ so much :) |
Add service smb-csi-driver-operator-metrics to the SMB CSI driver OLM manifests. OLM will instantiate it together with the operator Deployment. This service causes service-ca-operator to generate a TLS key + certificate for the operator. As result, the operator stops generating a self-signed cert and uses the provided one instead.
These annotations are interpreted by CVO. SMB does not go through CVO and have no effect in OLM, so I removed them.
I copied the secret name from vSphere, which is the only (?) CSI operator one that has configured metrics collection. And it has I agree the names are not consistent, I've chosen to be consistent with the only CSI driver operator. Without much thinking about other options, to be honest.
I changed SMB to
The selector must correspond to a label on Pods. And the operator Pod(s) have |
f978b43 to
729d796
Compare
|
/lgtm |
@jsafrane , it was introduced four years ago by this PR: Bug 2043132: Add metrics for vsphere operator. If I understand Hemant's logic correctly, the PR introduced a new port 8445, and a name for this port: |
|
@jsafrane: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
Add service smb-csi-driver-operator-metrics to the SMB CSI driver OLM manifests. OLM will instantiate it together with the operator Deployment.
This service causes service-ca-operator to generate a TLS key + certificate for the operator. As result, the operator stops generating a self-signed cert and uses the provided one instead.
The service has no other use than to generate the TLS material. The operator itself does not (yet) expose a port with metrics.