Files
charts/bitnami/elasticsearch/templates/coordinating-deploy.yaml

128 lines
4.9 KiB
YAML

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "elasticsearch.coordinating.fullname" . }}
labels:
app: {{ template "elasticsearch.name" . }}
chart: {{ template "elasticsearch.chart" . }}
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
role: "coordinating-only"
spec:
selector:
matchLabels:
app: {{ template "elasticsearch.name" . }}
release: "{{ .Release.Name }}"
role: "coordinating-only"
replicas: {{ .Values.coordinating.replicas }}
template:
metadata:
labels:
app: {{ template "elasticsearch.name" . }}
release: {{ .Release.Name | quote }}
role: "coordinating-only"
spec:
{{- if .Values.securityContext.enabled }}
securityContext:
fsGroup: {{ .Values.securityContext.fsGroup }}
{{- end }}
{{- if eq .Values.coordinating.antiAffinity "hard" }}
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels:
app: {{ template "elasticsearch.name" . }}
release: {{ .Release.Name | quote }}
role: "coordinating-only"
{{- else if eq .Values.coordinating.antiAffinity "soft" }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
app: {{ template "elasticsearch.name" . }}
release: {{ .Release.Name | quote }}
role: "coordinating-only"
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end}}
{{- end }}
{{- if .Values.sysctlImage.enabled }}
## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors)
initContainers:
- name: sysctl
image: {{ template "sysctl.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
command: ['sh', '-c', 'install_packages systemd && sysctl -w vm.max_map_count=262144 && sysctl -w fs.file-max=65536']
securityContext:
privileged: true
{{- end }}
containers:
- name: "elasticsearch"
{{- if .Values.securityContext.enabled }}
securityContext:
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }}
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.coordinating.heapSize | quote }}
- name: ELASTICSEARCH_IS_DEDICATED_NODE
value: "yes"
- name: ELASTICSEARCH_NODE_TYPE
value: "coordinating"
ports:
- name: http
containerPort: 9200
- name: transport
containerPort: 9300
{{- if .Values.coordinating.livenessProbe.enabled }}
livenessProbe:
initialDelaySeconds: {{ .Values.coordinating.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.coordinating.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.coordinating.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.coordinating.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.coordinating.livenessProbe.failureThreshold }}
httpGet:
path: /_cluster/health?local=true
port: http
{{- end }}
{{- if .Values.coordinating.readinessProbe.enabled}}
readinessProbe:
initialDelaySeconds: {{ .Values.coordinating.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.coordinating.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.coordinating.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.coordinating.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.coordinating.readinessProbe.failureThreshold }}
httpGet:
path: /_cluster/health?local=true
port: http
{{- end }}
resources:
{{ toYaml .Values.coordinating.resources | indent 10 }}
volumeMounts:
- mountPath: /opt/bitnami/elasticsearch/config/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: {}