Kubernetes Deployments

by mactynow

The Kubernetes plugin can be used to upgrade a Kubernetes deployment with a newer version of an image. This is equivalent to running the following kubectl command:

kubectl set image deployment/nginx-deployment nginx=nginx:1.9.1

Example pipeline configuration:

pipeline:
  deploy:
    image: quay.io/honestbee/drone-kubernetes
    kubernetes_server: https://kubernetes.company.org
    kubernetes_token: CXHVLJSDKJFS...
    namespace: app
    deployment: my-deployment
    repo: myorg/myrepo
    container: my-container
    tag: mytag

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.

pipeline:
  deploy:
    image: quay.io/honestbee/drone-kubernetes
-   deployment: my-deployment
+   deployment: [ server-deploy, worker-deploy ]
    repo: myorg/myrepo
    container: my-container
    tag: mytag

Deploying multiple containers within the same deployment.

pipeline:
  deploy:
    image: quay.io/honestbee/drone-kubernetes
    deployment: my-deployment
    repo: myorg/myrepo
-   container: my-container
+   container: [ my-container-1, my-container-2 ]
    tag: mytag

Parameter Reference

container
Container name (setup with the name option in the kubernetes manifest).
deployment
Deployment name.
kubernetes_server
Kubernetes API server URL.
kubernetes_token
Kubernetes service account token.
namespace
Kubernetes namespace.
repo
Image to update full name (with registry path).
tag
Image tag.

¿Hay algún error en esta página? Por favor, háganoslo saber o edite esta página.