Updated deployment steps in documentation
[kuberef.git] / sw_config / bmra / patched_cmk.yml
1 {{- $fullName := include "cmk.fullname" . -}}
2 {{- $exclusiveMode := .Values.exclusiveMode -}}
3 {{- $numExclusiveCores := .Values.numExclusiveCores -}}
4 {{- $sharedMode := .Values.sharedMode -}}
5 {{- $numSharedCores := .Values.numSharedCores -}}
6 {{- $pullPolicy := .Values.image.pullPolicy -}}
7 {{- $image := .Values.image.repository -}}
8 {{- $tag := .Values.image.tag -}}
9 {{- $noTaint := .Values.noTaint }}
10 {{ range splitList "," .Values.hosts.list }}
11 ---
12 apiVersion: batch/v1
13 kind: Job
14 metadata:
15   annotations:
16     helm.sh/hook: pre-install,pre-upgrade,pre-rollback
17     helm.sh/hook-weight: "10"
18   labels:
19     app: {{ $fullName }}-init-discover-{{ . }}
20   name: {{ $fullName }}-init-discover-{{ . }}
21 spec:
22   template:
23     spec:
24       serviceAccountName: {{ $fullName }}
25       restartPolicy: Never
26       tolerations:
27       - key: cmk
28         operator: Exists
29       containers:
30         - name: install
31           image: {{ $image }}:{{ $tag }}
32           imagePullPolicy: {{ $pullPolicy }}
33           command: ["/bin/bash", "-c"]
34           args:
35           - "/cmk/cmk.py install"
36           volumeMounts:
37           - mountPath: /opt/bin
38             name: cmk-install-dir
39         - name: init
40           image: {{ $image }}:{{ $tag }}
41           imagePullPolicy: {{ $pullPolicy }}
42           env:
43           - name: CMK_PROC_FS
44             value: "/host/proc"
45           - name: NODE_NAME
46             valueFrom:
47               fieldRef:
48                 apiVersion: v1
49                 fieldPath: spec.nodeName
50           command: ["/bin/bash", "-c"]
51           args:
52           - "/cmk/cmk.py init --exclusive-mode={{ $exclusiveMode }} --num-exclusive-cores={{ $numExclusiveCores }} --shared-mode={{ $sharedMode }} --num-shared-cores={{ $numSharedCores }}"
53           volumeMounts:
54           - mountPath: /host/proc
55             name: host-proc
56             readOnly: true
57         - name: discover
58           image: {{ $image }}:{{ $tag }}
59           imagePullPolicy: {{ $pullPolicy }}
60           env:
61           - name: CMK_PROC_FS
62             value: /host/proc
63           - name: NODE_NAME
64             valueFrom:
65               fieldRef:
66                 apiVersion: v1
67                 fieldPath: spec.nodeName
68           command: ["/bin/bash", "-c"]
69           args:
70           - "/cmk/cmk.py discover {{ if $noTaint }}--no-taint{{ end }}"
71           volumeMounts:
72           - mountPath: /host/proc
73             name: host-proc
74             readOnly: true
75       volumes:
76       - hostPath:
77           path: /proc
78           type: Directory
79         name: host-proc
80       - hostPath:
81           path: /opt/bin
82           type: DirectoryOrCreate
83         name: cmk-install-dir
84 {{ end }}