The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Kubernetes CLI Plugin

withKubeConfig: Configure Kubernetes CLI (kubectl)

Configure Kubernetes client (kubectl) so it can be used in the build to run Kubernetes commands
  • caCertificate : String (optional)
    The certificate of the certificate authority (CA). It's used to validate the API server certificate.

    Leaving this field empty will skip the certificate verification.

  • clusterName : String (optional)
    Cluster name to use or to switch to.
  • contextName : String (optional)
    Context name to use or to switch to.
  • credentialsId : String (optional)
  • namespace : String (optional)
    Default namespace.
  • restrictKubeConfigAccess : boolean (optional)
    Restrict access to kubeconfig file to the Jenkins Agent's user.
  • serverUrl : String (optional)
    URL of the Kubernetes API endpoint.

withKubeCredentials: Configure Kubernetes CLI (kubectl) with multiple credentials

  • kubectlCredentials (optional)
      Array / List of Nested Object
    • caCertificate : String (optional)
    • clusterName : String (optional)
    • contextName : String (optional)
    • credentialsId : String (optional)
    • namespace : String (optional)
    • serverUrl : String (optional)

wrap([$class: 'MultiKubectlBuildWrapper']): Configure Kubernetes CLI (kubectl) with multiple credentials

  • kubectlCredentials (optional)
      Array / List of Nested Object
    • caCertificate : String (optional)
    • clusterName : String (optional)
    • contextName : String (optional)
    • credentialsId : String (optional)
    • namespace : String (optional)
    • serverUrl : String (optional)
  • restrictKubeConfigAccess : boolean (optional)

wrap([$class: 'KubectlBuildWrapper']): Configure Kubernetes CLI (kubectl) (deprecated, use the multi credentials one instead)

Configure Kubernetes client (kubectl) so it can be used in the build to run Kubernetes commands
  • caCertificate : String (optional)
    The certificate of the certificate authority (CA). It's used to validate the API server certificate.

    Leaving this field empty will skip the certificate verification.

  • clusterName : String (optional)
    Cluster name to use or to switch to.
  • contextName : String (optional)
    Context name to use or to switch to.
  • credentialsId : String (optional)
  • namespace : String (optional)
    Default namespace.
  • restrictKubeConfigAccess : boolean (optional)
    Restrict access to kubeconfig file to the Jenkins Agent's user.
  • serverUrl : String (optional)
    URL of the Kubernetes API endpoint.

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.