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

Can't install Camel-K 2.0 nightly on OpenShift cluster #4476

Closed
bouskaJ opened this issue Jun 12, 2023 · 3 comments
Closed

Can't install Camel-K 2.0 nightly on OpenShift cluster #4476

bouskaJ opened this issue Jun 12, 2023 · 3 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@bouskaJ
Copy link
Contributor

bouskaJ commented Jun 12, 2023

I am getting following error

2s          Warning   FailedCreate        replicaset/camel-k-operator-84b7b556ff   Error creating: pods "camel-k-operator-84b7b556ff-" is forbidden: unable to validate against any security context constraint: [provider "anyuid": Forbidden: not usable by user or serviceaccount, provider restricted-v2: .spec.securityContext.fsGroup: Invalid value: []int64{0}: 0 is not an allowed group, provider "restricted": Forbidden: not usable by user or serviceaccount, provider "nonroot-v2": Forbidden: not usable by user or serviceaccount, provider "nonroot": Forbidden: not usable by user or serviceaccount, provider "hostmount-anyuid": Forbidden: not usable by user or serviceaccount, provider "machine-api-termination-handler": Forbidden: not usable by user or serviceaccount, provider "hostnetwork-v2": Forbidden: not usable by user or serviceaccount, provider "hostnetwork": Forbidden: not usable by user or serviceaccount, provider "hostaccess": Forbidden: not usable by user or serviceaccount, provider "node-exporter": Forbidden: not usable by user or serviceaccount, provider "privileged": Forbidden: not usable by user or serviceaccount]

trying to install Camel-K operator on OpenShift.

The full scenario:

oc new-project jbouska
Already on project "jbouska" on server "https://api.camel-k-412-b.fuse.integration-qe.com:6443".

You can add applications to this project with the 'new-app' command. For example, try:

    oc new-app rails-postgresql-example

to build a new example application in Ruby. Or use kubectl to deploy a simple Kubernetes application:

    kubectl create deployment hello-node --image=k8s.gcr.io/serve_hostname

➜  camel-k git:(main) ✗ ./kamel install --olm=false --maven-repository=https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots --operator-image docker.io/testcamelk/camel-k:2.0.0-nightly --storage=false 

Camel K installed in namespace jbouska 
➜  camel-k git:(main) ✗ oc get pods
No resources found in jbouska namespace.
➜  camel-k git:(main) ✗ oc get events
LAST SEEN   TYPE      REASON              OBJECT                                   MESSAGE
2s          Warning   FailedCreate        replicaset/camel-k-operator-84b7b556ff   Error creating: pods "camel-k-operator-84b7b556ff-" is forbidden: unable to validate against any security context constraint: [provider "anyuid": Forbidden: not usable by user or serviceaccount, provider restricted-v2: .spec.securityContext.fsGroup: Invalid value: []int64{0}: 0 is not an allowed group, provider "restricted": Forbidden: not usable by user or serviceaccount, provider "nonroot-v2": Forbidden: not usable by user or serviceaccount, provider "nonroot": Forbidden: not usable by user or serviceaccount, provider "hostmount-anyuid": Forbidden: not usable by user or serviceaccount, provider "machine-api-termination-handler": Forbidden: not usable by user or serviceaccount, provider "hostnetwork-v2": Forbidden: not usable by user or serviceaccount, provider "hostnetwork": Forbidden: not usable by user or serviceaccount, provider "hostaccess": Forbidden: not usable by user or serviceaccount, provider "node-exporter": Forbidden: not usable by user or serviceaccount, provider "privileged": Forbidden: not usable by user or serviceaccount]
12s         Normal    ScalingReplicaSet   deployment/camel-k-operator              Scaled up replica set camel-k-operator-84b7b556ff to 1
➜  camel-k git:(main) ✗ oc get pods  
No resources found in jbouska namespace.
@bouskaJ bouskaJ changed the title Can't install Camel-K 2.0 nightly on OCP Can't install Camel-K 2.0 nightly on OpenShift cluster Jun 12, 2023
@gansheer
Copy link
Contributor

@squakez I will look into it.

@squakez squakez added the kind/bug Something isn't working label Jun 12, 2023
@squakez squakez added this to the 2.0.0 milestone Jun 12, 2023
@gansheer
Copy link
Contributor

gansheer commented Jun 13, 2023

Ok, so the volumes can't be mounted in root mode by the operator pod when deploying in an OCP newly created project that is not default. I will find a way to fix this.
Also the user 1000 for the builder pod does not work in OCP, declaring RunAsNonRoot in the PodSecurityContext works better.

gansheer added a commit to gansheer/camel-k that referenced this issue Jun 14, 2023
…lity

Ref apache#4476

* replase 1000 user by nonRoot option on builder pod
* remove 0 (root) user for FS mounts on operator pod
gansheer added a commit to gansheer/camel-k that referenced this issue Jun 23, 2023
Ref apache#4476

* replace 1001 user/group by a valid user compatible with SecurityContextConstraint user range from namespace label
* remove 0 (root) user for FS mounts on operator pod
gansheer added a commit to gansheer/camel-k that referenced this issue Jun 23, 2023
Ref apache#4476

* replace 1001 user/group by a valid user compatible with SecurityContextConstraint user range from namespace label
* remove 0 (root) user for FS mounts on operator pod
gansheer added a commit to gansheer/camel-k that referenced this issue Jun 23, 2023
Ref apache#4476

* replace 1001 user/group by a valid user compatible with SecurityContextConstraint user range from namespace label
* remove 0 (root) user for FS mounts on operator pod
@squakez
Copy link
Contributor

squakez commented Jul 3, 2023

We should have closed this by #4487

@squakez squakez closed this as completed Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants