From b8c1d176894acd24025ccfcefa57c01f9879e340 Mon Sep 17 00:00:00 2001 From: Emmanuel Mathot Date: Mon, 24 Jan 2022 13:37:47 +0100 Subject: [PATCH 1/3] update ingress for latest k8s versions --- deployment/k8s/titiler/Chart.yaml | 4 +-- deployment/k8s/titiler/templates/ingress.yaml | 26 ++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/deployment/k8s/titiler/Chart.yaml b/deployment/k8s/titiler/Chart.yaml index 1061d1afb..684a29df9 100644 --- a/deployment/k8s/titiler/Chart.yaml +++ b/deployment/k8s/titiler/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: 0.3.10 +appVersion: 0.4.0 description: A dynamic Web Map tile server name: titiler -version: 0.2.0 +version: 0.3.1 diff --git a/deployment/k8s/titiler/templates/ingress.yaml b/deployment/k8s/titiler/templates/ingress.yaml index 1006d947e..6f222b2ff 100644 --- a/deployment/k8s/titiler/templates/ingress.yaml +++ b/deployment/k8s/titiler/templates/ingress.yaml @@ -1,7 +1,14 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "titiler.fullname" . -}} {{- $svcPort := .Values.service.port -}} -{{- 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 @@ -14,6 +21,9 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} @@ -30,10 +40,20 @@ spec: http: paths: {{- range .paths }} - - path: {{ . }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} serviceName: {{ $fullName }} servicePort: {{ $svcPort }} + {{- end }} {{- end }} {{- end }} - {{- end }} +{{- end }} From 51a4cacdb3dd7498b8e2d01502a2b4d8e9e09e71 Mon Sep 17 00:00:00 2001 From: Emmanuel Mathot Date: Mon, 24 Jan 2022 13:49:28 +0100 Subject: [PATCH 2/3] updated changelog --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index cfd7f7cb6..dda9629a3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,8 @@ ## Unreleased +* Update ingress k8s templates to be compatible with latest resource types versions + ## titiler.core * update type information for the factory `colormap_dependency` From 99c3dc3cc7832cc5a402c71fc303fd738af8b614 Mon Sep 17 00:00:00 2001 From: Vincent Sarago Date: Tue, 25 Jan 2022 08:11:12 +0100 Subject: [PATCH 3/3] Update CHANGES.md --- CHANGES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index dda9629a3..840f1e21a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,8 @@ ## Unreleased -* Update ingress k8s templates to be compatible with latest resource types versions +## k8s +* Update ingress k8s templates to be compatible with latest resource types versions (https://github.com/developmentseed/titiler/pull/425 ## titiler.core