diff --git a/README.md b/README.md index 84e3063..d7c3fcf 100644 --- a/README.md +++ b/README.md @@ -6,38 +6,51 @@ This plugin allows to update a Kubernetes deployment. This pipeline will update the `my-deployment` deployment with the image tagged `DRONE_COMMIT_SHA:0:8` +```yaml pipeline: deploy: image: quay.io/honestbee/drone-kubernetes deployment: my-deployment repo: myorg/myrepo container: my-container - tag: ${DRONE_COMMIT_SHA:0:8} + tag: + - mytag + - latest +``` Deploying containers across several deployments, eg in a scheduler-worker setup. Make sure your container `name` in your manifest is the same for each pod. +```yaml pipeline: deploy: image: quay.io/honestbee/drone-kubernetes deployment: [server-deploy, worker-deploy] repo: myorg/myrepo container: my-container - tag: ${DRONE_COMMIT_SHA:0:8} + tag: + - mytag + - latest +``` Deploying multiple containers within the same deployment. +```yaml pipeline: deploy: image: quay.io/honestbee/drone-kubernetes deployment: my-deployment repo: myorg/myrepo container: [container1, container2] - tag: ${DRONE_COMMIT_SHA:0:8} + tag: + - mytag + - latest +``` **NOTE**: Combining multi container deployments across multiple deployments is not recommended This more complex example demonstrates how to deploy to several environments based on the branch, in a `app` namespace +```yaml pipeline: deploy-staging: image: quay.io/honestbee/drone-kubernetes @@ -48,7 +61,9 @@ This more complex example demonstrates how to deploy to several environments bas repo: myorg/myrepo container: my-container namespace: app - tag: ${DRONE_COMMIT_SHA:0:8} + tag: + - mytag + - latest when: branch: [ staging ] @@ -61,12 +76,16 @@ This more complex example demonstrates how to deploy to several environments bas repo: myorg/myrepo container: my-container namespace: app - tag: ${DRONE_COMMIT_SHA:0:8} + tag: + - mytag + - latest when: branch: [ master ] +``` ## Required secrets +```bash drone secret add --image=honestbee/drone-kubernetes \ your-user/your-repo KUBERNETES_SERVER https://mykubernetesapiserver @@ -75,6 +94,7 @@ This more complex example demonstrates how to deploy to several environments bas drone secret add --image=honestbee/drone-kubernetes \ your-user/your-repo KUBERNETES_TOKEN eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJ... +``` When using TLS Verification, ensure Server Certificate used by kubernetes API server is signed for SERVER url ( could be a reason for failures if using aliases of kubernetes cluster )