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

Tekton Operator SCC / UID CreateContainerError #1772

Open
ArthurVardevanyan opened this issue Oct 13, 2023 · 9 comments
Open

Tekton Operator SCC / UID CreateContainerError #1772

ArthurVardevanyan opened this issue Oct 13, 2023 · 9 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@ArthurVardevanyan
Copy link

Expected Behavior

Deployments:

  • openshift-pipelines-operator
  • tekton-operator-webhook

Actual Behavior

Error: container has runAsNonRoot and image will run as root (pod: "openshift-pipelines-operator-ccc7779d6-556lb_openshift-pipelines-operator(7aae737c-ba63-487e-821a-c9b03880c6ef)", container: openshift-pipelines-operator-cluster-operations)

Screenshot from 2023-10-12 21-27-06

Steps to Reproduce the Problem

  1. Install: https://github.com/tektoncd/operator/releases/download/v0.68.0/openshift-release.yaml

Additional Info

Client Version: 4.14.0-rc.5
Server Version: 4.14.0-0.okd-2023-10-12-150331
Kubernetes Version: v1.27.1-3342+98158f96f30cce-dirty

Tekton Pipeline version:

  • Operator: v0.68.0
@ArthurVardevanyan ArthurVardevanyan added the kind/bug Categorizes issue or PR as related to a bug. label Oct 13, 2023
@pratap0007
Copy link
Contributor

/assign

@vdemeester
Copy link
Member

I think we need to update the base image from .ko.yaml to use an image that defines a user (ubi-minimal probably doesn't).

@ArthurVardevanyan
Copy link
Author

ArthurVardevanyan commented Mar 11, 2024

The issue appears to be due to the elevated SCCs assigned to the operator pods, it is picking up the AnyUID SCC when it doesn't need it, and OpenShift is no longer injecting the random ID.

Forcing the Deployment to use restriced-v2 takes care of the issue:

@Elyytscha
Copy link

same or similar over here when installing the latest tekton operator from operatorhub on okd 4.15

image

@vdemeester
Copy link
Member

vdemeester commented Mar 29, 2024

@ArthurVardevanyan from ArthurVardevanyan/HomeLab@f6a0c23, the previous state was pod-security.kubernetes.io/enforce: privileged which is not something the operator sets, anywhere.

Just tried on a brand new cluster, oc apply -f https://github.com/tektoncd/operator/releases/download/v0.68.0/openshift-release.yaml.

NAME                                            READY   STATUS    RESTARTS   AGE
openshift-pipelines-operator-7989dfd96b-fjkl4   2/2     Running   0          9s
tekton-operator-webhook-76c89b7bb7-5rmcb        1/1     Running   0          9s

All just work.

Looking at openshift-operators, it does have it:

  labels:
    kubernetes.io/metadata.name: openshift-operators
    openshift.io/cluster-monitoring: "true"
    openshift.io/scc: ""
    pod-security.kubernetes.io/enforce: privileged
    pod-security.kubernetes.io/enforce-version: v1.24

But this is not set by openshift-pipelines, it's probably the default label and is not required for OpenShift Pipelines operator. Also, from your repo, you are deploying it in openshift-pipelines-operator namespace, so you own that namespace, and it's up to you to create it with restricted-v2, it's not something the operator controls.

@Elyytscha which operator from the hub did you install ? If it is https://operatorhub.io/operator/tektoncd-operator it is "tailored" for Kubernetes (e.g. it doesn't remove the specified user if the operand payload such as pipeline, …) and will not work properly on OpenShift (or OKD).

@ArthurVardevanyan
Copy link
Author

ArthurVardevanyan commented Mar 29, 2024

@vdemeester, Generally I avoid installing anything into the openshift-operators, I have ran into issues in the past, when installing many operators into that single namespace.

@Elyytscha
Copy link

@Elyytscha which operator from the hub did you install ? If it is https://operatorhub.io/operator/tektoncd-operator it is "tailored" for Kubernetes (e.g. it doesn't remove the specified user if the operand payload such as pipeline, …) and will not work properly on OpenShift (or OKD).

why its like this? the operator should check if he runs on openshift or not and do the appropriate stuff

the tekton operator is only available via the link you posted, there is no tekton operator in the openshift repos so its the only option to install tekton
https://github.com/redhat-openshift-ecosystem/community-operators-prod here is no tekton operator
(i think we all agree that OLM is superior and we should avoid helm, kustomize, plain yamls when we can use olm for operator install)

@vdemeester
Copy link
Member

why its like this? the operator should check if he runs on openshift or not and do the appropriate stuff

this is not the case today at least. Today there is one build for vanilla k8s and one for openshift (and the latter is supported by red hat). But yeah ideally, we could have one build that adapts, but it would/will require a lot of work/refactoring 😇.

the tekton operator is only available via the link you posted, there is no tekton operator in the openshift repos so its the only option to install tekton

For openshift it is called openshift-pipelines, but it is only available from red hat catalog. I think it is available for OKD but I am not 100% sure of that 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

4 participants