How to Solve “Error from server (Forbidden): buildconfigs.build.openshift.io build-name is forbidden”

I had this error while building an image on Jenkins from one Openshift namespace to another namespace. This happens mainly due to limited access that the corresponding Jenkins user have on the target namespace.

Error from server (Forbidden): buildconfigs.build.openshift.io "hello-world" is forbidden: 
User "system:serviceaccount:cicd:jenkins" 
cannot create resource "buildconfigs/instantiatebinary" in API group 
"build.openshift.io" in the namespace "apps"

How to solve it is actually quite easy, we are giving admin privilege to jenkins service account user.

oc policy add-role-to-user admin system:serviceaccount:cicd:jenkins -n apps

Leave a Comment

Your email address will not be published.