<p>It looks like you are missing the service account configurations bit. Refer to : <a href="https://devopscube.com/jenkins-build-agents-kubernetes/" rel="nofollow noreferrer">https://devopscube.com/jenkins-build-agents-kubernetes/</a></p>
<blockquote>
<p>If your Jenkins server is running outside the Kubernetes cluster, you need to specify the following.</p>
<ol>
<li>Kubernetes URL: This is the Kubernete master API endpoint. If is it https enabled, use the https url.</li>
<li>Kubernete Server Certificate key: If you have a the Kubernetes Cluster CA certificate, you can add it for secure connectivity. You
can get the certificate from the pod location
/var/run/secrets/kubernetes.io/serviceaccount/ca.crt .If you dont have
the certificate, you can enable the “disable https certificate check”
option.</li>
<li>Credentials: For Jenkins to communitcate with the Kubernetes cluster, we need a service account token with permissions to deploy
pods in the devops-tools namespace.</li>
</ol>
</blockquote>

CC BY-SA 4.0
2022-01-25T05:12:14.263Z
2022-01-25T05:12:14.263Z
kent.io
<p>You could install Jenkins using helm to install the k8s plugin as well.</p>

<p><a href="https://github.com/helm/charts/tree/master/stable/jenkins" rel="nofollow noreferrer">https://github.com/helm/charts/tree/master/stable/jenkins</a></p>

CC BY-SA 4.0
2019-12-31T19:50:30.800Z
2019-12-31T19:50:30.800Z
030
<p>I find the documentation at <a href="https://github.com/jenkinsci/kubernetes-plugin" rel="noreferrer">https://github.com/jenkinsci/kubernetes-plugin</a> quite unclear when it comes to step by step configuration of external Jenkins master.</p>

<p>What are the exact steps that need to be followed?
I have installed the Kubernetes plugin and I have tried to supply some cluster info, but I have got lost there.</p>

<p>For Name I have taken the output from kubectl config view --raw, specifically the context for the given cluster and the cluster name part.</p>

<p>For Kubernetes URL I have set the IP address from the Server field in the same output from above.</p>

<p>Kubernetes server certificate key - for this part I have initially tried to follow the same pattern from above and take the value of the certificate-authority-data field, but I got an "Error testing connection <a href="https://XX.XXX.XXX.XX" rel="noreferrer">https://XX.XXX.XXX.XX</a>: java.security.cert.CertificateException: Could not parse certificate: java.io.IOException: Empty input", so I have attempted to convert that value with echo "the field value here" | base64 -d > ca.crt and use that, but it failed again and I have also got it form the UI for GKE show cluster ceritficate section, all of them give me failure on testing connection with the error from above.</p>

<p>I couldn't really go past this point, but I see everything being quite unclear forward, so I would appreciate a step-by-step recommendation or any guide that I am missing.</p>

CC BY-SA 4.0
2019-12-31T18:19:54.050Z
Thank you for posting a question. Could you modify the question so that it contains the attempts you have done in order to solve the issue? What type of Linux, e.g. Ubuntu, Centos? What commands were run? How does the configuration look like? What does the log indicate?
030
CC BY-SA 4.0
2021-03-07T12:45:54.120Z
Have you ever been able to figure this out? I am also stuck on this and the directions on the plugin page leave a lot to be desired.
senfo
<jenkins><kubernetes><cicd>
Connect external Jenkins Master to GKE with Kubernetes plugin
Daniel Johns
# Connect external Jenkins Master to GKE with Kubernetes plugin

(Asked by: username_0 on 2019-09-02)

I find the documentation at <https://github.com/jenkinsci/kubernetes-plugin> quite unclear when it comes to step by step configuration of external Jenkins master.

What are the exact steps that need to be followed?
I have installed the Kubernetes plugin and I have tried to supply some cluster info, but I have got lost there.

For Name I have taken the output from kubectl config view --raw, specifically the context for the given cluster and the cluster name part.

For Kubernetes URL I have set the IP address from the Server field in the same output from above.

Kubernetes server certificate key - for this part I have initially tried to follow the same pattern from above and take the value of the certificate-authority-data field, but I got an "Error testing connection <https://XX.XXX.XXX.XX>: java.security.cert.CertificateException: Could not parse certificate: java.io.IOException: Empty input", so I have attempted to convert that value with echo "the field value here" | base64 -d > ca.crt and use that, but it failed again and I have also got it form the UI for GKE show cluster ceritficate section, all of them give me failure on testing connection with the error from above.

I couldn't really go past this point, but I see everything being quite unclear forward, so I would appreciate a step-by-step recommendation or any guide that I am missing.

**Tags:** jenkins, kubernetes, cicd

> **Comments:**
> **username_1**: Thank you for posting a question. Could you modify the question so that it contains the attempts you have done in order to solve the issue? What type of Linux, e.g. Ubuntu, Centos? What commands were run? How does the configuration look like? What does the log indicate?  
> **username_2**: Have you ever been able to figure this out? I am also stuck on this and the directions on the plugin page leave a lot to be desired.  

---

## 2 answers

### Answer by username_3 on 2022-01-25. Score: 1

It looks like you are missing the service account configurations bit. Refer to : <https://devopscube.com/jenkins-build-agents-kubernetes/>

> If your Jenkins server is running outside the Kubernetes cluster, you need to specify the following.
>
> 1. Kubernetes URL: This is the Kubernete master API endpoint. If is it https enabled, use the https url.
> 2. Kubernete Server Certificate key: If you have a the Kubernetes Cluster CA certificate, you can add it for secure connectivity. You
>    can get the certificate from the pod location
>    /var/run/secrets/kubernetes.io/serviceaccount/ca.crt .If you dont have
>    the certificate, you can enable the “disable https certificate check”
>    option.
> 3. Credentials: For Jenkins to communitcate with the Kubernetes cluster, we need a service account token with permissions to deploy
>    pods in the devops-tools namespace.


---

### Answer by username_1 on 2019-12-31. Score: -1

You could install Jenkins using helm to install the k8s plugin as well.

<https://github.com/helm/charts/tree/master/stable/jenkins>


---

