-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(k8s): Add k8s hook in datahub helm chart for setting up elastics…
…earch (#2302)
- Loading branch information
1 parent
d158da7
commit 918097c
Showing
3 changed files
with
52 additions
and
0 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
43 changes: 43 additions & 0 deletions
43
contrib/kubernetes/datahub/templates/elasticsearch-setup-job.yml
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,43 @@ | ||
{{- if .Values.elasticsearchInitJob.enabled -}} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ .Release.Name }}-elasticsearch-init-job | ||
labels: | ||
app.kubernetes.io/managed-by: {{ .Release.Service | quote }} | ||
app.kubernetes.io/instance: {{ .Release.Name | quote }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion }} | ||
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
annotations: | ||
# This is what defines this resource as a hook. Without this line, the | ||
# job is considered part of the release. | ||
"helm.sh/hook": pre-install,pre-upgrade | ||
"helm.sh/hook-weight": "-5" | ||
"helm.sh/hook-delete-policy": before-hook-creation | ||
spec: | ||
template: | ||
spec: | ||
{{- with .Values.global.hostAliases }} | ||
hostAliases: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
restartPolicy: Never | ||
securityContext: | ||
runAsUser: 1000 | ||
fsGroup: 1000 | ||
containers: | ||
- name: elasticsearch-init-job | ||
image: "{{ .Values.elasticsearchInitJob.image.repository }}:{{ .Values.elasticsearchInitJob.image.tag }}" | ||
env: | ||
- name: ELASTICSEARCH_HOST | ||
value: {{ .Values.global.elasticsearch.host | quote }} | ||
- name: ELASTICSEARCH_PORT | ||
value: {{ .Values.global.elasticsearch.port | quote }} | ||
resources: | ||
limits: | ||
cpu: 500m | ||
memory: 512Mi | ||
requests: | ||
cpu: 300m | ||
memory: 256Mi | ||
{{- 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