<p>I am configuring an installation of Jenkins through JCasC. One of the plugins we're using is Kubernetes. 
In order to configure, it needs a server certificate to communicate with the k8s cluster. </p>

<p>This is how that part of the config looks like: </p>

<pre><code>jenkins:
    clouds:
       -kubernetes: 
            name: "kubernetes"
            serverUrl: "k8s URL"
            serverCertificate: "serverCertificate"
            skipTlsVerify: true
</code></pre>

<p>I am wondering how I can reference a file that contains the server certificate and put that file at the serverCertificate.</p>

Passero
<p>I would recommend you to rather use a predefined [jenkins] credentials:</p>

<p><a href="https://i.stack.imgur.com/ULM5n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ULM5n.png" alt="enter image description here"></a></p>

<p>and reference them inside JCasC pipeline as a way of accessing Kubernetes cluster.</p>

<pre><code>jenkins:
  clouds:
    - kubernetes:
        name: "advanced-k8s-config"
        serverUrl: "https://avanced-k8s-config:443"
        skipTlsVerify: true
        namespace: "default"
        credentialsId: "advanced-k8s-credentials"
        jenkinsUrl: "http://jenkins/"
        ...
credentials:
  system:
    domainCredentials:
      - credentials:
          - fileSystemServiceAccountCredential:
              id: "advanced-k8s-credentials"
</code></pre>

<p>Please check <a href="https://github.com/jenkinsci/configuration-as-code-plugin/blob/58ed8c3f8fd20af5956de995c4ce17970359e06d/demos/kubernetes/adv_config.yml#L13" rel="nofollow noreferrer">here</a> for full code example.</p>
