May 2018
Intermediate to advanced
554 pages
13h 51m
English
Imagine that after using Jenkins successfully to build your application container, you then use kubectl to update deployment to roll out a new binary. To do that, invoke a kubectl command from the inside of a Jenkins pod. In this scenario, we need a credential to communicate to the Kubernetes master.
Fortunately, Kubernetes supports this kind of scenario, which uses a service account. It is described in detail in Chapter 8, Advanced Cluster Administration. So, this recipe will use the simplest way, which uses the default namespace and cluster-admin ClusterRole.
To check whether RBAC is enabled and also if the cluster-admin ClusterRole exists or not, type the kubectl get clusterrole command: ...