Files
charts/bitnami/elasticsearch/templates/master-deploy.yaml
2018-07-30 17:18:58 +02:00

111 lines
4.1 KiB
YAML

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "master.fullname" . }}
labels:
app: {{ template "elasticsearch.name" . }}
chart: {{ template "elasticsearch.chart" . }}
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
role: "master"
spec:
replicas: {{ .Values.master.replicas }}
template:
metadata:
labels:
app: {{ template "elasticsearch.name" . }}
chart: {{ template "elasticsearch.chart" . }}
release: {{ .Release.Name | quote }}
role: "master"
spec:
{{- if eq .Values.master.antiAffinity "hard" }}
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels:
app: {{ template "elasticsearch.name" . }}
release: {{ .Release.Name | quote }}
role: "master"
{{- else if eq .Values.master.antiAffinity "soft" }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
app: {{ template "elasticsearch.name" . }}
release: {{ .Release.Name | quote }}
role: "master"
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end}}
{{- end }}
initContainers:
- name: sysctl
image: {{ template "elasticsearch.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
command: ["sysctl", "-w", "vm.max_map_count=262144"]
securityContext:
privileged: true
containers:
- name: {{ template "master.fullname" . }}
image: {{ template "elasticsearch.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
env:
- name: ELASTICSEARCH_CLUSTER_NAME
value: {{ .Values.name | quote }}
- name: ELASTICSEARCH_PLUGINS
value: {{ .Values.plugins | quote }}
- name: ELASTICSEARCH_HEAP_SIZE
value: {{ .Values.master.heapSize | quote }}
- name: ELASTICSEARCH_IS_DEDICATED_NODE
value: "yes"
- name: ELASTICSEARCH_NODE_TYPE
value: "master"
ports:
- name: transport
containerPort: 9300
{{- if .Values.master.livenessProbe.enabled }}
livenessProbe:
initialDelaySeconds: {{ .Values.master.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.master.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.master.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.master.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.master.livenessProbe.failureThreshold }}
httpGet:
path: /_cluster/health?local=true
port: 9200
{{- end }}
{{- if .Values.master.readinessProbe.enabled }}
readinessProbe:
initialDelaySeconds: {{ .Values.master.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.master.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.master.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.master.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.master.livenessProbe.failureThreshold }}
httpGet:
path: /_cluster/health?local=true
port: 9200
{{- end }}
resources:
{{ toYaml .Values.master.resources | indent 10 }}
volumeMounts:
- mountPath: /bitnami/elasticsearch/conf/elasticsearch_custom.yml
name: "config"
subPath: elasticsearch_custom.yml
- name: "data"
mountPath: "/bitnami/elasticsearch/data"
volumes:
- name: "config"
configMap:
name: {{ template "elasticsearch.fullname" . }}
- name: "data"
emptyDir: {}