forked from CloudPirates-io/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment.yaml
More file actions
206 lines (205 loc) · 8.33 KB
/
deployment.yaml
File metadata and controls
206 lines (205 loc) · 8.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "minio.fullname" . }}
namespace: {{ include "cloudpirates.namespace" . }}
labels:
{{- include "minio.labels" . | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations:
{{- include "minio.annotations" . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount | default 1 }}
strategy:
type: Recreate
selector:
matchLabels:
{{- include "minio.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- $globalPodAnnotations := (.Values.global).podAnnotations | default dict }}
{{- $annotations := mergeOverwrite (deepCopy $globalPodAnnotations) .Values.podAnnotations .Values.commonAnnotations }}
{{- with $annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "minio.labels" . | nindent 8 }}
{{- with (include "minio.podLabels" (dict "local" .Values.podLabels "context" $)) }}
{{- . | nindent 8 }}
{{- end }}
spec:
{{- with (include "minio.imagePullSecrets" .) }}
{{ . | nindent 6 }}
{{- end }}
serviceAccountName: {{ template "minio.serviceAccountName" . }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
{{- if .Values.podSecurityContext }}
securityContext: {{ include "cloudpirates.renderPodSecurityContext" . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- if .Values.containerSecurityContext }}
securityContext: {{ include "cloudpirates.renderContainerSecurityContext" . | nindent 12 }}
{{- end }}
image: {{ include "minio.image" . }}
imagePullPolicy: {{ include "minio.imagePullPolicy" . }}
command: ["/bin/sh"]
args:
- -c
- |
mkdir -p {{ .Values.persistence.mountPath }}
exec minio server {{ .Values.persistence.mountPath }} {{ include "minio.serverUrl" . }}
env:
- name: MINIO_ROOT_USER
valueFrom:
secretKeyRef:
name: {{ include "minio.secretName" . }}
key: {{ include "minio.rootUser" . }}
- name: MINIO_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "minio.secretName" . }}
key: {{ include "minio.rootPasswordKey" . }}
{{- if .Values.config.region }}
- name: MINIO_REGION
value: {{ .Values.config.region | quote }}
{{- end }}
{{- if not .Values.config.browserEnabled }}
- name: MINIO_BROWSER
value: "off"
{{- end }}
{{- if .Values.config.domain }}
- name: MINIO_DOMAIN
value: {{ .Values.config.domain | quote }}
{{- end }}
{{- if .Values.config.serverUrl }}
- name: MINIO_SERVER_URL
value: {{ .Values.config.serverUrl | quote }}
{{- end }}
{{- if .Values.config.minioOpts }}
- name: MINIO_OPTS
value: {{ .Values.config.minioOpts | quote }}
{{- end }}
{{- if .Values.config.minioVolumes }}
- name: MINIO_VOLUMES
value: {{ .Values.config.minioVolumes | quote }}
{{- end }}
{{- if .Values.config.minioConfigEnvFile }}
- name: MINIO_CONFIG_ENV_FILE
value: {{ .Values.config.minioConfigEnvFile | quote }}
{{- end }}
{{- if .Values.config.minioScannerSpeed }}
- name: MINIO_SCANNER_SPEED
value: {{ .Values.config.minioScannerSpeed | quote }}
{{- end }}
{{- if .Values.config.minioCompressionEnabled }}
- name: MINIO_COMPRESSION_ENABLE
value: {{ .Values.config.minioCompressionEnabled | quote }}
{{- end }}
{{- if and .Values.config.minioCompressionEnabled .Values.config.minioCompressionAllowEncryption }}
- name: MINIO_COMPRESSION_ALLOW_ENCRYPTION
value: {{ .Values.config.minioCompressionAllowEncryption | quote }}
{{- end }}
{{- if and .Values.config.minioCompressionEnabled .Values.config.minioCompressionExtensions }}
- name: MINIO_COMPRESSION_EXTENSIONS
value: {{ .Values.config.minioCompressionExtensions | quote }}
{{- end }}
{{- if and .Values.config.minioCompressionEnabled .Values.config.minioCompressionMimeTypes }}
- name: MINIO_COMPRESSION_MIME_TYPES
value: {{ .Values.config.minioCompressionMimeTypes | quote }}
{{- end }}
{{- with (include "minio.envVars" (dict "local" .Values.config.extraEnvVars "context" $)) }}
{{- . | nindent 12 }}
{{- end }}
{{- with (include "minio.envFrom" $) }}
envFrom:
{{- . | nindent 12 }}
{{- end }}
ports:
- name: minio
containerPort: {{ .Values.service.port }}
protocol: TCP
- name: console
containerPort: {{ .Values.service.consolePort }}
protocol: TCP
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /minio/health/live
port: minio
scheme: HTTP
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /minio/health/ready
port: minio
scheme: HTTP
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
{{- end }}
{{- if .Values.startupProbe.enabled }}
startupProbe:
httpGet:
path: /minio/health/live
port: minio
scheme: HTTP
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }}
successThreshold: {{ .Values.startupProbe.successThreshold }}
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
{{- end }}
{{- if .Values.resources }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- end }}
volumeMounts:
- name: data
mountPath: {{ .Values.persistence.mountPath }}
- name: tmp
mountPath: /tmp
{{- with (include "minio.extraVolumeMounts" (dict "local" (list) "context" $)) }}
{{- . | nindent 12 }}
{{- end }}
volumes:
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
{{- if .Values.persistence.existingClaim }}
claimName: {{ .Values.persistence.existingClaim }}
{{- else }}
claimName: {{ include "minio.fullname" . }}
{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
- name: tmp
emptyDir: {}
{{- with (include "minio.extraVolumes" (dict "local" (list) "context" $)) }}
{{- . | nindent 8 }}
{{- end }}
{{- with (include "minio.nodeSelector" (dict "local" .Values.nodeSelector "context" $)) }}
nodeSelector:
{{- . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (include "minio.tolerations" (dict "local" .Values.tolerations "context" $)) }}
tolerations:
{{- . | nindent 8 }}
{{- end }}