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`
```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 )