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

SecurityContext for webhook job container create/patch #8993

Closed
wants to merge 0 commits into from
Closed

SecurityContext for webhook job container create/patch #8993

wants to merge 0 commits into from

Conversation

ybelMekk
Copy link
Contributor

helm version: 3.9.2
ingress-nginx version: ingress-nginx-4.2.3.tgz

What this PR does / why we need it:

Stumbled in to this when working with kyverno and enforced strict policies.

Kyverno and using strict policy configuration, job create for ingress-nginx-admission-create fails with policies require-drop-all. Adding the ability to configure containers in webhooks create and patch from helm values.

k describe job loadbalancer-ingress-nginx-admission-create

resource Pod/my-namespace/loadbalancer-ingress-nginx-admission-create-kvpl5 was blocked due to the following policies

disallow-capabilities-strict:
  require-drop-all: 'validation failure: Containers must drop `ALL` capabilities.'
  Warning  FailedCreate  14s  job-controller  Error creating: admission webhook "validate.kyverno.svc-fail" denied the request:

NONE

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • CVE Report (Scanner found CVE and adding report)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation only

Which issue/s this PR fixes

How Has This Been Tested?

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.
  • Added Release Notes.

Does my pull request need a release note?

Any user-visible or operator-visible change qualifies for a release note. This could be a:

  • CLI change
  • API change
  • UI change
  • configuration schema change
  • behavioral change
  • change in non-functional attributes such as efficiency or availability, availability of a new platform
  • a warning about a deprecation
  • fix of a previous Known Issue
  • fix of a vulnerability (CVE)

No release notes are required for changes to the following:

  • Tests
  • Build infrastructure
  • Fixes for unreleased bugs

For more tips on writing good release notes, check out the Release Notes Handbook

NONE

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 29, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: ybelMekk / name: Youssef Bel Mekki (46c3605ce0a739c80e489b8ee6afd5583c14e239)

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

@ybelMekk: 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Aug 29, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @ybelMekk!

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 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 labels Aug 29, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @ybelMekk. 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. area/helm Issues or PRs related to helm charts labels Aug 29, 2022
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 29, 2022
@ybelMekk
Copy link
Contributor Author

ybelMekk commented Aug 29, 2022

The lint complain about something in Chart.yaml...

@ybelMekk ybelMekk changed the title SecurityContext for job create/path kubernetes-nginx SecurityContext for job create/patch kubernetes-nginx Aug 29, 2022
@ybelMekk ybelMekk changed the title SecurityContext for job create/patch kubernetes-nginx SecurityContext for webhook job container create/patch Aug 30, 2022
@rikatz
Copy link
Contributor

rikatz commented Sep 5, 2022

yeah, lint started to break.

I have added a workaround on it, please rebase over main as soon as #9014 gets merged

@rikatz
Copy link
Contributor

rikatz commented Sep 5, 2022

/ok-to-test
/approve
/hold

Please rebase after the mentioned PR gets merged and let's see if this passes

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. area/docs size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 5, 2022
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 5, 2022
@ybelMekk
Copy link
Contributor Author

ybelMekk commented Sep 5, 2022

/test pull-ingress-nginx-chart-lint

@k8s-ci-robot
Copy link
Contributor

@ybelMekk: 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
pull-ingress-nginx-chart-lint f3879abb6a962adfa23bb4dd7581f7b16a1d9a58 link true /test pull-ingress-nginx-chart-lint

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@ybelMekk
Copy link
Contributor Author

ybelMekk commented Sep 5, 2022

no luck with the lint of chart.yaml

@longwuyuan
Copy link
Contributor

Hi @ybelMekk , I think we need some debug message to confirm what the linter version is.
This merged #9000 so main now has v3.7.0. But I see 20 commits from you in this PR and @rikatz mentioned that you need to rebase. Although there is a bot based process to squash, I think its worth a check to ask you if you have rebased. Also, just for your own clarity, you could even attempt a squash instead of running with 20 commits here. If the lint fails even with v3.7.0, then we need to investigate further.

@longwuyuan
Copy link
Contributor

Ah wait, it is more likely a problem on the project CI. Will update after we know ;

% docker run  -ti registry.k8s.io/ingress-nginx/e2e-test-runner:v20220823-ge19026fe4@sha256:038fc60379b6ce9a0134c2ff9134edccad1f8ecbd9c6ebed9660711d05b0ed95 sh
/go # ct
Lint and test

* changed charts
* specific charts
* all charts

in given chart directories.

Usage:
  ct [command]

Available Commands:
  help             Help about any command
  install          Install and test a chart
  lint             Lint and validate a chart
  lint-and-install Lint, install, and test a chart
  list-changed     List changed charts
  version          Print version information

Flags:
  -h, --help   help for ct

Use "ct [command] --help" for more information about a command.
/go # ct version
Version:         v3.0.0
Git commit:      50db473a1e68c605b18d82f019d83ea401542213
Date:            2020-07-24T20:35:05Z
License:         Apache 2.0
/go # 

@tao12345666333 do you recall promoting the test-runner after merging #9000

@longwuyuan
Copy link
Contributor

I think we need to promote a change over to the new test-runner with ct 3.7.0
image

I will submit the promote PR

@ybelMekk
Copy link
Contributor Author

ybelMekk commented Sep 5, 2022

sry @longwuyuan for cluttering the PR, I can close this PR and open a new one ones its fixed, its not to big to re-implement 😄

@longwuyuan
Copy link
Contributor

I am creating the PRs required to use the new test-runner image that has the updated chart tester/linter. Whole process may take ta few hours.

@ybelMekk
Copy link
Contributor Author

ybelMekk commented Sep 5, 2022

no worries I'm in no stress.

@longwuyuan
Copy link
Contributor

First of 2 required PRs to use chart test linter v3.7.0 kubernetes/k8s.io#4183

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 5, 2022
@k8s-ci-robot
Copy link
Contributor

@ybelMekk: PR needs rebase.

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.

@ybelMekk ybelMekk closed this Sep 5, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Sep 5, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rikatz, ybelMekk

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 k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs area/helm Issues or PRs related to helm charts cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants