Deploy to Kubernetes Helm from Concourse using aws authenticator to support EKS clusters
Forked and inspired by from linkyard/concourse-helm-resource.
Modified to support AWS authentication informing an account ( id and secret ) that has access to EKS cluster
Add the resource type to your pipeline:
resource_types:
- name: helm
source:
repository: konkerlabs/concourse-eks-helm3-resource
tag: latest
type: docker-image
resources:
- name: helm-eks-release
source:
aws_eks_cluster_name: EKS_NAME
aws_region: EKS REGION
aws_access_key_id: YOUR_AWS_ACCESS_KEY_ID
aws_secret_access_key: YOUR_AWS_SECRET_ACCESS_KEY
namespace: NAMESPACE_TO_DEPLOY
release: HELM_RELEASE_NAME
release
: Name of the release (not a file, a string). (Default: autogenerated by helm)namespace
: Kubernetes namespace the chart will be installed into. (Default: default)repos
: Optional. Array of Helm repositories to initialize, each repository is defined as an object with propertiesname
,url
(required) username and password (optional).
aws_region
: the eks cluster regionaws_eks_cluster_name
: the AWS EKS cluster nameaws_access_key_id
: the AWS access key id ( this account require access to your eks cluster )aws_secret_access_key
: the AWS secret access key ( this account require access to your eks cluster )
Any new revisions to the release are returned, no matter their current state. The release must be specified in the
source for check
to work.
Deploys a Helm chart onto the Kubernetes cluster. Tiller must be already installed on the cluster.
chart
: Required. Either the file containing the helm chart to deploy (ends with .tgz) or the name of the chart (e.g.stable/mysql
).namespace
: Optional. Either a file containing the name of the namespace or the name of the namespace. (Default: taken from source configuration).release
: Optional. Either a file containing the name of the release or the name of the release. (Default: taken from source configuration).values
: Optional. File containing the values.yaml for the deployment. Supports setting multiple value files using an array.override_values
: Optional. Array of values that can override those defined in values.yaml. Each entry in the array is a map containing a key and a value or path. Value is set directly while path reads the contents of the file in that path. Ahide: true
parameter ensures that the value is not logged and instead replaced with***HIDDEN***
. Atype: string
parameter makes sure Helm always treats the value as a string (uses the--set-string
option to Helm; useful if the value varies and may look like a number, eg. if it's a Git commit hash).cluster_url
is https.version
: Optional Chart version to deploy, can be a file or a value. Only applies ifchart
is not a file.delete
: Optional. Deletes the release instead of installing it. Requires thename
. (Default: false)test
: Optional. Test the release instead of installing it. Requires therelease
. (Default: false)purge
: Optional. Purge the release on delete. (Default: false)replace
: Optional. Replace deleted release with same name. (Default: false)force
: Optional. Force resource update through delete/recreate if needed. (Default: false)devel
: Optional. Allow development versions of chart to be installed. This is useful when wanting to install pre-release charts (i.e. 1.0.2-rc1) without having to specify a version. (Default: false)debug
: Optional. Dry run the helm install with the debug flag which logs interpolated chart templates. (Default: false)wait_until_ready
: Optional. Set to the number of seconds it should wait until all the resources in the chart are ready. (Default:0
which means don't wait).recreate_pods
: Optional. This flag will cause all pods to be recreated when upgrading. (Default: false)show_diff
: Optional. Show the diff that is applied if upgrading an existing successful release. Will not be used whendevel
is set. (Default: false)exit_after_diff
: Optional. Show the diff but don't actually install/upgrade. (Default: false)reuse_values
: Optional. When upgrading, reuse the last release's values. (Default: false)
Define type
resource_types:
- name: helm
source:
repository: konkerlabs/concourse-eks-helm3-resource
tag: latest
type: docker-image
Define the resource:
resources:
- name: helm-eks-release
source:
aws_eks_cluster_name: EKS_NAME
aws_region: EKS REGION
aws_access_key_id: YOUR_AWS_ACCESS_KEY_ID
aws_secret_access_key: YOUR_AWS_SECRET_ACCESS_KEY
namespace: NAMESPACE_TO_DEPLOY
release: HELM_RELEASE_NAME
Add to job:
jobs:
plan:
- name: deploy-helm3-to-eks
build_logs_to_retain: 10
- get: your-git-resource
- get: your-docker-registry-resource
passed:
- your-build-steps
trigger: true
- put: helm-eks-release
params:
chart: your-git-resource/your-helm-templates-folder
namespace: NAMESPACE_TO_DEPLOY # can be informed in the resource type via source or there via params
release: HELM_RELEASE_NAME # can be informed in the resource type via source or there via params
override_values:
- key: replicas
value: 1
- key: image.tag
value: YOUR_IMAGE_TAG
values: your-git-resource/your-helm-templates-folder/values.yaml