forked from rucio/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.yaml
189 lines (188 loc) · 6.31 KB
/
deployment.yaml
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
apiVersion: v1
kind: Secret
metadata:
name: {{ template "rucio.fullname" . }}.config.yaml
labels:
app: {{ template "rucio.name" . }}
chart: {{ template "rucio.chart" . }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
type: Opaque
data:
{{- $common_config := .Values.config | default dict | mustToPrettyJson | b64enc }}
common.json: {{ $common_config | quote }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "rucio.fullname" . }}
labels:
app: {{ template "rucio.name" . }}
chart: {{ template "rucio.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "rucio.name" . }}
release: {{ .Release.Name }}
strategy:
type: {{ .Values.strategy.type }}
{{- if eq .Values.strategy.type "RollingUpdate" }}
{{- with .Values.strategy.rollingUpdate }}
rollingUpdate:
{{ toYaml . | trim | indent 6 }}
{{- end }}
{{- end }}
minReadySeconds: {{ .Values.minReadySeconds }}
template:
metadata:
labels:
app: {{ template "rucio.name" . }}
release: {{ .Release.Name }}
annotations:
checksum/config: {{ $common_config | sha1sum }}
spec:
{{- if .Values.serviceAccountName }}
serviceAccountName: {{ .Values.serviceAccountName }}
{{- end }}
volumes:
- name: config
secret:
secretName: {{ template "rucio.fullname" . }}.config.yaml
- name: aliases
configMap:
name: {{ template "rucio.fullname" . }}-aliases
- name: httpdlog
emptyDir: {}
{{- if .Values.useDeprecatedImplicitSecrets }}
{{- if eq .Values.service.useSSL true }}
- name: hostcert
secret:
secretName: {{ .Release.Name }}-hostcert
- name: hostkey
secret:
secretName: {{ .Release.Name }}-hostkey
- name: cafile
secret:
secretName: {{ .Release.Name }}-cafile
{{- end }}
{{- end }}
{{- range $key, $val := .Values.secretMounts }}
- name: {{ coalesce $val.volumeName $val.secretName $val.secretFullName }}
secret:
secretName: {{ coalesce $val.secretFullName (printf "%s-%s" $.Release.Name $val.secretName) }}
{{- end}}
{{- range $key, $val := .Values.persistentVolumes }}
- name: {{ $key }}
persistentVolumeClaim:
claimName: {{ $val.name }}
{{- end}}
containers:
{{- if .Values.exposeErrorLogs }}
- name: httpd-error-log
image: busybox
args: [/bin/sh, -c, 'tail -n+1 -F /var/log/httpd/error_log']
volumeMounts:
- name: httpdlog
mountPath: /var/log/httpd
{{- end }}
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
{{- if .Values.service.useSSL }}
- name: https
containerPort: 443
protocol: TCP
{{- end }}
volumeMounts:
- name: config
mountPath: /opt/rucio/etc/conf.d/10_common.json
subPath: common.json
- name: httpdlog
mountPath: /var/log/httpd
- name: aliases
mountPath: /opt/rucio/etc/aliases.conf
subPath: aliases.conf
{{- if .Values.useDeprecatedImplicitSecrets }}
{{- if .Values.service.useSSL }}
- name: hostcert
mountPath: /etc/grid-security/hostcert.pem
subPath: hostcert.pem
- name: hostkey
mountPath: /etc/grid-security/hostkey.pem
subPath: hostkey.pem
- name: cafile
mountPath: /etc/grid-security/ca.pem
subPath: ca.pem
{{- end}}
{{- end}}
{{- range $key, $val := .Values.secretMounts }}
- name: {{ coalesce $val.volumeName $val.secretName $val.secretFullName }}
mountPath: {{ $val.mountPath }}
subPath: {{ $val.subPath }}
{{- end}}
{{- range $key, $val := .Values.persistentVolumes }}
- name: {{ $key }}
mountPath: {{ $val.mountPath }}
{{- end}}
env:
{{- range $key, $val := .Values.httpd_config }}
- name: RUCIO_HTTPD_{{ $key | upper }}
valueFrom:
secretKeyRef:
name: {{ template "rucio.fullname" $ }}.cfg
key: {{ $key }}
{{- end}}
{{- range $key1, $val1 := .Values.optional_config }}
- name: {{ $key1 | upper }}
value: "{{ $val1 }}"
{{- end}}
- name: RUCIO_PROXY
value: {{ .Values.proxy.rucioProxy }}
- name: RUCIO_AUTH_PROXY
value: {{ .Values.proxy.rucioAuthProxy }}
{{- if .Values.proxy.rucioProxyScheme }}
- name: RUCIO_PROXY_SCHEME
value: {{ .Values.proxy.rucioProxyScheme }}
{{- end }}
{{- if .Values.proxy.rucioAuthProxyScheme }}
- name: RUCIO_AUTH_PROXY_SCHEME
value: {{ .Values.proxy.rucioAuthProxyScheme }}
{{- end }}
- name: RUCIO_HOSTNAME
value: {{ .Values.httpd_config.rucio_hostname }}
- name: RUCIO_OVERRIDE_CONFIGS
value: "/opt/rucio/etc/conf.d/"
- name: RUCIO_LOG_FORMAT
value: '[%{%Y-%m-%d %H:%M:%S}t]\t%v\t%h\t%{X-Forwarded-For}i\t%{X-Rucio-RequestId}i\t%>s\t%I\t%B\t%D\t\"%r\"\t\"%{X-Rucio-Auth-Token}i\"\t\"%{User-Agent}i\"\t%{X-Rucio-Script}i'
{{- if not .Values.service.useSSL }}
- name: RUCIO_ENABLE_SSL
value: "False"
{{- else }}
- name: RUCIO_ENABLE_SSL
value: "True"
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml . | indent 6 }}
{{- end}}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}