From 76c0cd751652f2ac2147a892d3ca90c689ce8b52 Mon Sep 17 00:00:00 2001 From: "grzegorz.dziwoki" Date: Thu, 20 Jan 2022 12:41:05 +0100 Subject: [PATCH 1/3] feat: Add helm chart release gh action --- .github/workflows/release-chart.yaml | 30 +++++++ {chart => charts/nodetaint}/.helmignore | 0 {chart => charts/nodetaint}/Chart.yaml | 0 charts/nodetaint/README.md | 78 +++++++++++++++++++ .../nodetaint}/templates/_helpers.tpl | 0 .../nodetaint}/templates/clusterrole.yaml | 0 .../templates/clusterrolebinding.yaml | 0 .../nodetaint}/templates/deployment.yaml | 0 .../templates/poddisruptionbudget.yaml | 0 .../nodetaint}/templates/service.yaml | 0 .../nodetaint}/templates/serviceaccount.yaml | 0 {chart => charts/nodetaint}/values.yaml | 0 ci/README.md.gotmpl | 58 ++++++++++++++ 13 files changed, 166 insertions(+) create mode 100644 .github/workflows/release-chart.yaml rename {chart => charts/nodetaint}/.helmignore (100%) rename {chart => charts/nodetaint}/Chart.yaml (100%) create mode 100644 charts/nodetaint/README.md rename {chart => charts/nodetaint}/templates/_helpers.tpl (100%) rename {chart => charts/nodetaint}/templates/clusterrole.yaml (100%) rename {chart => charts/nodetaint}/templates/clusterrolebinding.yaml (100%) rename {chart => charts/nodetaint}/templates/deployment.yaml (100%) rename {chart => charts/nodetaint}/templates/poddisruptionbudget.yaml (100%) rename {chart => charts/nodetaint}/templates/service.yaml (100%) rename {chart => charts/nodetaint}/templates/serviceaccount.yaml (100%) rename {chart => charts/nodetaint}/values.yaml (100%) create mode 100644 ci/README.md.gotmpl diff --git a/.github/workflows/release-chart.yaml b/.github/workflows/release-chart.yaml new file mode 100644 index 0000000..c65180b --- /dev/null +++ b/.github/workflows/release-chart.yaml @@ -0,0 +1,30 @@ +name: Release Charts + +on: + push: + branches: + - master + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v1 + with: + version: v3.4.0 + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.2.1 + env: + CR_TOKEN: "${{ secrets.GH_TOKEN }}" diff --git a/chart/.helmignore b/charts/nodetaint/.helmignore similarity index 100% rename from chart/.helmignore rename to charts/nodetaint/.helmignore diff --git a/chart/Chart.yaml b/charts/nodetaint/Chart.yaml similarity index 100% rename from chart/Chart.yaml rename to charts/nodetaint/Chart.yaml diff --git a/charts/nodetaint/README.md b/charts/nodetaint/README.md new file mode 100644 index 0000000..3ce2214 --- /dev/null +++ b/charts/nodetaint/README.md @@ -0,0 +1,78 @@ +# nodetaint + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.0.3](https://img.shields.io/badge/AppVersion-v0.0.3-informational?style=flat-square) + +A Helm chart for nodetaint controller + +## How to install this chart + + +Add wish.github.io/nodetaint chart repo: + +```console +helm repo add nodetaint https://wish.github.io/nodetaint +``` + +A simple install with default values: + +```console +helm install nodetaint/nodetaint +``` + +To install the chart with the release name `my-release`: + +```console +helm install my-release nodetaint/nodetaint +``` + +To install with some set values: + +```console +helm install my-release nodetaint/nodetaint --set values_key1=value1 --set values_key2=value2 +``` + +To install with custom values file: + +```console +helm install my-release nodetaint/nodetaint -f values.yaml +``` + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| config.DAEMONSET_ANNOTATION | string | `"nodetaint/crucial"` | | +| config.LOG_LEVEL | string | `"info"` | | +| config.NODE_TAINT | string | `"nodetaint/blocking"` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.registry | string | `"quay.io/"` | | +| image.repository | string | `"wish/nodetaint"` | | +| image.tag | string | `"v0.0.3"` | | +| imagePullSecrets | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| podDisruptionBudget.maxUnavailable | int | `1` | | +| podSecurityContext | object | `{}` | | +| rbac.create | bool | `true` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.port | int | `80` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | +| tolerations | list | `[]` | | + +## How to build and release this chart + +Chart is built and released on each merge to `main` branch. + +Release version is stored in `Chart.yaml` and should be bumped with each release + +Before pushing your commits, make sure to regenerate docs with: +```console +docker run --rm --volume "$(pwd):/helm-docs" -u $(id -u) jnorwood/helm-docs:latest --template-files=ci/README.md.gotmpl +``` diff --git a/chart/templates/_helpers.tpl b/charts/nodetaint/templates/_helpers.tpl similarity index 100% rename from chart/templates/_helpers.tpl rename to charts/nodetaint/templates/_helpers.tpl diff --git a/chart/templates/clusterrole.yaml b/charts/nodetaint/templates/clusterrole.yaml similarity index 100% rename from chart/templates/clusterrole.yaml rename to charts/nodetaint/templates/clusterrole.yaml diff --git a/chart/templates/clusterrolebinding.yaml b/charts/nodetaint/templates/clusterrolebinding.yaml similarity index 100% rename from chart/templates/clusterrolebinding.yaml rename to charts/nodetaint/templates/clusterrolebinding.yaml diff --git a/chart/templates/deployment.yaml b/charts/nodetaint/templates/deployment.yaml similarity index 100% rename from chart/templates/deployment.yaml rename to charts/nodetaint/templates/deployment.yaml diff --git a/chart/templates/poddisruptionbudget.yaml b/charts/nodetaint/templates/poddisruptionbudget.yaml similarity index 100% rename from chart/templates/poddisruptionbudget.yaml rename to charts/nodetaint/templates/poddisruptionbudget.yaml diff --git a/chart/templates/service.yaml b/charts/nodetaint/templates/service.yaml similarity index 100% rename from chart/templates/service.yaml rename to charts/nodetaint/templates/service.yaml diff --git a/chart/templates/serviceaccount.yaml b/charts/nodetaint/templates/serviceaccount.yaml similarity index 100% rename from chart/templates/serviceaccount.yaml rename to charts/nodetaint/templates/serviceaccount.yaml diff --git a/chart/values.yaml b/charts/nodetaint/values.yaml similarity index 100% rename from chart/values.yaml rename to charts/nodetaint/values.yaml diff --git a/ci/README.md.gotmpl b/ci/README.md.gotmpl new file mode 100644 index 0000000..23cd348 --- /dev/null +++ b/ci/README.md.gotmpl @@ -0,0 +1,58 @@ +{{ template "chart.header" . }} + +{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} + +{{ template "chart.description" . }} + +## How to install this chart + +Chart can be verified using the following commands: +```console +curl https://helm.kube.jamf.build/helmsigner.gpg -o helmsigner.gpg +helm pull helm-kube/{{ template "chart.name" . }} --verify --keyring helmsigner.gpg +``` + +Add helm.kube.jamf.build chart repo: + +```console +helm repo add helm-kube https://helm.kube.jamf.build/ +``` + +A simple install with default values: + +```console +helm install helm-kube/{{ template "chart.name" . }} +``` + +To install the chart with the release name `my-release`: + +```console +helm install my-release helm-kube/{{ template "chart.name" . }} +``` + +To install with some set values: + +```console +helm install my-release helm-kube/{{ template "chart.name" . }} --set values_key1=value1 --set values_key2=value2 +``` + +To install with custom values file: + +```console +helm install my-release helm-kube/{{ template "chart.name" . }} -f values.yaml +``` + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} + +## How to build and release this chart + +Chart is built and released on each merge to `main` branch. + +Release version is stored in `Chart.yaml` and should be bumped with each release + +Before pushing your commits, make sure to regenerate docs with: +```console +docker run --rm --volume "$(pwd):/helm-docs" -u $(id -u) jnorwood/helm-docs:latest --template-files=ci/README.md.gotmpl +``` From 90fed20b5f6a30e464a27688b07ec7c69b5b971a Mon Sep 17 00:00:00 2001 From: Grzegorz Dziwoki Date: Tue, 10 Oct 2023 12:47:09 +0200 Subject: [PATCH 2/3] Bump PDB to latest apiVersion --- charts/nodetaint/Chart.yaml | 2 +- charts/nodetaint/README.md | 19 ++++++++++++------- .../templates/poddisruptionbudget.yaml | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/charts/nodetaint/Chart.yaml b/charts/nodetaint/Chart.yaml index d446be4..0e26cf0 100644 --- a/charts/nodetaint/Chart.yaml +++ b/charts/nodetaint/Chart.yaml @@ -3,6 +3,6 @@ name: nodetaint description: A Helm chart for nodetaint controller type: application -version: 0.1.0 +version: 0.2.0 appVersion: "v0.0.3" diff --git a/charts/nodetaint/README.md b/charts/nodetaint/README.md index 3ce2214..3a964ae 100644 --- a/charts/nodetaint/README.md +++ b/charts/nodetaint/README.md @@ -1,40 +1,45 @@ # nodetaint -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.0.3](https://img.shields.io/badge/AppVersion-v0.0.3-informational?style=flat-square) +![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.0.3](https://img.shields.io/badge/AppVersion-v0.0.3-informational?style=flat-square) A Helm chart for nodetaint controller ## How to install this chart +Chart can be verified using the following commands: +```console +curl https://helm.kube.jamf.build/helmsigner.gpg -o helmsigner.gpg +helm pull helm-kube/nodetaint --verify --keyring helmsigner.gpg +``` -Add wish.github.io/nodetaint chart repo: +Add helm.kube.jamf.build chart repo: ```console -helm repo add nodetaint https://wish.github.io/nodetaint +helm repo add helm-kube https://helm.kube.jamf.build/ ``` A simple install with default values: ```console -helm install nodetaint/nodetaint +helm install helm-kube/nodetaint ``` To install the chart with the release name `my-release`: ```console -helm install my-release nodetaint/nodetaint +helm install my-release helm-kube/nodetaint ``` To install with some set values: ```console -helm install my-release nodetaint/nodetaint --set values_key1=value1 --set values_key2=value2 +helm install my-release helm-kube/nodetaint --set values_key1=value1 --set values_key2=value2 ``` To install with custom values file: ```console -helm install my-release nodetaint/nodetaint -f values.yaml +helm install my-release helm-kube/nodetaint -f values.yaml ``` ## Values diff --git a/charts/nodetaint/templates/poddisruptionbudget.yaml b/charts/nodetaint/templates/poddisruptionbudget.yaml index dc3ad48..ed52ccf 100644 --- a/charts/nodetaint/templates/poddisruptionbudget.yaml +++ b/charts/nodetaint/templates/poddisruptionbudget.yaml @@ -1,5 +1,5 @@ {{- if .Values.podDisruptionBudget }} -apiVersion: policy/v1beta1 +apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: {{ include "nodetaint.fullname" . }} From ba7399f636cba6c65e698983ae52d338a0f9f3ba Mon Sep 17 00:00:00 2001 From: Grzegorz Dziwoki Date: Tue, 10 Oct 2023 12:55:37 +0200 Subject: [PATCH 3/3] Fix release chart --- .github/workflows/release-chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-chart.yaml b/.github/workflows/release-chart.yaml index c65180b..3c968fe 100644 --- a/.github/workflows/release-chart.yaml +++ b/.github/workflows/release-chart.yaml @@ -20,11 +20,11 @@ jobs: git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - name: Install Helm - uses: azure/setup-helm@v1 + uses: azure/setup-helm@v3 with: version: v3.4.0 - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.2.1 + uses: helm/chart-releaser-action@v1.5.0 env: CR_TOKEN: "${{ secrets.GH_TOKEN }}"