Conditionally update ingress api version based on k8s version (#183)
* Update ingress api version, extension/v1beta1 will not be supported in new k8s version, this change keep backward compatibility for lower kubernetes version * Update deprecated util Capabilities.KubeVersion.GitVersion to Capabilities.KubeVersion.Version
This commit is contained in:
parent
0a82ab0f9a
commit
83bb8bd60f
@ -19,7 +19,11 @@
|
||||
|
||||
{{- if .Values.extra.dashboard }}
|
||||
{{- if .Values.dashboard.ingress.enabled }}
|
||||
{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.Version }}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- else }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
labels:
|
||||
@ -45,8 +49,17 @@ spec:
|
||||
http:
|
||||
paths:
|
||||
- path: {{ .Values.dashboard.ingress.path }}
|
||||
{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.Version }}
|
||||
backend:
|
||||
serviceName: "{{ template "pulsar.fullname" . }}-{{ .Values.dashboard.component }}"
|
||||
servicePort: {{ .Values.dashboard.ingress.port }}
|
||||
{{- else }}
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.dashboard.component }}"
|
||||
port:
|
||||
number: {{ .Values.dashboard.ingress.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@ -19,7 +19,11 @@
|
||||
|
||||
{{- if or .Values.monitoring.grafana .Values.extra.monitoring }}
|
||||
{{- if .Values.grafana.ingress.enabled }}
|
||||
{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.Version }}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- else }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}"
|
||||
@ -42,9 +46,18 @@ spec:
|
||||
- http:
|
||||
paths:
|
||||
- path: {{ .Values.grafana.ingress.path }}
|
||||
{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.Version }}
|
||||
backend:
|
||||
serviceName: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}"
|
||||
servicePort: {{ .Values.grafana.ingress.port }}
|
||||
{{- else }}
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}"
|
||||
port:
|
||||
number: {{ .Values.grafana.ingress.port }}
|
||||
{{- end }}
|
||||
{{- if .Values.grafana.ingress.hostname }}
|
||||
host: {{ .Values.grafana.ingress.hostname }}
|
||||
{{- end }}
|
||||
|
||||
@ -18,7 +18,11 @@
|
||||
#
|
||||
|
||||
{{- if .Values.proxy.ingress.enabled }}
|
||||
{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.Version }}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- else }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
labels:
|
||||
@ -43,6 +47,7 @@ spec:
|
||||
- http:
|
||||
paths:
|
||||
- path: {{ .Values.proxy.ingress.path }}
|
||||
{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.Version }}
|
||||
backend:
|
||||
serviceName: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||
{{- if and .Values.tls.enabled .Values.tls.proxy.enabled }}
|
||||
@ -50,6 +55,18 @@ spec:
|
||||
{{- else }}
|
||||
servicePort: {{ .Values.proxy.ports.http }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||
port:
|
||||
{{- if and .Values.tls.enabled .Values.tls.proxy.enabled }}
|
||||
number: {{ .Values.proxy.ports.https }}
|
||||
{{- else }}
|
||||
number: {{ .Values.proxy.ports.http }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.proxy.ingress.hostname }}
|
||||
host: {{ .Values.proxy.ingress.hostname }}
|
||||
{{- end }}
|
||||
|
||||
@ -18,7 +18,11 @@
|
||||
#
|
||||
|
||||
{{- if .Values.pulsar_manager.ingress.enabled }}
|
||||
{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.Version }}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- else }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
labels:
|
||||
@ -43,9 +47,18 @@ spec:
|
||||
- http:
|
||||
paths:
|
||||
- path: {{ .Values.pulsar_manager.ingress.path }}
|
||||
{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.Version }}
|
||||
backend:
|
||||
serviceName: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}"
|
||||
servicePort: {{ .Values.pulsar_manager.service.targetPort }}
|
||||
{{- else }}
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}"
|
||||
port:
|
||||
number: {{ .Values.pulsar_manager.service.targetPort }}
|
||||
{{- end }}
|
||||
{{- if .Values.pulsar_manager.ingress.hostname }}
|
||||
host: {{ .Values.pulsar_manager.ingress.hostname }}
|
||||
{{- end }}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user