-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Admission webhooks vol add #13127
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
Admission webhooks vol add #13127
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: arjunbnair97 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @arjunbnair97! |
Hi @arjunbnair97. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/triage accepted
/kind feature
/priority backlog
/hold
Please see my comments, re-generate the README.md by running helm-docs
and implement unit tests in the tests/
directory. Also please make yourself familiar with how to setup volumes and volume mounts in Kubernetes first.
Thank you!
@@ -65,6 +65,9 @@ spec: | |||
{{- if .Values.controller.admissionWebhooks.createSecretJob.resources }} | |||
resources: {{ toYaml .Values.controller.admissionWebhooks.createSecretJob.resources | nindent 12 }} | |||
{{- end }} | |||
{{- if .Values.controller.admissionWebhooks.createSecretJob.extraVolumeMounts }} | |||
extraVolumeMount: {{- toYaml .Values.controller.admissionWebhooks.createSecretJob.extraVolumeMounts | nindent 12 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no such thing as extraVolumeMount
in Pods.
@@ -77,4 +80,8 @@ spec: | |||
{{- if .Values.controller.admissionWebhooks.patch.securityContext }} | |||
securityContext: {{ toYaml .Values.controller.admissionWebhooks.patch.securityContext | nindent 8 }} | |||
{{- end }} | |||
{{- if .Values.controller.admissionWebhooks.createSecretJob.extraVolumes }} | |||
extraVolumes: {{ toYaml .Values.controller.admissionWebhooks.createSecretJob.extraVolumes | nindent 8 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And neither is extraVolumes
.
{{- if .Values.controller.admissionWebhooks.createSecretJob.extraVolumes }} | ||
extraVolumes: {{ toYaml .Values.controller.admissionWebhooks.createSecretJob.extraVolumes | nindent 8 }} | ||
{{- end }} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this newline.
@@ -67,6 +67,9 @@ spec: | |||
{{- if .Values.controller.admissionWebhooks.patchWebhookJob.resources }} | |||
resources: {{ toYaml .Values.controller.admissionWebhooks.patchWebhookJob.resources | nindent 12 }} | |||
{{- end }} | |||
{{- if .Values.controller.admissionWebhooks.patchWebhookJob.extraVolumeMounts }} | |||
extraVolumeMount: {{- toYaml .Values.controller.admissionWebhooks.patchWebhookJob.extraVolumeMounts | nindent 12 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here as above.
@@ -79,4 +82,7 @@ spec: | |||
{{- if .Values.controller.admissionWebhooks.patch.securityContext }} | |||
securityContext: {{ toYaml .Values.controller.admissionWebhooks.patch.securityContext | nindent 8 }} | |||
{{- end }} | |||
{{- if .Values.controller.admissionWebhooks.patchWebhookJob.extraVolumes }} | |||
extraVolumes: {{ toYaml .Values.controller.admissionWebhooks.patchWebhookJob.extraVolumes | nindent 8 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here as above.
charts/ingress-nginx/values.yaml
Outdated
extraVolumeMounts: [] | ||
## Additional volumeMounts to the AdmissionsWebhook createSecretJob. | ||
# - name: kube-api-access | ||
# mountPath: /var/run/secrets/kubernetes.io/serviceaccount | ||
# readOnly: true | ||
extraVolumes: [] | ||
## Additional volume to the AdmissionsWebhook createSecretJob. | ||
# - name: kube-api-access | ||
# emptyDir: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the comment before the actual property and use # --
notation for documentation.
charts/ingress-nginx/values.yaml
Outdated
extraVolumeMounts: [] | ||
## Additional volumeMounts to the AdmissionsWebhook patchWebhookJob. | ||
# - name: kube-api-access | ||
# mountPath: /var/run/secrets/kubernetes.io/serviceaccount | ||
# readOnly: true | ||
extraVolumes: [] | ||
## Additional volume to the AdmissionsWebhook patchWebhookJob. | ||
# - name: kube-api-access | ||
# emptyDir: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the comment before the actual property and use # --
notation for documentation.
@@ -65,6 +65,9 @@ spec: | |||
{{- if .Values.controller.admissionWebhooks.createSecretJob.resources }} | |||
resources: {{ toYaml .Values.controller.admissionWebhooks.createSecretJob.resources | nindent 12 }} | |||
{{- end }} | |||
{{- if .Values.controller.admissionWebhooks.createSecretJob.volumeMounts }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep using extraVolumeMounts
here.
@@ -65,6 +65,9 @@ spec: | |||
{{- if .Values.controller.admissionWebhooks.createSecretJob.resources }} | |||
resources: {{ toYaml .Values.controller.admissionWebhooks.createSecretJob.resources | nindent 12 }} | |||
{{- end }} | |||
{{- if .Values.controller.admissionWebhooks.createSecretJob.volumeMounts }} | |||
volumeMount: {{- toYaml .Values.controller.admissionWebhooks.createSecretJob.volumeMounts | nindent 12 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property is called volumeMounts
. Please read the following documentation for reference: https://kubernetes.io/docs/concepts/storage/volumes
@@ -67,6 +67,9 @@ spec: | |||
{{- if .Values.controller.admissionWebhooks.patchWebhookJob.resources }} | |||
resources: {{ toYaml .Values.controller.admissionWebhooks.patchWebhookJob.resources | nindent 12 }} | |||
{{- end }} | |||
{{- if .Values.controller.admissionWebhooks.patchWebhookJob.volumeMounts }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep using extraVolumeMounts
here.
@@ -67,6 +67,9 @@ spec: | |||
{{- if .Values.controller.admissionWebhooks.patchWebhookJob.resources }} | |||
resources: {{ toYaml .Values.controller.admissionWebhooks.patchWebhookJob.resources | nindent 12 }} | |||
{{- end }} | |||
{{- if .Values.controller.admissionWebhooks.patchWebhookJob.volumeMounts }} | |||
volumeMount: {{- toYaml .Values.controller.admissionWebhooks.patchWebhookJob.volumeMounts | nindent 12 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property is called volumeMounts
. Please read the following documentation for reference: https://kubernetes.io/docs/concepts/storage/volumes
@@ -77,4 +80,7 @@ spec: | |||
{{- if .Values.controller.admissionWebhooks.patch.securityContext }} | |||
securityContext: {{ toYaml .Values.controller.admissionWebhooks.patch.securityContext | nindent 8 }} | |||
{{- end }} | |||
{{- if .Values.controller.admissionWebhooks.createSecretJob.volumes }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep using extraVolumes
here.
charts/ingress-nginx/values.yaml
Outdated
# mountPath: /var/run/secrets/kubernetes.io/serviceaccount | ||
# readOnly: true | ||
volumeMounts: [] | ||
# -- volume to the AdmissionsWebhook createSecretJob. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# -- volume to the AdmissionsWebhook createSecretJob. | |
# -- Extra volumes for secret creation pods |
charts/ingress-nginx/values.yaml
Outdated
# -- volumeMounts to the AdmissionsWebhook patchWebhookJob. | ||
# Example: | ||
# - name: kube-api-access | ||
# mountPath: /var/run/secrets/kubernetes.io/serviceaccount | ||
# readOnly: true | ||
volumeMounts: [] | ||
# -- volume to the AdmissionsWebhook patchWebhookJob. | ||
# - name: kube-api-access | ||
# emptyDir: {} | ||
volumes: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adapt from above suggestions.
@Gacko Could you please review? |
Your changes are currently breaking tests. Please see the details of the failed checks for why. |
What this PR does / why we need it:
This change helps add
extraVolumes
andextraVolumeMounts
for the AdmissionsWebhooks Job-Patch createSecret and patchwebhook Jobs. Currently ifautomountServiceAccountToken
is set tofalse
in both the jobs, the jobs will fail. That was our initial issue. By merging the current PR, it provides an approach to manually add extraVolumes and extraVolumeMounts so that the jobs run smoothly.This PR helps resolve Issue: #13031.
Types of changes
Which issue/s this PR fixes
How Has This Been Tested?
We had tested this in our local and dev Kubernetes clusters. We manually downloaded the latest HELM charts and applied these changes and tested.
We had tested this in our local and dev K8s cluster environments.
Currently if
automountServiceAccountToken
is set tofalse
in both the jobs, the jobs will fail. That was our initial issue. By merging the current PR, it provides an approach to manually add extraVolumes and extraVolumeMounts so that the jobs run smoothly.Checklist: