Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ingress to elasticsearch #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions efk/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ elasticsearch:
classProvisioner: volume.alpha.kubernetes.io/storage-class
# Retain or Delete
reclaimPolicy: Delete

ingress:
# if enabled it will create the ingress
enabled: false
hosts:
- your_elsaticsearch_domain.com
annotations:
kubernetes.io/ingress.class: your_controller
path: /
httpPort: 9200

resources:
requests:
memory: 1024Mi
Expand Down
39 changes: 39 additions & 0 deletions elasticsearch/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{- if .Values.ingress.enabled -}}
{{- $servicePort := .Values.httpPort -}}
{{- $serviceName := include "elasticsearch.name" . -}}
{{- $serviceName2 := .Values.name -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ .Release.Name }}-ingress
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:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: "{{ $serviceName }}-{{ $serviceName2 }}"
servicePort: {{ $servicePort }}
{{- end }}
{{- end }}