Standardised tooling for Helm Charts
(This issue should probably reside elsewhere: please suggest a better repository and I'm happy to move it)
Background
Multiple teams across the organization are currently putting together helm charts.
In some cases, Runway can be helpful in generating a Helm Chart in a standardized manner. However, not all components will be defined in Runway, making this approach only a partial solution.
This leads to situations where development teams are putting together their own, but may not necessarily have the expertise to define charts according to GitLab's internal policies and standards.
Proposal
Define a set of documentation, project templates, CI templates and processes for assisting teams developing their own Helm Charts to "do the right thing".
Details
-
A Copier Project Template for a Helm Chart could be developed, or the existing Copier Template in https://gitlab.com/gitlab-com/gl-infra/common-template-copier might be reused.
-
common-ci-tasksmight be a good place to add a new standard CI template, the following definition could be included in.gitlab-ci.ymlto declare the project as a Helm project:include: - project: "gitlab-com/gl-infra/common-ci-tasks" ref: v2.75.0 # renovate:managed file: templates/helm.yml -
This would infer the following behaviours: semantic-release for releases, publishing of the Helm Chart to the Generic Artifact Registry, Renovate updates to reference updated application versions, Checkov for validation plus all the
standard.ymlfeatures such a YAML Lint, EditorConfig, etc etc. -
Over time, additional tooling and validation could be included in the Helm Template, for instance testing (via local render) and validation of policies (for instance for ensuring GitLab policies around labelling, resource allocation, etc).
Standard Packaged CI Components
The helm build CI Component could include standard ways of running the following tools:
-
helm lintdone in common-ci-tasks!1047 (merged) -
Checkov done in common-ci-tasks!1047 (merged) -
kubeconformhttps://github.com/yannh/kubeconform and/orkubectl-validatehttps://github.com/kubernetes-sigs/kubectl-validate ? ensure that the Helm Chart generates manifests that conform to all versions of Kubernetes that GitLab supports -
helm unittesthttps://github.com/helm-unittest/helm-unittest Encourage testing for helm charts -
helm publish: publish the helm chart to the local generic package registry on tag builds