/
object-expirer-deployment.yaml
81 lines (79 loc) · 2.34 KB
/
object-expirer-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
kind: Deployment
apiVersion: apps/v1
metadata:
name: swift-object-expirer
labels:
release: "{{.Release.Name}}"
spec:
revisionHistoryLimit: 5
# this job is not in any critical path, so 1 replica and Recreate is quite enough
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: swift-object-expirer
template:
metadata:
labels:
component: swift-object-expirer
annotations:
{{- include "swift_conf_annotations" . | indent 8 }}
{{- include "swift_ring_annotations" . | indent 8 }}
spec:
volumes:
- name: swift-etc
configMap:
name: swift-etc
- name: swift-account-ring
configMap:
name: swift-account-ring
- name: swift-container-ring
configMap:
name: swift-container-ring
- name: swift-object-ring
configMap:
name: swift-object-ring
containers:
{{- range $i, $e := until (int .Values.object_expirer_processes) }}
- name: expirer-{{ $i }}
image: {{ include "swift_image" $ }}
command:
- /usr/bin/dumb-init
args:
- /bin/bash
- /usr/bin/swift-start
- object-expirer
- --process {{ $i }}
- --processes {{ $.Values.object_expirer_processes }}
env:
- name: DEBUG_CONTAINER
value: "false"
- name: HASH_PATH_PREFIX
valueFrom:
secretKeyRef:
name: swift-secret
key: hash_path_prefix
- name: HASH_PATH_SUFFIX
valueFrom:
secretKeyRef:
name: swift-secret
key: hash_path_suffix
resources:
# observed usage: CPU = 1m-300m, RAM = 50-180 MiB
requests:
cpu: '200m'
memory: '200Mi'
limits:
cpu: '400m'
memory: '400Mi'
volumeMounts:
- mountPath: /swift-etc
name: swift-etc
- mountPath: /swift-rings/account
name: swift-account-ring
- mountPath: /swift-rings/container
name: swift-container-ring
- mountPath: /swift-rings/object
name: swift-object-ring
{{- end }}