Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

cannot create deployments via automation when BYO cluster is used #18

Open
kasturinarra opened this issue Oct 6, 2022 · 2 comments
Open

Comments

@kasturinarra
Copy link
Contributor

kasturinarra commented Oct 6, 2022

What version of Go are you using (go version)?

$ go version

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What version of oc are you using (oc version)?

$ oc version

What did you run?

When the test to add BYO cluster is run i see that deployment fails to get created with the error below, i think we will have to wait for the resource discovery to happen before proceeding to create a deployment.

INFO Oct 6 16:04:02.056: Error running /bin/kubectl create deployment e2e-dep-m7qxaup6 -n e2e-ns-kcp-syncer-htzrr --image gcr.io/kuar-demo/kuard-amd64:blue --server=:e2e-test-kcp-syncer-45bwt:
error: failed to create deployment: the server could not find the requested resource (post deployments.apps)

Any logs?

INFO Oct 6 16:03:32.051: Creating workspace "e2e-test-kcp-syncer-45bwt"
INFO Oct 6 16:03:33.780: Workspace "e2e-test-kcp-syncer-45bwt" has been fully provisioned.
INFO Oct 6 16:03:33.780: Creating namespace "e2e-ns-kcp-syncer-htzrr"
STEP: # Create workload sync and generate syncer resources manifests in current workspace
STEP: # Apply syncer resources on pcluster and wait for synctarget become ready
namespace/kcp-syncer-mysyncer-32ovpysu-u3s7jto2 created
serviceaccount/kcp-syncer-mysyncer-32ovpysu-u3s7jto2 created
secret/kcp-syncer-mysyncer-32ovpysu-u3s7jto2-token created
clusterrole.rbac.authorization.k8s.io/kcp-syncer-mysyncer-32ovpysu-u3s7jto2 created
clusterrolebinding.rbac.authorization.k8s.io/kcp-syncer-mysyncer-32ovpysu-u3s7jto2 created
secret/kcp-syncer-mysyncer-32ovpysu-u3s7jto2 created
Warning: would violate PodSecurity "restricted:v1.24": allowPrivilegeEscalation != false (container "kcp-syncer" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "kcp-syncer" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "kcp-syncer" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "kcp-syncer" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
deployment.apps/kcp-syncer-mysyncer-32ovpysu-u3s7jto2 created
INFO Oct 6 16:03:58.152: SyncTarget/mysyncer-32ovpysu ready condition is True
INFO Oct 6 16:04:00.512: schemaAttributes are [NAME LOCATION READY SYNCED API RESOURCES KEY AGE]
INFO Oct 6 16:04:00.512: attributeValues are [mysyncer-32ovpysu mysyncer-32ovpysu True byNvoiar7aivEK46FX4YcRUKVOqjTwGJzDpSFt 23s]
STEP: # Creating workload using the BYO compute should work well
INFO Oct 6 16:04:02.056: Error running /bin/kubectl create deployment e2e-dep-m7qxaup6 -n e2e-ns-kcp-syncer-htzrr --image gcr.io/kuar-demo/kuard-amd64:blue --server=:e2e-test-kcp-syncer-45bwt:
error: failed to create deployment: the server could not find the requested resource (post deployments.apps)
error: failed to create deployment: the server could not find the requested resource (post deployments.apps)
INFO Oct 6 16:04:04.946: Error running /bin/kubectl delete deployment e2e-dep-m7qxaup6 -n e2e-ns-kcp-syncer-htzrr --server=/clusters/root:users:lw:ao:rh-sso-knarrakcp:e2e-test-kcp-syncer-45bwt:
error: the server doesn't have a resource type "deployment"
error: the server doesn't have a resource type "deployment"
INFO Oct 6 16:04:08.133: Error running /bin/kubectl delete -f /tmp/e2e-test-kcp-syncer-45bwt.mysyncer-32ovpysu.yaml --kubeconfig=/home/knarra/Downloads/kubeconfig_411:
namespace "kcp-syncer-mysyncer-32ovpysu-u3s7jto2" deleted
serviceaccount "kcp-syncer-mysyncer-32ovpysu-u3s7jto2" deleted
clusterrole.rbac.authorization.k8s.io "kcp-syncer-mysyncer-32ovpysu-u3s7jto2" deleted
clusterrolebinding.rbac.authorization.k8s.io "kcp-syncer-mysyncer-32ovpysu-u3s7jto2" deleted
secret "kcp-syncer-mysyncer-32ovpysu-u3s7jto2" deleted
deployment.apps "kcp-syncer-mysyncer-32ovpysu-u3s7jto2" deleted
Error from server (NotFound): error when deleting "/tmp/e2e-test-kcp-syncer-45bwt.mysyncer-32ovpysu.yaml": secrets "kcp-syncer-mysyncer-32ovpysu-u3s7jto2-token" not found

What did you expect to see?

wait for the discovery to happen before proceeding with creating the deployment.

@kasturinarra
Copy link
Contributor Author

Also see that comparing schemaAttributes with attributesValues are failing and below is the log and i think waiting for the discovery to happen for the deployment should help us resolve this issue as well i what i am thinking.

INFO Oct 7 00:11:11.436: SyncTarget/mysyncer-ld90n0ga ready condition is True
INFO Oct 7 00:11:13.281: schemaAttributes are [NAME LOCATION READY SYNCED API RESOURCES KEY AGE]
INFO Oct 7 00:11:13.281: attributeValues are [mysyncer-ld90n0ga mysyncer-ld90n0ga True 1ZmzFQ0Uekvuw773dvHTbOiO7qOQLZoQ6cYCei 35s]

fail [/home/knarra/automation/Openshift/kcp-tests/test/extended/syncer/syncer_utils.go:129]: Expected
: 6
to equal
: 5

@Phaow
Copy link
Contributor

Phaow commented Oct 18, 2022

Good catch! It should be fixed in #22.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants