diff --git a/chart/templates/opensearch-dashboards/opensearch-dashboards-ingress.yaml b/chart/templates/opensearch-dashboards/opensearch-dashboards-ingress.yaml index 701aac5..072c105 100644 --- a/chart/templates/opensearch-dashboards/opensearch-dashboards-ingress.yaml +++ b/chart/templates/opensearch-dashboards/opensearch-dashboards-ingress.yaml @@ -1,16 +1,5 @@ {{- if and .Values.opensearch_dashboards.externalOpensearchDashboards.disabled .Values.opensearch_dashboards.ingress.enabled }} -{{- if and .Values.opensearch_dashboards.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.opensearch_dashboards.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.opensearch_dashboards.ingress.annotations "kubernetes.io/ingress.class" .Values.opensearch_dashboards.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 -{{- end }} kind: Ingress metadata: name: {{ .Release.Name }}-opensearch-dashboards @@ -19,7 +8,7 @@ metadata: annotations: {{ toYaml . | nindent 4 }} {{- end }} spec: - {{- if and .Values.opensearch_dashboards.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + {{- if .Values.opensearch_dashboards.ingress.className }} ingressClassName: {{ .Values.opensearch_dashboards.ingress.className }} {{- end }} {{- with .Values.opensearch_dashboards.ingress.tls }} @@ -32,19 +21,12 @@ spec: http: paths: - path: {{ .Values.opensearch_dashboards.ingress.path }} - {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} pathType: Prefix - {{- end }} backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} service: name: {{ .Release.Name }}-opensearch-dashboards port: number: 5601 - {{- else }} - serviceName: {{ .Release.Name }}-opensearch-dashboards - servicePort: 5601 - {{- end }} {{- end }} {{- if .Values.opensearch_dashboards.ingress.hosts }} {{- $root := . -}} diff --git a/chart/templates/opensearch/os-client-ingress.yaml b/chart/templates/opensearch/os-client-ingress.yaml index 4b4461d..99bae9f 100644 --- a/chart/templates/opensearch/os-client-ingress.yaml +++ b/chart/templates/opensearch/os-client-ingress.yaml @@ -1,16 +1,5 @@ {{- if and .Values.opensearch.externalOpensearch.disabled .Values.client.ingress.enabled -}} -{{- if and .Values.client.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.client.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.client.ingress.annotations "kubernetes.io/ingress.class" .Values.client.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 -{{- end }} kind: Ingress metadata: name: {{ .Release.Name }}-os @@ -32,17 +21,10 @@ spec: http: paths: - path: {{ .Values.client.ingress.path }} - {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} pathType: Prefix - {{- end }} backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} service: name: {{ .Release.Name }}-client port: number: 9200 - {{- else }} - serviceName: {{ .Release.Name }}-client - servicePort: 9200 - {{- end }} {{- end -}} \ No newline at end of file