Skip to content

Chart: Add volumes for webhook patch job. #13811

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ababu13
Copy link

@ababu13 ababu13 commented Aug 22, 2025

What this PR does / why we need it:

This PR adds support for specifying custom volumes and volumeMounts in the AdmissionWebhook createSecretJob and patchWebhookJob. The template provides the attribute automountServiceAccountToken. However, if automountServiceAccountToken is set to false, the jobs fail. Therefore, to fix that issue, volumeMount and volume needs to be set.

This provides flexibility for users who need to mount additional data (e.g., certificates, configuration files, or shared volumes) into the admission webhook jobs.
Previously, these jobs did not support custom volumes or mounts, which limited use cases where external data is required during webhook secret creation or patching.

Types of changes

  • New feature (non-breaking change which adds functionality)

Which issue/s this PR fixes

fixes #13810

How Has This Been Tested?

  • Deployed Helm chart with custom volumes and volumeMounts defined in values.yaml.
  • Verified that both createSecretJob and patchWebhookJob rendered correctly with the custom mounts in the Job manifests.
  • Confirmed Jobs executed successfully with the mounted volumes present in the containers.
  • Verified that no changes occur when values are left as defaults ([]).
  • Tested the scenario in a dev cluster manually

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added unit and/or e2e tests to cover my changes.
  • All new and existing tests passed.

Copy link

netlify bot commented Aug 22, 2025

Deploy Preview for kubernetes-ingress-nginx canceled.

Name Link
🔨 Latest commit 88f70fe
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-ingress-nginx/deploys/68a8980f4be57b0008dae3b8

Copy link

linux-foundation-easycla bot commented Aug 22, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot requested review from cpanato and Gacko August 22, 2025 02:19
@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. area/helm Issues or PRs related to helm charts labels Aug 22, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Aug 22, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ababu13
Once this PR has been reviewed and has the lgtm label, please assign gacko for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

Welcome @ababu13!

It looks like this is your first PR to kubernetes/ingress-nginx 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/ingress-nginx has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @ababu13. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 22, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 22, 2025
@ababu13 ababu13 requested a review from Gacko August 22, 2025 18:13
@Gacko Gacko changed the title Add volumeMounts and volumes for createSecretJob and patchWebhookJob Chart: Add volumes for webhook patch job. Aug 23, 2025
Copy link
Member

@Gacko Gacko left a comment

Choose a reason for hiding this comment

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

Please also implement unit tests in the tests directory of the chart.

@@ -795,6 +795,18 @@ controller:
# requests:
# cpu: 10m
# memory: 20Mi
# -- VolumeMounts to set for the AdmissionWebhook createSecret Job.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# -- VolumeMounts to set for the AdmissionWebhook createSecret Job.
# -- Volume mounts to add to the admission webhook secret creation job.

# mountPath: /etc/webhook/certs
# readOnly: true
volumeMounts: []
# -- Volumes to set for the AdmissionWebhook createSecret Job.
Copy link
Member

@Gacko Gacko Aug 23, 2025

Choose a reason for hiding this comment

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

Suggested change
# -- Volumes to set for the AdmissionWebhook createSecret Job.
# -- Volumes to add to the admission webhook secret creation job.

@@ -812,6 +824,18 @@ controller:
- ALL
readOnlyRootFilesystem: true
resources: {}
# -- VolumeMounts to set for the AdmissionWebhook patchWebhook Job.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# -- VolumeMounts to set for the AdmissionWebhook patchWebhook Job.
# -- Volume mounts to add to the admission webhook patch job.

# mountPath: /etc/webhook/certs
# readOnly: true
volumeMounts: []
# -- Volumes to set for the AdmissionWebhook patchWebhook Job.
Copy link
Member

@Gacko Gacko Aug 23, 2025

Choose a reason for hiding this comment

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

Suggested change
# -- Volumes to set for the AdmissionWebhook patchWebhook Job.
# -- Volumes to add to the admission webhook patch job.

@@ -264,6 +264,8 @@ metadata:
| controller.admissionWebhooks.createSecretJob.name | string | `"create"` | |
| controller.admissionWebhooks.createSecretJob.resources | object | `{}` | |
| controller.admissionWebhooks.createSecretJob.securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsGroup":65532,"runAsNonRoot":true,"runAsUser":65532,"seccompProfile":{"type":"RuntimeDefault"}}` | Security context for secret creation containers |
| controller.admissionWebhooks.createSecretJob.volumeMounts | list | `[]` | VolumeMounts to set for the AdmissionWebhook createSecret Job. Example: - name: certs mountPath: /etc/webhook/certs readOnly: true |
Copy link
Member

Choose a reason for hiding this comment

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

Please update the documentation after applying the other suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm Issues or PRs related to helm charts cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add volumeMounts and volumes for createSecretJob and patchWebhookJob
3 participants