1 # Copyright © 2020 Bitnami, AT&T, Amdocs, Bell Canada, highstreet technologies
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 {{- if .Values.enabled }}
15 {{ $role := "curator" -}}
16 {{ $suffix := $role -}}
17 {{ $labels := (dict "role" $role) -}}
18 apiVersion: batch/v1beta1
20 metadata: {{- include "common.resourceMetadata" (dict "suffix" $suffix "labels" $labels "dot" . )| nindent 2 }}
21 {{- if .Values.cronjob.annotations }}
22 annotations: {{- toYaml .Values.cronjob.annotations | indent 4 }}
25 schedule: "{{ .Values.cronjob.schedule }}"
26 {{- with .Values.cronjob.concurrencyPolicy }}
27 concurrencyPolicy: {{ . }}
29 {{- with .Values.cronjob.failedJobsHistoryLimit }}
30 failedJobsHistoryLimit: {{ . }}
32 {{- with .Values.cronjob.successfulJobsHistoryLimit }}
33 successfulJobsHistoryLimit: {{ . }}
36 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
39 metadata: {{- include "common.templateMetadata" . | nindent 10 }}
44 name: {{ template "common.fullname" . }}-curator
45 {{- if .Values.extraVolumes }}
46 {{- toYaml .Values.extraVolumes | nindent 12 }}
48 restartPolicy: {{ .Values.global.restartPolicy | default .Values.cronjob.jobRestartPolicy }}
49 {{- if .Values.priorityClassName }}
50 priorityClassName: {{ .Values.priorityClassName | quote }}
52 {{- include "elasticsearch.imagePullSecrets" . | indent 10 }}
53 {{- if .Values.extraInitContainers }}
55 {{- range $key, $value := .Values.extraInitContainers }}
57 {{- toYaml $value | nindent 14 }}
60 {{- if .Values.rbac.enabled }}
61 serviceAccountName: {{ include "elasticsearch.curator.serviceAccountName" . }}
63 {{- if .Values.affinity }}
64 affinity: {{- include "common.tplValue" (dict "value" .Values.affinity "context" $) | nindent 12 }}
66 {{- if .Values.nodeSelector }}
67 nodeSelector: {{- include "common.tplValue" (dict "value" .Values.nodeSelector "context" $) | nindent 12 }}
69 {{- if .Values.tolerations }}
70 tolerations: {{- include "common.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 12 }}
72 {{- if .Values.securityContext }}
73 securityContext: {{- toYaml .Values.securityContext | nindent 12 }}
76 - name: {{ template "common.fullname" . }}-curator
77 image: {{printf "%s/%s:%s" (include "common.repository" .) .Values.image.imageName .Values.image.tag }}
78 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81 mountPath: /etc/es-curator
82 {{- if .Values.extraVolumeMounts }}
83 {{- toYaml .Values.extraVolumeMounts | nindent 16 }}
85 {{ if .Values.command }}
86 command: {{ toYaml .Values.command | nindent 16 }}
88 {{- if .Values.dryrun }}
89 args: [ "--dry-run", "--config", "/etc/es-curator/config.yml", "/etc/es-curator/action_file.yml" ]
91 args: [ "--config", "/etc/es-curator/config.yml", "/etc/es-curator/action_file.yml" ]
95 {{- range $key,$value := .Values.env }}
96 - name: {{ $key | upper | quote}}
97 value: {{ $value | quote}}
100 {{- if .Values.envFromSecrets }}
101 {{- range $key,$value := .Values.envFromSecrets }}
102 - name: {{ $key | upper | quote}}
105 name: {{ $value.from.secret | quote}}
106 key: {{ $value.from.key | quote}}
109 {{- if .Values.resources }}
110 resources: {{- toYaml .Values.resources | nindent 16 }}