<p><a href="https://i.stack.imgur.com/BVnxW.png" rel="nofollow noreferrer">enter image description here</a>I have deployed Jenkins container inside the k8s cluster successfuly but I can't able to execute &quot;kubectl get pod -A&quot; where as kubectl also installed inside the Jenkins container. How can I run k8s command inside the Jenkins container so I can able to apply CI/CD for k8s.
Below is the errors when I run k8s command inside the Jenkins container which is running inside the k8s pod.</p>

Hassan Shamshir
<p>You need to create the cluster role binding for the service account jenkins.</p>
<ol>
<li>Create a file with the name sa.yaml and add below content in it</li>
</ol>
<pre><code>apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: jenkins-role-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: jenkins
  namespace: jenkins
</code></pre>
<ol start="2">
<li>Create the role binding using the command.</li>
</ol>
<pre><code>kubectl apply -f sa.yaml
</code></pre>
