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

Fixes for running on k8s 1.23 and restricted PodSecurityAdmission level #1477

Merged
merged 2 commits into from
Nov 4, 2022

Conversation

dibyom
Copy link
Member

@dibyom dibyom commented Nov 2, 2022

Changes

There are two commits which are both required for Triggers to work with Pipelines v0.41 which requires Kubernetes 1.23.

  1. Use cos_containerd gke image for e2e tests

This commit updates our plumbing dependency to pull in tektoncd/plumbing#1251 which updates the GKE image to cos_containerd. The older cos image is no longer supported as of GKE v1.23.

Part of #1475

  1. Replace PodSecurityPolicy with PodSecurityAdmission

This commit drops the Triggers PodSecurityPolicy since its deprecated and is
going to be removed in Kubernetes 1.25 in favor of PodSecurityAdmission.

In addition, it adds the securityContext required for the "restricted"
PodSecurityAdmission levels. These changes are necessary for Triggers to work
with Pipelines v0.41 and higher because tektoncd/pipeline#5652 started
enforcing the restricted pod security level for all pods in the
tekton-pipelines namespace (which includes the triggers controller, webhook,
and core interceptor deployments).

Fixes #1447 and required for #1475

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

See the contribution guide for more details.

Release Notes

action required:  If using Kubernetes 1.22, set PodSecurity flag to true to enforce a restricted pod security level in Tekton namespaces. See https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-graduated-or-deprecated-features for more information.

E2E tests now use cos_containerd image instead of the unsupported cos image

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Nov 2, 2022
@tekton-robot tekton-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 2, 2022
This commit updates our plumbing dependency to pull in tektoncd/plumbing#1251
which updates the GKE image to cos_containerd. The older cos image is no longer
supported as of GKE v1.23.

Part of tektoncd#1475

Signed-off-by: Dibyo Mukherjee <[email protected]>
@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 2, 2022
@dibyom
Copy link
Member Author

dibyom commented Nov 2, 2022

Running into PSP issues:

