diff --git a/helm/Chart.yaml b/helm/Chart.yaml index a7d52dee..8759db7f 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/ -version: 2.0.1 +version: 2.1.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/helm/templates/ingress.yaml b/helm/templates/ingress.yaml index a3e6b07b..48bdd89b 100644 --- a/helm/templates/ingress.yaml +++ b/helm/templates/ingress.yaml @@ -1,6 +1,13 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "ngt-archive.fullname" . -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} apiVersion: networking.k8s.io/v1beta1 {{- else -}} apiVersion: extensions/v1beta1 @@ -16,7 +23,7 @@ metadata: namespace: {{ .Release.Namespace }} name: web spec: - ingressClassName: nginx + ingressClassName: {{ .Values.ingress.className }} rules: {{- range .Values.ingress.hosts }} - host: {{ tpl .host $ | quote }} @@ -24,9 +31,19 @@ spec: paths: {{- range .paths }} - path: {{ tpl .path $ }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} backend: - serviceName: web + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: web + port: + number: 8000 + {{- else }} + serviceName: {{ $fullName }} servicePort: 8000 + {{- end }} {{- end }} {{- end }} diff --git a/helm/templates/pgdump-cronjob.yaml b/helm/templates/pgdump-cronjob.yaml index 1f5542db..d5856d55 100644 --- a/helm/templates/pgdump-cronjob.yaml +++ b/helm/templates/pgdump-cronjob.yaml @@ -1,4 +1,4 @@ -apiVersion: batch/v1beta1 +apiVersion: batch/v1 kind: CronJob metadata: annotations: diff --git a/helm/values.yaml b/helm/values.yaml index fdbee999..8abc9c84 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -76,6 +76,8 @@ volume: ingress: # ingress.name - Name of the ingres. (Defaults to fullname) name: "" + # ingress.className + className: "nginx" # ingress.enabled - enable the ingress enabled: false # ingress.annotations - annotations for this ingress