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

STOR-1442: Restart webhook Pods if webhook-serving-cert changed #83

Conversation

mpatlasov
Copy link
Contributor

Adding WithSecretHashAnnotationHook() for shared-resource-csi-driver-webhook-serving-cert ensures that new annotation is published in shared-resource-csi-driver-webhook Deployment. This, in turn, leads to webhook pods restart.

The secret `shared-resource-csi-driver-webhook-serving-cert` is bound to the CA cert by annotation `service.beta.openshift.io/serving-cert-secret-name`. This means that if CA cert is rotated, the secret `shared-resource-csi-driver-webhook-serving-cert` will be automatically updated too.

This secret keeps TLS cert and key which are used to secure HTTP connection to webhook server which is started by OpenShift Shared Resource CSI Driver. If cert and key are updated, we need to restart CSI driver Pod to re-read new keys. Otherwise, clients coming with new cert won't be able to communicate with the server running with older key/cert.
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 10, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 10, 2023

@mpatlasov: This pull request references STOR-1442 which is a valid jira issue.

In response to this:

Adding WithSecretHashAnnotationHook() for shared-resource-csi-driver-webhook-serving-cert ensures that new annotation is published in shared-resource-csi-driver-webhook Deployment. This, in turn, leads to webhook pods restart.

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.

@mpatlasov
Copy link
Contributor Author

This PR is the same as #82, but for webhook secret/pods. We don't have any more secrets depending on CA for now:

[csi-driver-shared-resource-operator]$ grep -nr "service.beta.openshift.io/serving-cert-secret-name" *
assets/metrics_service.yaml:5:    service.beta.openshift.io/serving-cert-secret-name: shared-resource-csi-driver-node-metrics-serving-cert
assets/webhook/service.yaml:5:    service.beta.openshift.io/serving-cert-secret-name: shared-resource-csi-driver-webhook-serving-cert

/assign @adambkaplan

@mpatlasov
Copy link
Contributor Author

/cc @jsafrane @openshift/storage

@openshift-ci openshift-ci bot requested a review from jsafrane August 10, 2023 21:55
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 10, 2023

@mpatlasov: GitHub didn't allow me to request PR reviews from the following users: openshift/storage.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @jsafrane @openshift/storage

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.

@Phaow
Copy link
Contributor

Phaow commented Aug 11, 2023

Pre verifiy passed with the pre merged build 4.14.0-0.ci.test-2023-08-11-065827-ci-ln-t683fit-latest

# After the metrics-serving-cert secret changed, driver controller restarted
$ oc delete secret shared-resource-csi-driver-webhook-serving-cert
secret "shared-resource-csi-driver-webhook-serving-cert" deleted

$ oc get po -l name=shared-resource-csi-driver-webhook -w
NAME                                                  READY   STATUS    RESTARTS   AGE
shared-resource-csi-driver-webhook-7666c65cf5-h6kh8   1/1     Running   0          6s
shared-resource-csi-driver-webhook-7666c65cf5-v8g7j   1/1     Running   0          6s
shared-resource-csi-driver-webhook-559d4c5b57-njbg7   0/1     Pending   0          0s
shared-resource-csi-driver-webhook-559d4c5b57-njbg7   0/1     Pending   0          0s
shared-resource-csi-driver-webhook-7666c65cf5-v8g7j   1/1     Terminating   0          16s
shared-resource-csi-driver-webhook-559d4c5b57-njbg7   0/1     ContainerCreating   0          0s
shared-resource-csi-driver-webhook-559d4c5b57-njbg7   0/1     ContainerCreating   0          0s
shared-resource-csi-driver-webhook-559d4c5b57-qjtsf   0/1     Pending             0          0s
shared-resource-csi-driver-webhook-559d4c5b57-qjtsf   0/1     Pending             0          0s
shared-resource-csi-driver-webhook-559d4c5b57-qjtsf   0/1     ContainerCreating   0          0s
shared-resource-csi-driver-webhook-559d4c5b57-qjtsf   0/1     ContainerCreating   0          0s
shared-resource-csi-driver-webhook-7666c65cf5-v8g7j   0/1     Terminating         0          16s
shared-resource-csi-driver-webhook-7666c65cf5-v8g7j   0/1     Terminating         0          17s
shared-resource-csi-driver-webhook-7666c65cf5-v8g7j   0/1     Terminating         0          17s
shared-resource-csi-driver-webhook-7666c65cf5-v8g7j   0/1     Terminating         0          17s
shared-resource-csi-driver-webhook-559d4c5b57-qjtsf   0/1     ContainerCreating   0          1s
shared-resource-csi-driver-webhook-559d4c5b57-njbg7   0/1     ContainerCreating   0          1s
shared-resource-csi-driver-webhook-559d4c5b57-qjtsf   0/1     Terminating         0          1s
shared-resource-csi-driver-webhook-559d4c5b57-njbg7   0/1     Terminating         0          1s
shared-resource-csi-driver-webhook-6f4b497f54-2dbq4   0/1     Pending             0          0s
shared-resource-csi-driver-webhook-6f4b497f54-cltr7   0/1     Pending             0          0s
shared-resource-csi-driver-webhook-6f4b497f54-2dbq4   0/1     Pending             0          0s
shared-resource-csi-driver-webhook-6f4b497f54-cltr7   0/1     Pending             0          0s
shared-resource-csi-driver-webhook-6f4b497f54-2dbq4   0/1     Pending             0          0s
shared-resource-csi-driver-webhook-6f4b497f54-cltr7   0/1     Pending             0          0s
shared-resource-csi-driver-webhook-6f4b497f54-2dbq4   0/1     ContainerCreating   0          0s
shared-resource-csi-driver-webhook-6f4b497f54-cltr7   0/1     ContainerCreating   0          0s
shared-resource-csi-driver-webhook-559d4c5b57-qjtsf   1/1     Terminating         0          1s
shared-resource-csi-driver-webhook-6f4b497f54-2dbq4   0/1     ContainerCreating   0          1s
shared-resource-csi-driver-webhook-6f4b497f54-cltr7   0/1     ContainerCreating   0          1s
shared-resource-csi-driver-webhook-559d4c5b57-njbg7   1/1     Terminating         0          2s
shared-resource-csi-driver-webhook-559d4c5b57-njbg7   0/1     Terminating         0          2s
shared-resource-csi-driver-webhook-6f4b497f54-cltr7   1/1     Running             0          1s
shared-resource-csi-driver-webhook-7666c65cf5-h6kh8   1/1     Terminating         0          18s
shared-resource-csi-driver-webhook-559d4c5b57-qjtsf   0/1     Terminating         0          3s
shared-resource-csi-driver-webhook-6f4b497f54-2dbq4   1/1     Running             0          2s
shared-resource-csi-driver-webhook-559d4c5b57-njbg7   0/1     Terminating         0          3s
shared-resource-csi-driver-webhook-559d4c5b57-njbg7   0/1     Terminating         0          3s
shared-resource-csi-driver-webhook-559d4c5b57-njbg7   0/1     Terminating         0          3s
shared-resource-csi-driver-webhook-559d4c5b57-qjtsf   0/1     Terminating         0          3s
shared-resource-csi-driver-webhook-559d4c5b57-qjtsf   0/1     Terminating         0          3s
shared-resource-csi-driver-webhook-559d4c5b57-qjtsf   0/1     Terminating         0          3s
shared-resource-csi-driver-webhook-7666c65cf5-h6kh8   0/1     Terminating         0          20s
shared-resource-csi-driver-webhook-7666c65cf5-h6kh8   0/1     Terminating         0          20s
shared-resource-csi-driver-webhook-7666c65cf5-h6kh8   0/1     Terminating         0          20s
shared-resource-csi-driver-webhook-7666c65cf5-h6kh8   0/1     Terminating         0          20s

$ oc get po -l name=shared-resource-csi-driver-webhook
NAME                                                  READY   STATUS    RESTARTS   AGE
shared-resource-csi-driver-webhook-6f4b497f54-2dbq4   1/1     Running   0          2m53s
shared-resource-csi-driver-webhook-6f4b497f54-cltr7   1/1     Running   0          2m53s

@Phaow
Copy link
Contributor

Phaow commented Aug 11, 2023

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Aug 11, 2023
@jsafrane
Copy link
Contributor

/lgtm
/approve
/label px-approved
/label docs-approved

@openshift-ci openshift-ci bot added px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels Aug 11, 2023
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 11, 2023
@jsafrane
Copy link
Contributor

@adambkaplan @gabemontero can you please approve?

Copy link
Contributor

@adambkaplan adambkaplan left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adambkaplan, jsafrane, mpatlasov

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 11, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 11, 2023

@mpatlasov: all tests passed!

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-merge-robot openshift-merge-robot merged commit d340e59 into openshift:master Aug 11, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants