summaryrefslogtreecommitdiffstats
path: root/sw_config/bmra/patched_cmk.yml
blob: e97083a6470befb6ef9bf739eeeab7975fac5b0a (plain)
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
{{- $fullName := include "cmk.fullname" . -}}
{{- $exclusiveMode := .Values.exclusiveMode -}}
{{- $numExclusiveCores := .Values.numExclusiveCores -}}
{{- $sharedMode := .Values.sharedMode -}}
{{- $numSharedCores := .Values.numSharedCores -}}
{{- $pullPolicy := .Values.image.pullPolicy -}}
{{- $image := .Values.image.repository -}}
{{- $tag := .Values.image.tag -}}
{{- $noTaint := .Values.noTaint }}
{{ range splitList "," .Values.hosts.list }}
---
apiVersion: batch/v1
kind: Job
metadata:
  annotations:
    helm.sh/hook: pre-install,pre-upgrade,pre-rollback
    helm.sh/hook-weight: "10"
  labels:
    app: {{ $fullName }}-init-discover-{{ . }}
  name: {{ $fullName }}-init-discover-{{ . }}
spec:
  template:
    spec:
      serviceAccountName: {{ $fullName }}
      restartPolicy: Never
      tolerations:
      - key: cmk
        operator: Exists
      containers:
        - name: install
          image: {{ $image }}:{{ $tag }}
          imagePullPolicy: {{ $pullPolicy }}
          command: ["/bin/bash", "-c"]
          args:
          - "/cmk/cmk.py install"
          volumeMounts:
          - mountPath: /opt/bin
            name: cmk-install-dir
        - name: init
          image: {{ $image }}:{{ $tag }}
          imagePullPolicy: {{ $pullPolicy }}
          env:
          - name: CMK_PROC_FS
            value: "/host/proc"
          - name: NODE_NAME
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: spec.nodeName
          command: ["/bin/bash", "-c"]
          args:
          - "/cmk/cmk.py init --exclusive-mode={{ $exclusiveMode }} --num-exclusive-cores={{ $numExclusiveCores }} --shared-mode={{ $sharedMode }} --num-shared-cores={{ $numSharedCores }}"
          volumeMounts:
          - mountPath: /host/proc
            name: host-proc
            readOnly: true
        - name: discover
          image: {{ $image }}:{{ $tag }}
          imagePullPolicy: {{ $pullPolicy }}
          env:
          - name: CMK_PROC_FS
            value: /host/proc
          - name: NODE_NAME
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: spec.nodeName
          command: ["/bin/bash", "-c"]
          args:
          - "/cmk/cmk.py discover {{ if $noTaint }}--no-taint{{ end }}"
          volumeMounts:
          - mountPath: /host/proc
            name: host-proc
            readOnly: true
      volumes:
      - hostPath:
          path: /proc
          type: Directory
        name: host-proc
      - hostPath:
          path: /opt/bin
          type: DirectoryOrCreate
        name: cmk-install-dir
{{ end }}