tekton-pipelines             26m         Warning   FailedGetResourceMetric   horizontalpodautoscaler/tekton-pipelines-webhook                     no recommendation
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-controller-7887549bc5                     Error creating: pods "tekton-triggers-controller-7887549bc5-g4gpb" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-controller" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-controller" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-controller" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-controller-7887549bc5                     Error creating: pods "tekton-triggers-controller-7887549bc5-tkv9h" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-controller" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-controller" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-controller" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-controller-7887549bc5                     Error creating: pods "tekton-triggers-controller-7887549bc5-9fd8q" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-controller" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-controller" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-controller" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-controller-7887549bc5                     Error creating: pods "tekton-triggers-controller-7887549bc5-4sk4w" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-controller" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-controller" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-controller" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-controller-7887549bc5                     Error creating: pods "tekton-triggers-controller-7887549bc5-8c9bx" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-controller" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-controller" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-controller" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-controller-7887549bc5                     Error creating: pods "tekton-triggers-controller-7887549bc5-x9ljg" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-controller" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-controller" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-controller" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-controller-7887549bc5                     Error creating: pods "tekton-triggers-controller-7887549bc5-4gfkw" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-controller" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-controller" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-controller" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-controller-7887549bc5                     Error creating: pods "tekton-triggers-controller-7887549bc5-w2rqv" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-controller" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-controller" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-controller" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-controller-7887549bc5                     Error creating: pods "tekton-triggers-controller-7887549bc5-74px6" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-controller" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-controller" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-controller" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             14m         Warning   FailedCreate              replicaset/tekton-triggers-controller-7887549bc5                     (combined from similar events): Error creating: pods "tekton-triggers-controller-7887549bc5-htzd7" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-controller" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-controller" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-controller" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             3m50s       Warning   FailedCreate              replicaset/tekton-triggers-controller-7887549bc5                     Error creating: pods "tekton-triggers-controller-7887549bc5-gr8gh" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-controller" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-controller" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-controller" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Normal    ScalingReplicaSet         deployment/tekton-triggers-controller                                Scaled up replica set tekton-triggers-controller-7887549bc5 to 1
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-core-interceptors-5cdb877c4b              Error creating: pods "tekton-triggers-core-interceptors-5cdb877c4b-r9t88" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-core-interceptors" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-core-interceptors" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-core-interceptors" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-core-interceptors-5cdb877c4b              Error creating: pods "tekton-triggers-core-interceptors-5cdb877c4b-hdsgb" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-core-interceptors" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-core-interceptors" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-core-interceptors" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-core-interceptors-5cdb877c4b              Error creating: pods "tekton-triggers-core-interceptors-5cdb877c4b-d5frk" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-core-interceptors" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-core-interceptors" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-core-interceptors" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-core-interceptors-5cdb877c4b              Error creating: pods "tekton-triggers-core-interceptors-5cdb877c4b-dmbs7" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-core-interceptors" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-core-interceptors" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-core-interceptors" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-core-interceptors-5cdb877c4b              Error creating: pods "tekton-triggers-core-interceptors-5cdb877c4b-xhwcn" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-core-interceptors" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-core-interceptors" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-core-interceptors" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-core-interceptors-5cdb877c4b              Error creating: pods "tekton-triggers-core-interceptors-5cdb877c4b-pjlxn" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-core-interceptors" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-core-interceptors" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-core-interceptors" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-core-interceptors-5cdb877c4b              Error creating: pods "tekton-triggers-core-interceptors-5cdb877c4b-fcthd" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-core-interceptors" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-core-interceptors" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-core-interceptors" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-core-interceptors-5cdb877c4b              Error creating: pods "tekton-triggers-core-interceptors-5cdb877c4b-bpvpb" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-core-interceptors" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-core-interceptors" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-core-interceptors" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-core-interceptors-5cdb877c4b              Error creating: pods "tekton-triggers-core-interceptors-5cdb877c4b-xlvf7" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-core-interceptors" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-core-interceptors" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-core-interceptors" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             14m         Warning   FailedCreate              replicaset/tekton-triggers-core-interceptors-5cdb877c4b              (combined from similar events): Error creating: pods "tekton-triggers-core-interceptors-5cdb877c4b-xtxz6" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-core-interceptors" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-core-interceptors" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-core-interceptors" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             3m30s       Warning   FailedCreate              replicaset/tekton-triggers-core-interceptors-5cdb877c4b              Error creating: pods "tekton-triggers-core-interceptors-5cdb877c4b-4s9h9" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "tekton-triggers-core-interceptors" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "tekton-triggers-core-interceptors" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "tekton-triggers-core-interceptors" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Normal    ScalingReplicaSet         deployment/tekton-triggers-core-interceptors                         Scaled up replica set tekton-triggers-core-interceptors-5cdb877c4b to 1
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-webhook-7464568dfc                        Error creating: pods "tekton-triggers-webhook-7464568dfc-7dgsb" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "webhook" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "webhook" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "webhook" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-webhook-7464568dfc                        Error creating: pods "tekton-triggers-webhook-7464568dfc-ghl4p" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "webhook" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "webhook" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "webhook" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-webhook-7464568dfc                        Error creating: pods "tekton-triggers-webhook-7464568dfc-2w94v" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "webhook" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "webhook" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "webhook" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-webhook-7464568dfc                        Error creating: pods "tekton-triggers-webhook-7464568dfc-wlwgs" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "webhook" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "webhook" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "webhook" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-webhook-7464568dfc                        Error creating: pods "tekton-triggers-webhook-7464568dfc-nblcd" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "webhook" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "webhook" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "webhook" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-webhook-7464568dfc                        Error creating: pods "tekton-triggers-webhook-7464568dfc-84lpz" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "webhook" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "webhook" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "webhook" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-webhook-7464568dfc                        Error creating: pods "tekton-triggers-webhook-7464568dfc-rfjxw" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "webhook" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "webhook" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "webhook" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-webhook-7464568dfc                        Error creating: pods "tekton-triggers-webhook-7464568dfc-j2tv6" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "webhook" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "webhook" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "webhook" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             25m         Warning   FailedCreate              replicaset/tekton-triggers-webhook-7464568dfc                        Error creating: pods "tekton-triggers-webhook-7464568dfc-xcnfw" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "webhook" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "webhook" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "webhook" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             14m         Warning   FailedCreate              replicaset/tekton-triggers-webhook-7464568dfc                        (combined from similar events): Error creating: pods "tekton-triggers-webhook-7464568dfc-wrdkf" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "webhook" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "webhook" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "webhook" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
tekton-pipelines             3m50s       Warning   FailedCreate              replicaset/tekton-triggers-webhook-7464568dfc                        Error creating: pods "tekton-triggers-webhook-7464568dfc-vfgrz" is forbidden: violates PodSecurity "restricted:latest": unrestricted capabilities (container "webhook" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "webhook" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "webhook" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 3, 2022
@dibyom dibyom changed the title Use cos_containerd gke image for e2e tests Fixes for running on k8s 1.23 and restricted PodSecurityAdmission level Nov 3, 2022
This commit drops the Triggers PodSecurityPolicy since its deprecated and is
going to be removed in Kubernetes 1.25 in favor of PodSecurityAdmission.

In addition, it adds the `securityContext` required for the "restricted"
PodSecurityAdmission levels. These changes are necessary for Triggers to work
with Pipelines v0.41 and higher because tektoncd/pipeline#5652  started
enforcing the restricted pod security level for all pods in the
`tekton-pipelines` namespace (which includes the triggers controller, webhook,
and core interceptor deployments).

Fixes tektoncd#1447 and required for tektoncd#1475

Signed-off-by: Dibyo Mukherjee <[email protected]>
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: savitaashture

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 4, 2022
Copy link
Contributor

@savitaashture savitaashture left a comment

Choose a reason for hiding this comment

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

🎉

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2022
@tekton-robot tekton-robot merged commit ce7b976 into tektoncd:main Nov 4, 2022
@dibyom dibyom deleted the cos branch November 7, 2022 15:05
@dibyom dibyom added the kind/bug Categorizes issue or PR as related to a bug. label Nov 16, 2022
@seunggs
Copy link

seunggs commented Dec 4, 2022

@dibyom I apologize if this is the wrong place to provide feedback on this ticket, but I'm still getting this error on k8s v1.24, pipelines v0.42 and triggers v0.22 (I can confirm that securityContext fix is present in tekton-triggers-controller and -webhook):

Warning  FailedCreate  47s (x7 over 3m29s)  replicaset-controller  (combined from similar events): Error creating: pods "el-pulumi-el-8bc4bf7-nxznb" is forbidden: violates PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "event-listener" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "event-listener" must set securityContext.capabilities.drop=["ALL"]), seccompProfile (pod or container "event-listener" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")

@dibyom
Copy link
Member Author

dibyom commented Dec 5, 2022

@seunggs are you running an eventlistener in the tekton-pipelines namespace?

@dcshiman
Copy link

dcshiman commented Dec 5, 2022

@seunggs are you running an eventlistener in the tekton-pipelines namespace?

@dibyom I'm facing the same issue, running in tekton-pipelines namespace

@seunggs
Copy link

seunggs commented Dec 5, 2022

@dibyom Yes, tekton-pipelines namespace

@dibyom
Copy link
Member Author

dibyom commented Dec 5, 2022

ok - a quick workaround will be to run your EL in a different namespace till we add a fix

@seunggs
Copy link

seunggs commented Dec 5, 2022

@dibyom thanks - I've just changed the tekton-pipelines namespace setting: enforce -> warning for now and I was able to create the el. I'll revert to enforce once this is fixed. Thanks for your prompt attention to this!

@dcshiman
Copy link

dcshiman commented Dec 5, 2022

ok - a quick workaround will be to run your EL in a different namespace till we add a fix

thanks for the prompt replies @dibyom, my temp solution is to set

apiVersion: v1
kind: Namespace
metadata:
  name: tekton-pipelines
...
  labels:
-      pod-security.kubernetes.io/enforce: restricted
+      pod-security.kubernetes.io/enforce: baseline
+      pod-security.kubernetes.io/warn: restricted
...

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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PodSecurityPolicy removed in Kubernetes 1.25
5 participants