Update readme

This commit is contained in:
Charles Martinot 2017-06-28 11:55:53 +08:00
parent 003876378d
commit 36904ab9b6
1 changed files with 25 additions and 5 deletions

View File

@ -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` This pipeline will update the `my-deployment` deployment with the image tagged `DRONE_COMMIT_SHA:0:8`
```yaml
pipeline: pipeline:
deploy: deploy:
image: quay.io/honestbee/drone-kubernetes image: quay.io/honestbee/drone-kubernetes
deployment: my-deployment deployment: my-deployment
repo: myorg/myrepo repo: myorg/myrepo
container: my-container 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. 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: pipeline:
deploy: deploy:
image: quay.io/honestbee/drone-kubernetes image: quay.io/honestbee/drone-kubernetes
deployment: [server-deploy, worker-deploy] deployment: [server-deploy, worker-deploy]
repo: myorg/myrepo repo: myorg/myrepo
container: my-container container: my-container
tag: ${DRONE_COMMIT_SHA:0:8} tag:
- mytag
- latest
```
Deploying multiple containers within the same deployment. Deploying multiple containers within the same deployment.
```yaml
pipeline: pipeline:
deploy: deploy:
image: quay.io/honestbee/drone-kubernetes image: quay.io/honestbee/drone-kubernetes
deployment: my-deployment deployment: my-deployment
repo: myorg/myrepo repo: myorg/myrepo
container: [container1, container2] container: [container1, container2]
tag: ${DRONE_COMMIT_SHA:0:8} tag:
- mytag
- latest
```
**NOTE**: Combining multi container deployments across multiple deployments is not recommended **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 This more complex example demonstrates how to deploy to several environments based on the branch, in a `app` namespace
```yaml
pipeline: pipeline:
deploy-staging: deploy-staging:
image: quay.io/honestbee/drone-kubernetes 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 repo: myorg/myrepo
container: my-container container: my-container
namespace: app namespace: app
tag: ${DRONE_COMMIT_SHA:0:8} tag:
- mytag
- latest
when: when:
branch: [ staging ] branch: [ staging ]
@ -61,12 +76,16 @@ This more complex example demonstrates how to deploy to several environments bas
repo: myorg/myrepo repo: myorg/myrepo
container: my-container container: my-container
namespace: app namespace: app
tag: ${DRONE_COMMIT_SHA:0:8} tag:
- mytag
- latest
when: when:
branch: [ master ] branch: [ master ]
```
## Required secrets ## Required secrets
```bash
drone secret add --image=honestbee/drone-kubernetes \ drone secret add --image=honestbee/drone-kubernetes \
your-user/your-repo KUBERNETES_SERVER https://mykubernetesapiserver 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 \ drone secret add --image=honestbee/drone-kubernetes \
your-user/your-repo KUBERNETES_TOKEN eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJ... your-user/your-repo KUBERNETES_TOKEN eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJ...
```
When using TLS Verification, ensure Server Certificate used by kubernetes API server 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 ) is signed for SERVER url ( could be a reason for failures if using aliases of kubernetes cluster )