forked from helm/charts
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Promote elasticsearch to stable (helm#8476)
Signed-off-by: Pete Brown <pete.brown@powerhrg.com> Signed-off-by: Jakob Niggel <info@jakobniggel.de>
- Loading branch information
1 parent
3dfc372
commit aaee694
Showing
20 changed files
with
1,306 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.git | ||
# OWNERS file for Kubernetes | ||
OWNERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: elasticsearch | ||
home: https://www.elastic.co/products/elasticsearch | ||
version: 1.11.0 | ||
appVersion: 6.4.2 | ||
description: Flexible and powerful open source, distributed real-time search and analytics | ||
engine. | ||
icon: https://static-www.elastic.co/assets/blteb1c97719574938d/logo-elastic-elasticsearch-lt.svg | ||
sources: | ||
- https://www.elastic.co/products/elasticsearch | ||
- https://github.com/jetstack/elasticsearch-pet | ||
- https://github.com/giantswarm/kubernetes-elastic-stack | ||
- https://github.com/GoogleCloudPlatform/elasticsearch-docker | ||
- https://github.com/clockworksoul/helm-elasticsearch | ||
- https://github.com/pires/kubernetes-elasticsearch-cluster | ||
maintainers: | ||
- name: simonswine | ||
email: christian@jetstack.io | ||
- name: icereval | ||
email: michael.haselton@gmail.com | ||
- name: rendhalver | ||
email: pete.brown@powerhrg.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
approvers: | ||
- simonswine | ||
- icereval | ||
- rendhalver | ||
reviewers: | ||
- simonswine | ||
- icereval | ||
- rendhalver |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
extraInitContainers: | | ||
- name: "plugin-install-ingest-attachment" | ||
image: "docker.elastic.co/elasticsearch/elasticsearch-oss:6.4.0" | ||
command: ["/bin/bash"] | ||
args: ["-c", "yes | /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment"] | ||
- name: "plugin-install-mapper-size" | ||
image: "docker.elastic.co/elasticsearch/elasticsearch-oss:6.4.0" | ||
command: ["/bin/bash"] | ||
args: ["-c", "yes | /usr/share/elasticsearch/bin/elasticsearch-plugin install mapper-size"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
The elasticsearch cluster has been installed. | ||
|
||
Elasticsearch can be accessed: | ||
|
||
* Within your cluster, at the following DNS name at port 9200: | ||
|
||
{{ template "elasticsearch.client.fullname" . }}.{{ .Release.Namespace }}.svc | ||
|
||
* From outside the cluster, run these commands in the same shell: | ||
{{- if contains "NodePort" .Values.client.serviceType }} | ||
|
||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "elasticsearch.client.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.client.serviceType }} | ||
|
||
WARNING: You have likely exposed your Elasticsearch cluster direct to the internet. | ||
Elasticsearch does not implement any security for public facing clusters by default. | ||
As a minimum level of security; switch to ClusterIP/NodePort and place an Nginx gateway infront of the cluster in order to lock down access to dangerous HTTP endpoints and verbs. | ||
|
||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get svc -w {{ template "elasticsearch.client.fullname" . }}' | ||
|
||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "elasticsearch.client.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
echo http://$SERVICE_IP:9200 | ||
{{- else if contains "ClusterIP" .Values.client.serviceType }} | ||
|
||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "elasticsearch.name" . }},component={{ .Values.client.name }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
echo "Visit http://127.0.0.1:9200 to use Elasticsearch" | ||
kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME 9200:9200 | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "elasticsearch.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "elasticsearch.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified client name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "elasticsearch.client.fullname" -}} | ||
{{ template "elasticsearch.fullname" . }}-{{ .Values.client.name }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified data name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "elasticsearch.data.fullname" -}} | ||
{{ template "elasticsearch.fullname" . }}-{{ .Values.data.name }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified master name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "elasticsearch.master.fullname" -}} | ||
{{ template "elasticsearch.fullname" . }}-{{ .Values.master.name }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
apiVersion: apps/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: {{ template "elasticsearch.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
component: "{{ .Values.client.name }}" | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
name: {{ template "elasticsearch.client.fullname" . }} | ||
spec: | ||
replicas: {{ .Values.client.replicas }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "elasticsearch.name" . }} | ||
component: "{{ .Values.client.name }}" | ||
release: {{ .Release.Name }} | ||
{{- if .Values.client.podAnnotations }} | ||
annotations: | ||
{{ toYaml .Values.client.podAnnotations | indent 8 }} | ||
{{- end }} | ||
spec: | ||
{{- if .Values.client.priorityClassName }} | ||
priorityClassName: "{{ .Values.client.priorityClassName }}" | ||
{{- end }} | ||
securityContext: | ||
fsGroup: 1000 | ||
{{- if or .Values.client.antiAffinity .Values.client.nodeAffinity }} | ||
affinity: | ||
{{- end }} | ||
{{- if eq .Values.client.antiAffinity "hard" }} | ||
podAntiAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- topologyKey: "kubernetes.io/hostname" | ||
labelSelector: | ||
matchLabels: | ||
app: "{{ template "elasticsearch.name" . }}" | ||
release: "{{ .Release.Name }}" | ||
component: "{{ .Values.client.name }}" | ||
{{- else if eq .Values.client.antiAffinity "soft" }} | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- weight: 1 | ||
podAffinityTerm: | ||
topologyKey: kubernetes.io/hostname | ||
labelSelector: | ||
matchLabels: | ||
app: "{{ template "elasticsearch.name" . }}" | ||
release: "{{ .Release.Name }}" | ||
component: "{{ .Values.client.name }}" | ||
{{- end }} | ||
{{- with .Values.client.nodeAffinity }} | ||
nodeAffinity: | ||
{{ toYaml . | indent 10 }} | ||
{{- end }} | ||
{{- if .Values.client.nodeSelector }} | ||
nodeSelector: | ||
{{ toYaml .Values.client.nodeSelector | indent 8 }} | ||
{{- end }} | ||
{{- if .Values.client.tolerations }} | ||
tolerations: | ||
{{ toYaml .Values.client.tolerations | indent 8 }} | ||
{{- end }} | ||
initContainers: | ||
# see https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html | ||
# and https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html#mlockall | ||
- name: "sysctl" | ||
image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" | ||
imagePullPolicy: {{ .Values.initImage.pullPolicy | quote }} | ||
command: ["sysctl", "-w", "vm.max_map_count=262144"] | ||
securityContext: | ||
privileged: true | ||
{{- if .Values.extraInitContainers }} | ||
{{ tpl .Values.extraInitContainers . | indent 6 }} | ||
{{- end }} | ||
containers: | ||
- name: elasticsearch | ||
env: | ||
- name: NODE_DATA | ||
value: "false" | ||
{{- if hasPrefix "5." .Values.appVersion }} | ||
- name: NODE_INGEST | ||
value: "false" | ||
{{- end }} | ||
- name: NODE_MASTER | ||
value: "false" | ||
- name: DISCOVERY_SERVICE | ||
value: {{ template "elasticsearch.fullname" . }}-discovery | ||
- name: PROCESSORS | ||
valueFrom: | ||
resourceFieldRef: | ||
resource: limits.cpu | ||
- name: ES_JAVA_OPTS | ||
value: "-Djava.net.preferIPv4Stack=true -Xms{{ .Values.client.heapSize }} -Xmx{{ .Values.client.heapSize }} {{ .Values.cluster.additionalJavaOpts }}" | ||
{{- range $key, $value := .Values.cluster.env }} | ||
- name: {{ $key }} | ||
value: {{ $value | quote }} | ||
{{- end }} | ||
resources: | ||
{{ toYaml .Values.client.resources | indent 12 }} | ||
readinessProbe: | ||
httpGet: | ||
path: /_cluster/health | ||
port: 9200 | ||
initialDelaySeconds: 5 | ||
livenessProbe: | ||
httpGet: | ||
path: /_cluster/health?local=true | ||
port: 9200 | ||
initialDelaySeconds: 90 | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }} | ||
ports: | ||
- containerPort: 9200 | ||
name: http | ||
- containerPort: 9300 | ||
name: transport | ||
volumeMounts: | ||
- mountPath: /usr/share/elasticsearch/config/elasticsearch.yml | ||
name: config | ||
subPath: elasticsearch.yml | ||
{{- if hasPrefix "2." .Values.image.tag }} | ||
- mountPath: /usr/share/elasticsearch/config/logging.yml | ||
name: config | ||
subPath: logging.yml | ||
{{- end }} | ||
{{- if hasPrefix "5." .Values.image.tag }} | ||
- mountPath: /usr/share/elasticsearch/config/log4j2.properties | ||
name: config | ||
subPath: log4j2.properties | ||
{{- end }} | ||
{{- if .Values.cluster.keystoreSecret }} | ||
- name: keystore | ||
mountPath: "/usr/share/elasticsearch/config/elasticsearch.keystore" | ||
subPath: elasticsearch.keystore | ||
readOnly: true | ||
{{- end }} | ||
{{- if .Values.image.pullSecrets }} | ||
imagePullSecrets: | ||
{{- range $pullSecret := .Values.image.pullSecrets }} | ||
- name: {{ $pullSecret }} | ||
{{- end }} | ||
{{- end }} | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: {{ template "elasticsearch.fullname" . }} | ||
{{- if .Values.cluster.keystoreSecret }} | ||
- name: keystore | ||
secret: | ||
secretName: {{ .Values.cluster.keystoreSecret }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{{- if .Values.client.podDisruptionBudget.enabled }} | ||
apiVersion: policy/v1beta1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
labels: | ||
app: {{ template "elasticsearch.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
component: "{{ .Values.client.name }}" | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
name: {{ template "elasticsearch.client.fullname" . }} | ||
spec: | ||
{{- if .Values.client.podDisruptionBudget.minAvailable }} | ||
minAvailable: {{ .Values.client.podDisruptionBudget.minAvailable }} | ||
{{- end }} | ||
{{- if .Values.client.podDisruptionBudget.maxUnavailable }} | ||
maxUnavailable: {{ .Values.client.podDisruptionBudget.maxUnavailable }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
app: {{ template "elasticsearch.name" . }} | ||
component: "{{ .Values.client.name }}" | ||
release: {{ .Release.Name }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: {{ template "elasticsearch.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
component: "{{ .Values.client.name }}" | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
name: {{ template "elasticsearch.client.fullname" . }} | ||
{{- if .Values.client.serviceAnnotations }} | ||
annotations: | ||
{{ toYaml .Values.client.serviceAnnotations | indent 4 }} | ||
{{- end }} | ||
|
||
spec: | ||
ports: | ||
- name: http | ||
port: 9200 | ||
targetPort: http | ||
selector: | ||
app: {{ template "elasticsearch.name" . }} | ||
component: "{{ .Values.client.name }}" | ||
release: {{ .Release.Name }} | ||
type: {{ .Values.client.serviceType }} | ||
{{- if .Values.client.loadBalancerIP }} | ||
loadBalancerIP: "{{ .Values.client.loadBalancerIP }}" | ||
{{- end }} | ||
{{if .Values.client.loadBalancerSourceRanges}} | ||
loadBalancerSourceRanges: | ||
{{range $rangeList := .Values.client.loadBalancerSourceRanges}} | ||
- {{ $rangeList }} | ||
{{end}} | ||
{{end}} |
Oops, something went wrong.