2 # Copyright © 2020 Bitnami, AT&T, Amdocs, Bell Canada, highstreet technologies
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 {{- if .Values.enabled }}
17 {{ $role := "curator" -}}
18 {{ $suffix := $role -}}
19 {{ $labels := (dict "role" $role) -}}
20 apiVersion: batch/v1beta1
22 metadata: {{- include "common.resourceMetadata" (dict "suffix" $suffix "labels" $labels "dot" . )| nindent 2 }}
23 {{- if .Values.cronjob.annotations }}
24 annotations: {{- toYaml .Values.cronjob.annotations | indent 4 }}
27 schedule: "{{ .Values.cronjob.schedule }}"
28 {{- with .Values.cronjob.concurrencyPolicy }}
29 concurrencyPolicy: {{ . }}
31 {{- with .Values.cronjob.failedJobsHistoryLimit }}
32 failedJobsHistoryLimit: {{ . }}
34 {{- with .Values.cronjob.successfulJobsHistoryLimit }}
35 successfulJobsHistoryLimit: {{ . }}
38 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
41 metadata: {{- include "common.templateMetadata" . | nindent 10 }}
46 name: {{ template "common.fullname" . }}-curator
47 {{- if .Values.extraVolumes }}
48 {{- toYaml .Values.extraVolumes | nindent 12 }}
50 restartPolicy: {{ .Values.global.restartPolicy | default .Values.cronjob.jobRestartPolicy }}
51 {{- if .Values.priorityClassName }}
52 priorityClassName: {{ .Values.priorityClassName | quote }}
54 {{- include "elasticsearch.imagePullSecrets" . | indent 10 }}
55 {{- if .Values.extraInitContainers }}
57 {{- range $key, $value := .Values.extraInitContainers }}
59 {{- toYaml $value | nindent 14 }}
62 {{- if .Values.rbac.enabled }}
63 serviceAccountName: {{ include "elasticsearch.curator.serviceAccountName" . }}
65 {{- if .Values.affinity }}
66 affinity: {{- include "common.tplValue" (dict "value" .Values.affinity "context" $) | nindent 12 }}
68 {{- if .Values.nodeSelector }}
69 nodeSelector: {{- include "common.tplValue" (dict "value" .Values.nodeSelector "context" $) | nindent 12 }}
71 {{- if .Values.tolerations }}
72 tolerations: {{- include "common.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 12 }}
74 {{- if .Values.securityContext }}
75 securityContext: {{- toYaml .Values.securityContext | nindent 12 }}
78 - name: {{ template "common.fullname" . }}-curator
79 image: {{printf "%s/%s" (include "repositoryGenerator.repository" .) .Values.image }}
80 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
83 mountPath: /etc/es-curator
84 {{- if .Values.extraVolumeMounts }}
85 {{- toYaml .Values.extraVolumeMounts | nindent 16 }}
87 {{ if .Values.command }}
88 command: {{ toYaml .Values.command | nindent 16 }}
90 {{- if .Values.dryrun }}
91 args: [ "--dry-run", "--config", "/etc/es-curator/config.yml", "/etc/es-curator/action_file.yml" ]
93 args: [ "--config", "/etc/es-curator/config.yml", "/etc/es-curator/action_file.yml" ]
97 {{- range $key,$value := .Values.env }}
98 - name: {{ $key | upper | quote}}
99 value: {{ $value | quote}}
102 {{- if .Values.envFromSecrets }}
103 {{- range $key,$value := .Values.envFromSecrets }}
104 - name: {{ $key | upper | quote}}
107 name: {{ $value.from.secret | quote}}
108 key: {{ $value.from.key | quote}}
111 {{- if .Values.resources }}
112 resources: {{- toYaml .Values.resources | nindent 16 }}