simple pipeline. kubernetes runner. setup as per online examples (role bindings, etc…).
making just a test thing. but won’t work…
making push from developer’s VM, all good, then it logs this:
{“level”:“debug”,“msg”:“api: read access granted”,“name”:“go_070921”,“namespace”:“devops”,“request-id”:“1xooLGZ85HojeFNjVdX078B2FQf”,“time”:“2021-09-07T16:05:44Z”,“user.login”:“devops”,“visibility”:“public”}
and runner logs this:
failed to create secret" error=“secrets is forbidden: User “system:serviceaccount:development:default” cannot create resource “secrets” in API group “” in the namespace “development”” namespace=development
“failed to delete secret” error=“secrets “drone-lcjzvvuk2ht4sr5w18xt” is forbidden: User “system:serviceaccount:development:default” cannot delete resource “secrets” in API group “” in the namespace “development”” namespace=development
drone UI says: go_app - clone: skipped and nothing more…
time=“2021-10-13T00:29:55Z” level=error msg=“failed to create secret” error=“secrets is forbidden: User “system:serviceaccount:tools:drone-runner-drone-runner-kube” cannot create resource “secrets” in API group “” in the namespace “tools”” namespace=tools pod=drone-cvvpk7kp4sshr03keoa2
time=“2021-10-13T00:30:01Z” level=error msg=“failed to delete secret” error=“secrets “drone-cvvpk7kp4sshr03keoa2” is forbidden: User “system:serviceaccount:tools:drone-runner-drone-runner-kube” cannot delete resource “secrets” in API group “” in the namespace “tools”” namespace=tools pod=drone-cvvpk7kp4sshr03keoa2
cannot create resource “secrets” in API group “” in the namespace “tools”
The Kubernetes pipeline executes inside a Pod, and Drone secrets are injected into Pods as Kubernetes secrets that are created at runtime, using the Kubernetes API. This error indicates you have not given the Kubernetes runner sufficient permission to create a Kubernetes secret in the target namespace.