diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e7fc04..b8b435e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - export servo MBeans with JMX Prometheus exporter [#65](https://github.com/Telecominfraproject/wlan-cloud-helm/pull/65) - render post-deployment message [#73](https://github.com/Telecominfraproject/wlan-cloud-helm/pull/73) +### Changed + +- migrate to networking.k8s.io/v1 API version for Ingress resources [#74](https://github.com/Telecominfraproject/wlan-cloud-helm/pull/74) + ## [1.0.1] - 2021-04-12 ### Changed diff --git a/tip-wlan/charts/wlan-cloud-graphql-gw/templates/ingress.yaml b/tip-wlan/charts/wlan-cloud-graphql-gw/templates/ingress.yaml index 2f18de9..07b4f88 100644 --- a/tip-wlan/charts/wlan-cloud-graphql-gw/templates/ingress.yaml +++ b/tip-wlan/charts/wlan-cloud-graphql-gw/templates/ingress.yaml @@ -1,7 +1,9 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "common.fullname" . -}} {{- $svcPort := .Values.service.port -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }} +apiVersion: networking.k8s.io/v1 +{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} apiVersion: networking.k8s.io/v1beta1 {{- else -}} apiVersion: extensions/v1beta1 @@ -36,15 +38,35 @@ spec: paths: {{- if $.Values.ingress.lb_https_redirect }} - path: /* + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + pathType: ImplementationSpecific + {{- end }} backend: + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + service: + name: ssl-redirect + port: + name: use-annotation + {{- else -}} serviceName: ssl-redirect servicePort: use-annotation + {{- end }} {{- end }} {{- range .paths }} - path: {{ . }} + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + pathType: ImplementationSpecific + {{- end }} backend: + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else -}} serviceName: {{ $fullName }} servicePort: {{ $svcPort }} + {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/tip-wlan/charts/wlan-cloud-static-portal/templates/ingress.yaml b/tip-wlan/charts/wlan-cloud-static-portal/templates/ingress.yaml index 2f18de9..07b4f88 100644 --- a/tip-wlan/charts/wlan-cloud-static-portal/templates/ingress.yaml +++ b/tip-wlan/charts/wlan-cloud-static-portal/templates/ingress.yaml @@ -1,7 +1,9 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "common.fullname" . -}} {{- $svcPort := .Values.service.port -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }} +apiVersion: networking.k8s.io/v1 +{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} apiVersion: networking.k8s.io/v1beta1 {{- else -}} apiVersion: extensions/v1beta1 @@ -36,15 +38,35 @@ spec: paths: {{- if $.Values.ingress.lb_https_redirect }} - path: /* + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + pathType: ImplementationSpecific + {{- end }} backend: + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + service: + name: ssl-redirect + port: + name: use-annotation + {{- else -}} serviceName: ssl-redirect servicePort: use-annotation + {{- end }} {{- end }} {{- range .paths }} - path: {{ . }} + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + pathType: ImplementationSpecific + {{- end }} backend: + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else -}} serviceName: {{ $fullName }} servicePort: {{ $svcPort }} + {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/tip-wlan/charts/wlan-portal-service/templates/ingress.yaml b/tip-wlan/charts/wlan-portal-service/templates/ingress.yaml index cd689ce..dac7fbd 100644 --- a/tip-wlan/charts/wlan-portal-service/templates/ingress.yaml +++ b/tip-wlan/charts/wlan-portal-service/templates/ingress.yaml @@ -1,7 +1,9 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "common.fullname" . -}} {{- $svcPort := .Values.service.port1 -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }} +apiVersion: networking.k8s.io/v1 +{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} apiVersion: networking.k8s.io/v1beta1 {{- else -}} apiVersion: extensions/v1beta1 @@ -34,15 +36,35 @@ spec: paths: {{- if $.Values.ingress.lb_https_redirect }} - path: /* + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + pathType: ImplementationSpecific + {{- end }} backend: + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + service: + name: ssl-redirect + port: + name: use-annotation + {{- else -}} serviceName: ssl-redirect servicePort: use-annotation + {{- end }} {{- end }} {{- range .paths }} - path: {{ . }} + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + pathType: ImplementationSpecific + {{- end }} backend: + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else -}} serviceName: {{ $fullName }} servicePort: {{ $svcPort }} + {{- end -}} {{- end }} {{- end }} {{- end }}