diff --git a/README.md b/README.md index 985b10d..d6516fd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Kubernetes Cli Plugin +# Kubernetes CLI Plugin [![build-status](https://ci.jenkins.io/buildStatus/icon?job=Plugins/kubernetes-cli-plugin/master/)][master-build] [![Coverage Status](https://coveralls.io/repos/github/jenkinsci/kubernetes-cli-plugin/badge.svg?branch=master)](https://coveralls.io/github/jenkinsci/kubernetes-cli-plugin?branch=master) @@ -8,6 +8,10 @@ Any tool built on top of `kubectl` can then be used from your pipelines, e.g. [k Initially extracted and rewritten from the [Kubernetes Plugin][kubernetes-plugin]. +## Prerequisites +* An executor with `kubectl` installed (tested against v1.8, v1.9, v1.10, v1.11) +* A Kubernetes cluster + ## Supported credentials The following types of credentials are supported and can be used to authenticate against Kubernetes clusters: * Username and Password (see [Credentials plugin][credentials-plugin]) @@ -22,26 +26,29 @@ The following types of credentials are supported and can be used to authenticate The `kubernetes-cli` plugin provides the function `withKubeConfig()` for Jenkins Pipeline support. You can go to the *Snippet Generator* page under *Pipeline Syntax* section in Jenkins, select *withKubeConfig: Setup Kubernetes CLI* from the *Sample Step* dropdown, and it will provide you configuration -interface for the plugin. -After filling the entries and click *Generate Pipeline Script* button, you will get the sample scripts which can be used +interface for the plugin. After filling the entries and click *Generate Pipeline Script* button, you will get the sample scripts which can be used in your Pipeline definition. -The arguments to the `withKubeConfig` step are: -* `credentialsId` - the Jenkins identifier of the credentials to use. -* `caCertificate` - an optional base64-encoded certificate to check the Kubernetes api server's against. If you don't specify one, the CA verification will be skipped. -* `serverUrl` - the url of the api server - Example: ```groovy node { stage('List pods') { - withKubeConfig([credentialsId: '', caCertificate: '', serverUrl: '']) { + withKubeConfig([credentialsId: '', + caCertificate: '', + serverUrl: '' + ]) { sh 'kubectl get pods' } } } ``` +The arguments to the `withKubeConfig` step are: +* `credentialsId` - the Jenkins identifier of the credentials to use. +* `caCertificate` - an optional base64-encoded certificate to check the Kubernetes api server's against. If you don't specify one, the CA verification will be skipped. +* `serverUrl` - the url of the api server + + ### From the web interface In Jenkins > *job name* > Configure > **Build Environment** @@ -77,4 +84,4 @@ mvn clean test [kubectl]:https://kubernetes.io/docs/reference/kubectl/overview/ [kubernetes-deploy]:https://github.com/Shopify/kubernetes-deploy [master-build]: https://ci.jenkins.io/job/Plugins/job/kubernetes-cli-plugin/job/master/ -[issue-tracker]: https://issues.jenkins-ci.org/issues/?jql=project%20%3D%20JENKINS%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened%2C%20%22In%20Review%22)%20AND%20component%20%3D%20kubernetes-cli-plugin +[issue-tracker]: https://issues.jenkins-ci.org/issues/?jql=project%20%3D%20JENKINS%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened%2C%20%22In%20Review%22)%20AND%20component%20%3D%20kubernetes-cli-plugin \ No newline at end of file