Is there a way to create a Tekton EventListener with a securityContext? I can't seem to find anything in the documentation for this and I'm unable to get one running in my environment because of the following error that shows up in the EventListener status:
Message: pods "el-github-listener-interceptor-7b89d546dd-m6rdz" 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")
My EventListener is defined as follows:
apiVersion: triggers.tekton.dev/v1beta1
kind: EventListener
metadata:
name: github-listener-interceptor
namespace: tekton-pipelines
spec:
serviceAccountName: sa-tekton-triggers
triggers:
- name: github-listener
interceptors:
- ref:
name: "github"
params:
- name: "eventTypes"
value: ["push"]
- ref:
name: cel
params:
- name: filter
# execute only when ....
value: extensions.changed_files.matches('src/')
bindings:
- ref: pipeline-reach-dashboard-binding
template:
ref: pipeline-reach-dashboard-template
I've tried adding in the securityContext block every spot imaginable, but no luck.
Thanks!
Update. Looks like this is possibly a bug:
https://github.com/tektoncd/pipeline/issues/5896
Moving the EventListener and trigger items to a different namespace other than tekton-pipelines allow me to work around this