Unverified Commit caca98b4 authored by alespour's avatar alespour Committed by GitHub

Support Kubernetes 1.22+ (#405)

* test with v1.22+ kubernetes * feat: use v1 APIs when available * customize job name * bump version * use more readable matrix style * use latest v1.22 image * bump versions * bump version
parent 6fbbae85
...@@ -5,6 +5,12 @@ on: pull_request ...@@ -5,6 +5,12 @@ on: pull_request
jobs: jobs:
lint-test: lint-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
node_image_version:
- 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: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
...@@ -38,12 +44,14 @@ jobs: ...@@ -38,12 +44,14 @@ jobs:
- name: Create kind cluster - name: Create kind cluster
uses: helm/kind-action@v1.2.0 uses: helm/kind-action@v1.2.0
with:
node_image: kindest/node:${{ matrix.node_image_version }}
if: steps.list-changed.outputs.changed == 'true' if: steps.list-changed.outputs.changed == 'true'
# Our Enterprise chart requires some resources created # Our Enterprise chart requires some resources created
- name: Create Enterprise Test Resources - name: Create Enterprise Test Resources
run: | 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 sleep 30 # wait for CertManager
kubectl apply -f ./charts/influxdb-enterprise/example-resources.yaml 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} kubectl create secret generic influxdb-license --from-literal=INFLUXDB_ENTERPRISE_LICENSE_KEY=${INFLUXDB_ENTERPRISE_LICENSE_KEY}
...@@ -53,7 +61,6 @@ jobs: ...@@ -53,7 +61,6 @@ jobs:
- name: Run chart-testing (install) - name: Run chart-testing (install)
run: ct install --namespace=default 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 # 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}" # run: ct install --namespace=default --helm-extra-args="--set license.key=${INFLUXDB_ENTERPRISE_LICENSE_KEY}"
# env: # env:
......
apiVersion: v1 apiVersion: v1
name: chronograf name: chronograf
version: 1.2.1 version: 1.2.2
appVersion: 1.9.1 appVersion: 1.9.1
description: Open-source web application written in Go and React.js that provides 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 the tools to visualize your monitoring data and easily create alerting and automation
......
{{- if .Values.ingress.enabled -}} {{- if .Values.ingress.enabled -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
apiVersion: networking.k8s.io/v1
{{- else }}
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1beta1
{{- end }}
kind: Ingress kind: Ingress
metadata: metadata:
name: {{ template "chronograf.fullname" . }} name: {{ template "chronograf.fullname" . }}
...@@ -25,7 +29,17 @@ spec: ...@@ -25,7 +29,17 @@ spec:
http: http:
paths: paths:
- path: {{ .Values.ingress.path }} - path: {{ .Values.ingress.path }}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
pathType: Prefix
{{- end }}
backend: backend:
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
service:
name: {{ include "chronograf.fullname" . }}
port:
number: 80
{{- else }}
serviceName: {{ template "chronograf.fullname" . }} serviceName: {{ template "chronograf.fullname" . }}
servicePort: 80 servicePort: 80
{{- end }}
{{- end -}} {{- end -}}
apiVersion: v1 apiVersion: v1
name: influxdb name: influxdb
version: 4.10.5 version: 4.10.6
appVersion: 1.8.10 appVersion: 1.8.10
description: Scalable datastore for metrics, events, and real-time analytics. description: Scalable datastore for metrics, events, and real-time analytics.
keywords: keywords:
......
{{- if .Values.backup.enabled }} {{- if .Values.backup.enabled }}
{{- if .Capabilities.APIVersions.Has "batch/v1" }}
apiVersion: batch/v1
{{- else }}
apiVersion: batch/v1beta1 apiVersion: batch/v1beta1
{{- end }}
kind: CronJob kind: CronJob
metadata: metadata:
name: {{ include "influxdb.fullname" . }}-backup name: {{ include "influxdb.fullname" . }}-backup
......
{{- if .Values.backupRetention.enabled }} {{- if .Values.backupRetention.enabled }}
{{- if .Capabilities.APIVersions.Has "batch/v1" }}
apiVersion: batch/v1
{{- else }}
apiVersion: batch/v1beta1 apiVersion: batch/v1beta1
{{- end }}
kind: CronJob kind: CronJob
metadata: metadata:
name: {{ include "influxdb.fullname" . }}-backup-retention name: {{ include "influxdb.fullname" . }}-backup-retention
......
apiVersion: v2 apiVersion: v2
appVersion: 2.1.1 appVersion: 2.1.1
name: influxdb2 name: influxdb2
description: A Helm chart for InfluxDB v2 description: A Helm chart for InfluxDB v2
home: https://www.influxdata.com/products/influxdb/ home: https://www.influxdata.com/products/influxdb/
type: application type: application
version: 2.0.8 version: 2.0.9
maintainers: maintainers:
- name: rawkode - name: rawkode
email: rawkode@influxdata.com email: rawkode@influxdata.com
......
{{- if .Values.pdb.create }} {{- if .Values.pdb.create }}
{{- if .Capabilities.APIVersions.Has "policy/v1" }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1 apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget kind: PodDisruptionBudget
metadata: metadata:
name: {{ template "influxdb.fullname" . }} name: {{ template "influxdb.fullname" . }}
labels: labels:
{{ include "influxdb.labels" . | nindent 4 }} {{- include "influxdb.labels" . | nindent 4 }}
spec: spec:
{{- if .Values.pdb.minAvailable }} {{- if .Values.pdb.minAvailable }}
minAvailable: {{ .Values.pdb.minAvailable }} minAvailable: {{ .Values.pdb.minAvailable }}
......
apiVersion: v1 apiVersion: v1
name: kapacitor name: kapacitor
version: 1.4.2 version: 1.4.3
appVersion: 1.6.3 appVersion: 1.6.3
description: InfluxDB's native data processing engine. It can process both stream description: InfluxDB's native data processing engine. It can process both stream
and batch data from InfluxDB. and batch data from InfluxDB.
......
{{- if and .Values.rbac.create .Values.rbac.namespaced -}} {{- 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 apiVersion: rbac.authorization.k8s.io/v1beta1
{{- end }}
kind: Role kind: Role
metadata: metadata:
name: {{ template "kapacitor.fullname" . }} name: {{ template "kapacitor.fullname" . }}
......
{{- if and .Values.rbac.create .Values.rbac.namespaced -}} {{- 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 apiVersion: rbac.authorization.k8s.io/v1beta1
{{- end }}
kind: RoleBinding kind: RoleBinding
metadata: metadata:
name: {{ template "kapacitor.fullname" . }} name: {{ template "kapacitor.fullname" . }}
......
apiVersion: v2 apiVersion: v2
name: telegraf name: telegraf
version: 1.8.13 version: 1.8.14
appVersion: 1.21.2 appVersion: 1.21.3
deprecated: false deprecated: false
description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics. description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
keywords: keywords:
......
{{- if .Values.pdb.create }} {{- if .Values.pdb.create }}
{{- if .Capabilities.APIVersions.Has "policy/v1" }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1 apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget kind: PodDisruptionBudget
metadata: metadata:
name: {{ include "telegraf.fullname" . }} name: {{ include "telegraf.fullname" . }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment