kube-notary icon indicating copy to clipboard operation
kube-notary copied to clipboard

OpenShift environment - Kube-Notary pod runs into permission error

Open opvizordz opened this issue 5 years ago • 2 comments

I deployed Kube-Notary into our OpenShift environment using the deployment scripts in this repo (kubernetes/kube-notary/templates):

Step by step I ran:

oc login -u system:admin
 kubectl apply -f serviceaccount.yaml
 oc adm policy add-scc-to-user privileged -z kube-notary
 kubectl apply -f role.yaml
 kubectl apply -f rolebinding.yaml
 kubectl apply -f service.yaml
 kubectl apply -f configmap.yaml
 kubectl apply -f deployment.yaml

When checking the logs of the kube-notary pod:

kubectl get  pods | grep kube-notary
kubectl logs kube-notary-...

I see the following errors:

Error getting pods: pods is forbidden: User \"system:serviceaccount:test:kube-notary\" cannot list pods at the cluster scope: no RBAC policy matched"

No data is being collected.

opvizordz avatar Oct 23 '19 16:10 opvizordz

I actually solved it myself ... OpenShift is automatically pointing to the project namespace when running kubectl. The file rolebinding.yaml points to namespace default. In my case the project was not in the namespace default but test.

Changing the namespace to test, did the trick

opvizordz avatar Oct 23 '19 16:10 opvizordz

It just needs to be well documented. I'll close the issue when done.

leogr avatar Oct 23 '19 19:10 leogr