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

test/e2e: drop pod security enforcement label from the test namespace #1002

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

marquiz
Copy link
Contributor

@marquiz marquiz commented Dec 15, 2022

Drop the pod-security.kubernetes.io/enforce label from the test namespace, i.e. remove pod security admission enforcement. NFD-worker uses restricted host mounts (/sys) etc so pod creation fails even in privileged mode if pod security admission enforcement is enabled.

@netlify
Copy link

netlify bot commented Dec 15, 2022

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit 7b2add4
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/639b40d4463693000857c0d8
😎 Deploy Preview https://deploy-preview-1002--kubernetes-sigs-nfd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 15, 2022
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 15, 2022
@marquiz
Copy link
Contributor Author

marquiz commented Dec 15, 2022

/assign @fmuyassarov

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 15, 2022
Drop the pod-security.kubernetes.io/enforce label from the test
namespace, i.e. remove pod security admission enforcement. NFD-worker
uses restricted host mounts (/sys) etc so pod creation fails even in
privileged mode if pod security admission enforcement is enabled.
@marquiz
Copy link
Contributor Author

marquiz commented Dec 15, 2022

Fixed typos in the commit msg

Copy link
Member

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

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

I'm pretty sure this will work but I would like to test it.
Without this, you can run into issue like this


      <*errors.StatusError | 0xc000b5bf40>: {
          ErrStatus: {
              TypeMeta: {Kind: "", APIVersion: ""},
              ListMeta: {
                  SelfLink: "",
                  ResourceVersion: "",
                  Continue: "",
                  RemainingItemCount: nil,
              },
              Status: "Failure",
              Message: "pods \"nfd-worker-c42c228b-e2b8-483e-aefc-810068dcc450\" is forbidden: violates PodSecurity \"restricted:latest\": restricted volume types (volumes \"host-boot\", \"host-os-release\", \"host-sys\", \"host-usr-lib\", \"host-usr-src\" use restricted volume type \"hostPath\")",
              Reason: "Forbidden",
              Details: {
                  Name: "nfd-worker-c42c228b-e2b8-483e-aefc-810068dcc450",
                  Group: "",
                  Kind: "pods",
                  UID: "",
                  Causes: nil,
                  RetryAfterSeconds: 0,
              },
              Code: 403,
          },
      }
      pods "nfd-worker-c42c228b-e2b8-483e-aefc-810068dcc450" is forbidden: violates PodSecurity "restricted:latest": restricted volume types (volumes "host-boot", "host-os-release", "host-sys", "host-usr-lib", "host-usr-src" use restricted volume type "hostPath")
  occurred
  In [It] at: /home/fmuyassarov/go/src/node-feature-discovery/test/e2e/node_feature_discovery.go:245
 

@marquiz
Copy link
Contributor Author

marquiz commented Dec 15, 2022

I'm pretty sure this will work but I would like to test it.

Please do. I verified this on latest minikube with k8s v1.25.

Copy link
Member

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

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

Tested, works good!
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 16, 2022
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: f98467a487965eaad4f83f0c0b06f728bc3b869b

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fmuyassarov, marquiz

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

@k8s-ci-robot k8s-ci-robot merged commit 87c1a3d into kubernetes-sigs:master Dec 16, 2022
@marquiz marquiz deleted the devel/e2e-podsecurity branch December 20, 2022 08:49
@marquiz marquiz mentioned this pull request Dec 20, 2022
22 tasks
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

3 participants