<p>I am configuring Jenkins to automatically deploy my successfull builds to my Kubernetes cluster. I have manually set up the <code>KUBECONFIG</code> file in <code>/var/lib/jenkins/.kube/config</code>.</p>
<p>But my Jenkins job keeps giving the same error:</p>
<pre><code>+ kubectl config --kubeconfig=/var/lib/jenkins/.kube/config view
error: error loading config file &quot;/var/lib/jenkins/.kube/config&quot;: v1.Config.Contexts: \
[]v1.NamedContext: Clusters: []v1.NamedCluster: v1.NamedCluster.Name: Cluster: v1.Cluster.Server: \
CertificateAuthorityData: decode base64: illegal base64 data at input byte 47, error found in #10 byte of ... \
|ASXY9gkN$&quot;,&quot;server&quot;:|..., bigger context ...|&quot;LS3tGS1PR0dJTiBDRVJUMLPAR0FURS0tLS0tCk1JSUV5gkN$&quot;, \
&quot;server&quot;:&quot;https://clsx-cloud-d734ef-0b|...
</code></pre>
<p>I copied the kube config file manually from my SSH accessible account, i.e</p>
<pre><code>cat home/username/.kube/config
</code></pre>

marcuse
<p>You most likely copied the wrong screen output from the terminal, or while editing the file in i.e <code>nano</code>.</p>
<p>The <code>$</code> characters are illegal characters and the result of truncated file viewing in the terminal, make sure that you copy the real file data correctly.</p>
<p>For example:</p>
<pre><code>xclip -sel clip &lt; home/username/.kube/config
</code></pre>
