Update rook-ceph kubernetes deployment
[infra/stack/kubernetes.git] / apps / ceph / kubespray / playbooks / roles / install / templates / toolbox.yaml.j2
1 apiVersion: apps/v1
2 kind: Deployment
3 metadata:
4   name: rook-ceph-tools
5   namespace: "{{ rook_namespace }}"
6   labels:
7     app: rook-ceph-tools
8 spec:
9   replicas: 1
10   selector:
11     matchLabels:
12       app: rook-ceph-tools
13   template:
14     metadata:
15       labels:
16         app: rook-ceph-tools
17     spec:
18       dnsPolicy: ClusterFirstWithHostNet
19       containers:
20       - name: rook-ceph-tools
21         image: "{{ rook_repository }}:{{ rook_version }}"
22         command: ["/tini"]
23         args: ["-g", "--", "/usr/local/bin/toolbox.sh"]
24         imagePullPolicy: IfNotPresent
25         env:
26           - name: ROOK_CEPH_USERNAME
27             valueFrom:
28               secretKeyRef:
29                 name: rook-ceph-mon
30                 key: ceph-username
31           - name: ROOK_CEPH_SECRET
32             valueFrom:
33               secretKeyRef:
34                 name: rook-ceph-mon
35                 key: ceph-secret
36         securityContext:
37           privileged: true
38         volumeMounts:
39           - mountPath: /etc/ceph
40             name: ceph-config
41           - mountPath: /dev
42             name: dev
43           - mountPath: /sys/bus
44             name: sysbus
45           - mountPath: /lib/modules
46             name: libmodules
47           - name: mon-endpoint-volume
48             mountPath: /etc/rook
49       # if hostNetwork: false, the "rbd map" command hangs, see https://github.com/rook/rook/issues/2021
50       hostNetwork: true
51       volumes:
52         - name: dev
53           hostPath:
54             path: /dev
55         - name: sysbus
56           hostPath:
57             path: /sys/bus
58         - name: libmodules
59           hostPath:
60             path: /lib/modules
61         - name: mon-endpoint-volume
62           configMap:
63             name: rook-ceph-mon-endpoints
64             items:
65             - key: data
66               path: mon-endpoints
67         - name: ceph-config
68           emptyDir: {}
69       tolerations:
70         - key: "node.kubernetes.io/unreachable"
71           operator: "Exists"
72           effect: "NoExecute"
73           tolerationSeconds: 5