Skip to content

Commit

Permalink
clean obsolete ingress configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
nickytd committed Dec 2, 2023
1 parent a107f18 commit caeb350
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 37 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 }}
Expand All @@ -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 := . -}}
Expand Down
18 changes: 0 additions & 18 deletions chart/templates/opensearch/os-client-ingress.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 -}}

0 comments on commit caeb350

Please sign in to comment.