GitHub Action
Kustomized Helm Action
This GitHub Action generates manifests for Helm charts and then combines them in kustomize overlays.
This action is insanely opinionated about how I run my repository. It may not support your use case, but please feel free to fork and modify it to suit your needs.
This action expects a folder structure of ./<source_folder>/<app_name>/overlays/<cluster_identifier>
where <source_folder>
is the input provided to the action.
-
<source_folder>
can be thought of environment names likedev
,staging
, andproduction
. Or as other clear seperations of concerns. The action will generate manifests for each environment and commit them to the destination branch. -
<app_name>
is the name of the application. This is used byargocd
to identify the application when used with anapplicationset
. -
<cluster_identifier>
is the name of the cluster. This is used byargocd
to identify the cluster when used with anapplicationset
.
dev
myapp
base
Chart.yaml
kustomization.yaml
values.yaml
overlays
cluster1`
kustomization.yaml
my-patch.yaml
values.yaml
cluster2`
kustomization.yaml
values.yaml
staging
myapp
base
Chart.yaml
kustomization.yaml
values.yaml
overlays
cluster1
kustomization.yaml
values.yaml
cluster2
kustomization.yaml
values.yaml
The folder containing the Helm charts and kustomize overlays. This input is required. The default value is dev
.
The branch to commit the changes to. This input is not required. The default value is the current branch of the head commit.
The version of Helm to use. This input is not required. The default value is v3.14.4
.
- uses: jamesatintegratnio/Kustomized-Helm-Action@main
with:
source_folder: 'your-folder'
destination_branch: 'your-branch'
helm_version: 'your-helm-version'
-
Configures git user name and email to
github-actions[bot]
andgithub-actions[bot]@users.noreply.github.com
respectively. -
Sets up Helm using the
azure/[email protected]
action with the version specified in thehelm_version
input. -
Gets directories for processing. It finds directories that match the pattern
./<source_folder>/*/overlays/*
and stores them in thedirs
environment variable. -
Adds Helm repositories dynamically (details not provided in the excerpt).
James D.