/concourse-k8s-deploy-pipeline

Concourse pipeline to deploy the latest container image to a Kubernetes cluster

Apache License 2.0Apache-2.0

Deploying apps to Kubernetes using Concourse

This project defines a simple Concourse pipeline which is responsible for monitoring images in a container registry (such as Docker Hub or Harbor): new container images are automatically deployed to your Kubernetes cluster.

How to use it?

Create a pipeline configuration file from vars.template.yml:

kubernetes-config: |
  >--- PASTE YOUR .kube/config HERE ---<

# Set the container image you want to monitor and deploy to your cluster.
container-image: alexandreroman/cnb-springboot

# Set target Kubernetes deployment.
kubernetes-namespace: cnb-springboot
kubernetes-deployment: app
kubernetes-container: app

# Select a context from the Kubernetes config. Leave empty to use default context.
kubernetes-context:

# Match this attribute with your cluster version.
kubernetes-version: 1.15

# Set to true to disable TLS verification when using kubectl commands.
kubernetes-skip-tls-verification: false

# Set how long to wait for pods to run (seconds), 0 means "don't wait".
kubernetes-wait-until-ready: 120

Use fly CLI to create a Concourse pipeline instance:

$ fly -t myconcourse set-pipeline -p deploy-myapp -c pipeline.yml -l myapp.yml

You're done!

At this point, when a new container image appears in the container registry, a Kubernetes Deployment object will be patched: the new container image will be used. If you previously configured your Deployment instance with a readiness probe, Kubernetes will rollout the new version with no app downtime.

Contribute

Contributions are always welcome!

Feel free to open issues & send PR.

License

Copyright © 2020 VMware, Inc.

This project is licensed under the Apache Software License version 2.0.