<p>I have an on-premise kubernetes cluster v1.22.1 (1 master &amp; 2 worker nodes) and wanted to run jenkins slave agents on this kubernetes cluster using kubernetes plugin on jenkins. Jenkins is currently hosted outside of K8s cluster, running  2.289.3. For Kubernetes credentials in Jenkins Cloud, I have created new service account with cluster role cluster-admin and provided token secret text to Jenkins. The connection between Jenkins and Kubernetes has been established successfully however when I am running a jenkins job to create pods in kubernetes, pods are showing error and not coming online.</p>
<p>Below are the Kubernetes Logs.
<a href="https://i.stack.imgur.com/Kj6qm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Kj6qm.png" alt="enter image description here" /></a></p>
<p><a href="https://i.stack.imgur.com/xVVg1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xVVg1.png" alt="enter image description here" /></a></p>
<p>Jenkins logs
<a href="https://i.stack.imgur.com/03cJw.png" rel="noreferrer"><img src="https://i.stack.imgur.com/03cJw.png" alt="enter image description here" /></a>
Has any experienced such issue when connecting from Jenkins master, installed outside of kubernetes cluster?</p>

P. Phalak
<p>I understand that rootCAConfigMap publishes the kube-root-ca.crt in each namespace for default service account. Starting from kubernetes version 1.22, RootCAConfigMap is set to true by default and hence when creating pods, this certificate for default account is being used. Please find more info on bound service account token based projected volumes -
<a href="https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/</a></p>
<p>To stop creating automated volume using default service account or specific service account that has been used for creating pods, simply set &quot;automountServiceAccountToken&quot; to &quot;false&quot; under serviceaccount config which should then allow jenkins to create slave pods on Kubernetes cluster. I have tested this successfully in my on premise cluster.</p>
