Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Adding backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
framsouza committed Oct 11, 2021
1 parent b01f692 commit 6b05d3e
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 9 deletions.
54 changes: 53 additions & 1 deletion elasticsearch/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,57 @@
{{- $httpPort := .Values.httpPort -}}
{{- $pathtype := .Values.ingress.pathtype -}}
{{- $ingressPath := .Values.ingress.path -}}
{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.Version }}
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app: {{ .Chart.Name }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- if .ingressPath }}
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- else }}
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
{{- if $ingressPath }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $httpPort }}
{{- else }}
- host: {{ .host }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ .servicePort | default $httpPort }}
{{- end }}
{{- end }}
{{- end }}
{{- else }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand Down Expand Up @@ -57,4 +108,5 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
16 changes: 8 additions & 8 deletions elasticsearch/values.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
clusterName: "elasticsearch"
nodeGroup: "nodes"
clusterName: "es"
nodeGroup: "test"

# The service that non master groups will try to connect to when joining the cluster
# This should be set to clusterName + "-" + nodeGroup for your master group
masterService: ""
masterService: "es-test"

# Elasticsearch roles that will be applied to this nodeGroup
# These will be set as environment variables. E.g. node.roles=master
Expand Down Expand Up @@ -241,14 +241,14 @@ tolerations: []
# Enabling this will publicly expose your Elasticsearch instance.
# Only enable this if you have security enabled on your cluster
ingress:
enabled: false
enabled: true
className: ""
#annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
pathtype: ImplementationSpecific
annotations:
kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
- host: fram-example.local
paths:
- path: /
tls: []
Expand Down

0 comments on commit 6b05d3e

Please sign in to comment.