You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: {{ include "opencoze.fullname" . }}-es-init
|
|
|
|
spec:
|
|
template:
|
|
spec:
|
|
restartPolicy: Never
|
|
initContainers:
|
|
- name: wait-for-es
|
|
image: busybox:1.36
|
|
command: ['sh', '-c', 'until nc -z {{ include "opencoze.fullname" . }}-elasticsearch 9200; do echo waiting for elasticsearch; sleep 2; done']
|
|
containers:
|
|
- name: es-init
|
|
image: alpine/curl:8.12.1
|
|
env:
|
|
- name: ES_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Release.Name }}-es-secret
|
|
key: username
|
|
- name: ES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Release.Name }}-es-secret
|
|
key: password
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
set -ex
|
|
/scripts/setup_es.sh
|
|
volumeMounts:
|
|
- name: es-init-script
|
|
mountPath: /scripts
|
|
- name: es-index-schema
|
|
mountPath: /es_index_schema
|
|
volumes:
|
|
- name: es-init-script
|
|
configMap:
|
|
name: {{ include "opencoze.fullname" . }}-es-init-script
|
|
defaultMode: 0755
|
|
- name: es-index-schema
|
|
configMap:
|
|
name: {{ include "opencoze.fullname" . }}-es-init-config
|
|
backoffLimit: 4 |