From 5143de0d7209352eed12d2d0db77000f3a04c580 Mon Sep 17 00:00:00 2001 From: Ales Pour Date: Wed, 5 Jan 2022 11:33:52 +0100 Subject: [PATCH 1/8] test with v1.22+ kubernetes --- .github/workflows/helm-charts-test.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-charts-test.yaml b/.github/workflows/helm-charts-test.yaml index 0866a642..50b5e45d 100644 --- a/.github/workflows/helm-charts-test.yaml +++ b/.github/workflows/helm-charts-test.yaml @@ -5,6 +5,10 @@ on: pull_request jobs: lint-test: runs-on: ubuntu-latest + strategy: + matrix: + # node image versions for helm/kind-action@v1.2.0 => kubernetes-sigs/kind@0.11.1 (https://github.com/kubernetes-sigs/kind/releases/tag/v0.11.1) + node_image_version: [v1.21.1, v1.22.0] steps: - name: Checkout uses: actions/checkout@v2 @@ -38,12 +42,14 @@ jobs: - name: Create kind cluster uses: helm/kind-action@v1.2.0 + with: + node_image: kindest/node:${{ matrix.node_image_version }} if: steps.list-changed.outputs.changed == 'true' # Our Enterprise chart requires some resources created - name: Create Enterprise Test Resources run: | - kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.15.1/cert-manager.yaml + kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.5.4/cert-manager.yaml sleep 30 # wait for CertManager kubectl apply -f ./charts/influxdb-enterprise/example-resources.yaml kubectl create secret generic influxdb-license --from-literal=INFLUXDB_ENTERPRISE_LICENSE_KEY=${INFLUXDB_ENTERPRISE_LICENSE_KEY} @@ -53,7 +59,6 @@ jobs: - name: Run chart-testing (install) run: ct install --namespace=default - # When https://github.com/helm/chart-testing/issues/212 is fixed, this can be used to set the license key instead of using env from secret # run: ct install --namespace=default --helm-extra-args="--set license.key=${INFLUXDB_ENTERPRISE_LICENSE_KEY}" # env: From 2c42acb7fc3d4e3204f7dd1fb1397809237caddf Mon Sep 17 00:00:00 2001 From: Ales Pour Date: Fri, 17 Dec 2021 11:51:09 +0100 Subject: [PATCH 2/8] feat: use v1 APIs when available --- charts/chronograf/templates/ingress.yaml | 14 ++++++++++++++ charts/influxdb/templates/backup-cronjob.yaml | 4 ++++ .../templates/backup-retention-cronjob.yaml | 4 ++++ charts/influxdb2/templates/pdb.yaml | 6 +++++- charts/kapacitor/templates/role.yaml | 4 ++++ charts/kapacitor/templates/rolebinding.yaml | 4 ++++ charts/telegraf/templates/pdb.yaml | 4 ++++ 7 files changed, 39 insertions(+), 1 deletion(-) diff --git a/charts/chronograf/templates/ingress.yaml b/charts/chronograf/templates/ingress.yaml index 5888e971..460cc9eb 100644 --- a/charts/chronograf/templates/ingress.yaml +++ b/charts/chronograf/templates/ingress.yaml @@ -1,5 +1,9 @@ {{- if .Values.ingress.enabled -}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} +apiVersion: networking.k8s.io/v1 +{{- else }} apiVersion: networking.k8s.io/v1beta1 +{{- end }} kind: Ingress metadata: name: {{ template "chronograf.fullname" . }} @@ -25,7 +29,17 @@ spec: http: paths: - path: {{ .Values.ingress.path }} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} + pathType: Prefix +{{- end }} backend: +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} + service: + name: {{ include "chronograf.fullname" . }} + port: + number: 80 +{{- else }} serviceName: {{ template "chronograf.fullname" . }} servicePort: 80 +{{- end }} {{- end -}} diff --git a/charts/influxdb/templates/backup-cronjob.yaml b/charts/influxdb/templates/backup-cronjob.yaml index 90b32220..15fa24ba 100644 --- a/charts/influxdb/templates/backup-cronjob.yaml +++ b/charts/influxdb/templates/backup-cronjob.yaml @@ -1,5 +1,9 @@ {{- if .Values.backup.enabled }} +{{- if .Capabilities.APIVersions.Has "batch/v1" }} +apiVersion: batch/v1 +{{- else }} apiVersion: batch/v1beta1 +{{- end }} kind: CronJob metadata: name: {{ include "influxdb.fullname" . }}-backup diff --git a/charts/influxdb/templates/backup-retention-cronjob.yaml b/charts/influxdb/templates/backup-retention-cronjob.yaml index 388c62d3..d822818b 100644 --- a/charts/influxdb/templates/backup-retention-cronjob.yaml +++ b/charts/influxdb/templates/backup-retention-cronjob.yaml @@ -1,5 +1,9 @@ {{- if .Values.backupRetention.enabled }} +{{- if .Capabilities.APIVersions.Has "batch/v1" }} +apiVersion: batch/v1 +{{- else }} apiVersion: batch/v1beta1 +{{- end }} kind: CronJob metadata: name: {{ include "influxdb.fullname" . }}-backup-retention diff --git a/charts/influxdb2/templates/pdb.yaml b/charts/influxdb2/templates/pdb.yaml index 7208d2ea..32ff0dad 100644 --- a/charts/influxdb2/templates/pdb.yaml +++ b/charts/influxdb2/templates/pdb.yaml @@ -1,10 +1,14 @@ {{- if .Values.pdb.create }} +{{- if .Capabilities.APIVersions.Has "policy/v1" }} +apiVersion: policy/v1 +{{- else }} apiVersion: policy/v1beta1 +{{- end }} kind: PodDisruptionBudget metadata: name: {{ template "influxdb.fullname" . }} labels: - {{ include "influxdb.labels" . | nindent 4 }} + {{- include "influxdb.labels" . | nindent 4 }} spec: {{- if .Values.pdb.minAvailable }} minAvailable: {{ .Values.pdb.minAvailable }} diff --git a/charts/kapacitor/templates/role.yaml b/charts/kapacitor/templates/role.yaml index 85a32d3f..947dae5e 100644 --- a/charts/kapacitor/templates/role.yaml +++ b/charts/kapacitor/templates/role.yaml @@ -1,5 +1,9 @@ {{- if and .Values.rbac.create .Values.rbac.namespaced -}} +{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} +apiVersion: rbac.authorization.k8s.io/v1 +{{- else }} apiVersion: rbac.authorization.k8s.io/v1beta1 +{{- end }} kind: Role metadata: name: {{ template "kapacitor.fullname" . }} diff --git a/charts/kapacitor/templates/rolebinding.yaml b/charts/kapacitor/templates/rolebinding.yaml index 10d93cfb..ba6f7b7f 100644 --- a/charts/kapacitor/templates/rolebinding.yaml +++ b/charts/kapacitor/templates/rolebinding.yaml @@ -1,5 +1,9 @@ {{- if and .Values.rbac.create .Values.rbac.namespaced -}} +{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} +apiVersion: rbac.authorization.k8s.io/v1 +{{- else }} apiVersion: rbac.authorization.k8s.io/v1beta1 +{{- end }} kind: RoleBinding metadata: name: {{ template "kapacitor.fullname" . }} diff --git a/charts/telegraf/templates/pdb.yaml b/charts/telegraf/templates/pdb.yaml index f56f0133..8736293f 100644 --- a/charts/telegraf/templates/pdb.yaml +++ b/charts/telegraf/templates/pdb.yaml @@ -1,5 +1,9 @@ {{- if .Values.pdb.create }} +{{- if .Capabilities.APIVersions.Has "policy/v1" }} +apiVersion: policy/v1 +{{- else }} apiVersion: policy/v1beta1 +{{- end }} kind: PodDisruptionBudget metadata: name: {{ include "telegraf.fullname" . }} From 34a455fa495fbc7399730f6017eec9cccd1a4780 Mon Sep 17 00:00:00 2001 From: Ales Pour Date: Thu, 20 Jan 2022 19:10:31 +0100 Subject: [PATCH 3/8] customize job name --- .github/workflows/helm-charts-test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/helm-charts-test.yaml b/.github/workflows/helm-charts-test.yaml index 50b5e45d..04d2a054 100644 --- a/.github/workflows/helm-charts-test.yaml +++ b/.github/workflows/helm-charts-test.yaml @@ -9,6 +9,7 @@ jobs: matrix: # node image versions for helm/kind-action@v1.2.0 => kubernetes-sigs/kind@0.11.1 (https://github.com/kubernetes-sigs/kind/releases/tag/v0.11.1) node_image_version: [v1.21.1, v1.22.0] + name: lint-test (k8s ${{ matrix.node_image_version }}) steps: - name: Checkout uses: actions/checkout@v2 From 8813c281c076259c6badc0ee94bcf8570bda0316 Mon Sep 17 00:00:00 2001 From: Ales Pour Date: Thu, 20 Jan 2022 19:10:36 +0100 Subject: [PATCH 4/8] bump version --- charts/chronograf/Chart.yaml | 2 +- charts/influxdb2/Chart.yaml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/charts/chronograf/Chart.yaml b/charts/chronograf/Chart.yaml index 8769d4b6..e7ebde1a 100755 --- a/charts/chronograf/Chart.yaml +++ b/charts/chronograf/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: chronograf -version: 1.2.1 +version: 1.2.2 appVersion: 1.9.1 description: Open-source web application written in Go and React.js that provides the tools to visualize your monitoring data and easily create alerting and automation diff --git a/charts/influxdb2/Chart.yaml b/charts/influxdb2/Chart.yaml index b7a9692f..16d7255d 100644 --- a/charts/influxdb2/Chart.yaml +++ b/charts/influxdb2/Chart.yaml @@ -1,11 +1,10 @@ apiVersion: v2 appVersion: 2.1.1 - name: influxdb2 description: A Helm chart for InfluxDB v2 home: https://www.influxdata.com/products/influxdb/ type: application -version: 2.0.8 +version: 2.0.9 maintainers: - name: rawkode email: rawkode@influxdata.com From 8577007ff370f7d20cebad39bcd70ee92a29e604 Mon Sep 17 00:00:00 2001 From: Ales Pour Date: Thu, 20 Jan 2022 19:22:27 +0100 Subject: [PATCH 5/8] use more readable matrix style --- .github/workflows/helm-charts-test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/helm-charts-test.yaml b/.github/workflows/helm-charts-test.yaml index 04d2a054..2c672f96 100644 --- a/.github/workflows/helm-charts-test.yaml +++ b/.github/workflows/helm-charts-test.yaml @@ -8,7 +8,9 @@ jobs: strategy: matrix: # node image versions for helm/kind-action@v1.2.0 => kubernetes-sigs/kind@0.11.1 (https://github.com/kubernetes-sigs/kind/releases/tag/v0.11.1) - node_image_version: [v1.21.1, v1.22.0] + node_image_version: + - v1.21.1 # default used by helm/kind-action@v1.2.0 => kubernetes-sigs/kind@0.11.1 + - v1.22.0 name: lint-test (k8s ${{ matrix.node_image_version }}) steps: - name: Checkout From 913b4e1bfa80abb23926f75d926e8149d8d6d0e0 Mon Sep 17 00:00:00 2001 From: Ales Pour Date: Fri, 21 Jan 2022 11:49:20 +0100 Subject: [PATCH 6/8] use latest v1.22 image --- .github/workflows/helm-charts-test.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/helm-charts-test.yaml b/.github/workflows/helm-charts-test.yaml index 2c672f96..dc6e99f5 100644 --- a/.github/workflows/helm-charts-test.yaml +++ b/.github/workflows/helm-charts-test.yaml @@ -7,10 +7,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - # node image versions for helm/kind-action@v1.2.0 => kubernetes-sigs/kind@0.11.1 (https://github.com/kubernetes-sigs/kind/releases/tag/v0.11.1) node_image_version: - - v1.21.1 # default used by helm/kind-action@v1.2.0 => kubernetes-sigs/kind@0.11.1 - - v1.22.0 + - v1.21.1 # default used by helm/kind-action@v1.2.0 (kubernetes-sigs/kind@0.11.1) + - v1.22.4 name: lint-test (k8s ${{ matrix.node_image_version }}) steps: - name: Checkout From bbc255a3e9fec4e71ba3ed044af519282f08f6a7 Mon Sep 17 00:00:00 2001 From: Ales Pour Date: Thu, 3 Feb 2022 13:57:33 +0100 Subject: [PATCH 7/8] bump versions --- charts/kapacitor/Chart.yaml | 2 +- charts/telegraf/Chart.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/kapacitor/Chart.yaml b/charts/kapacitor/Chart.yaml index dc672107..f2b8843e 100755 --- a/charts/kapacitor/Chart.yaml +++ b/charts/kapacitor/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: kapacitor -version: 1.4.2 +version: 1.4.3 appVersion: 1.6.3 description: InfluxDB's native data processing engine. It can process both stream and batch data from InfluxDB. diff --git a/charts/telegraf/Chart.yaml b/charts/telegraf/Chart.yaml index 0038fa9d..f2be9e0f 100755 --- a/charts/telegraf/Chart.yaml +++ b/charts/telegraf/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: telegraf -version: 1.8.13 -appVersion: 1.21.2 +version: 1.8.14 +appVersion: 1.21.3 deprecated: false description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics. keywords: From 3592fc18e098a78ddef33096a0634660fc1017c6 Mon Sep 17 00:00:00 2001 From: Ales Pour Date: Thu, 3 Feb 2022 13:59:49 +0100 Subject: [PATCH 8/8] bump version --- charts/influxdb/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/influxdb/Chart.yaml b/charts/influxdb/Chart.yaml index 2a5ad727..26ff1ed8 100755 --- a/charts/influxdb/Chart.yaml +++ b/charts/influxdb/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: influxdb -version: 4.10.5 +version: 4.10.6 appVersion: 1.8.10 description: Scalable datastore for metrics, events, and real-time analytics. keywords: