Kubeconfig for deploying to all namespaces in a k8s cluster

7/8/2019

I am looking at instructions on how to go about generating a kubeconfig file that can deploy, delete my k8s deployment to all namespaces and also have have permissions to create, delete and view secrets in all namespaces.

The use case for this kubeconfig is to use it in Jenkins for performing deployments to a kube cluster.

I am aware of k8s service accounts with role and rolebindings, however it appears they can be used to only to specific namespace(s)

Thanks

-- GSM
kubernetes

1 Answer

7/8/2019

you should create cluster role and cluster role bindings to grant access cluster level. Then using the service account that has cluster level access, you should be able to do the stuff across all namespaces.

-- P Ekambaram
Source: StackOverflow