-
Notifications
You must be signed in to change notification settings - Fork 29
/
daemonset-vrouter-agent-kernel.yaml
156 lines (156 loc) · 5.23 KB
/
daemonset-vrouter-agent-kernel.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
{{- if .Values.manifests.daemonset_kernel }}
{{- $_ := set .Values "images" .Values.global.images }}
{{- $context := . }}
# host_os is a mandatory field
{{- $_ := required ".Values.global.node.host_os must be specified, valid values are ubuntu, centos" .Values.global.node.host_os }}
{{- $host_os := .Values.global.node.host_os }}
---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: contrail-vrouter-agent-kernel
spec:
template:
metadata:
labels:
{{ tuple $context "opencontrail" "contrail-vrouter-agent-kernel" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
spec:
#Disable affinity for single node setup
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: {{ .Values.labels.vrouter_agent_kernel.node_selector_key }}
operator: In
values:
- {{ .Values.labels.vrouter_agent_kernel.node_selector_value }}
#Enable tolerations for single node setup
tolerations:
- key: node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
initContainers:
{{ tuple $context .Values.dependencies.vrouter_agent_kernel nil | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
{{- if eq $host_os "ubuntu"}}
- name: contrail-vrouter-init-kernel
image: {{ .Values.global.images.tags.build_driver_init | quote }}
imagePullPolicy: {{ default "" .Values.global.images.imagePullPolicy | quote }}
securityContext:
privileged: true
envFrom:
- configMapRef:
name: contrail-vrouter-kernel
- configMapRef:
name: contrail-vrouter-keystone
volumeMounts:
- mountPath: /usr/src
name: usr-src
- mountPath: /lib/modules
name: lib-modules
- mountPath: /host/bin
name: host-bin
{{- else if $host_os "centos" }}
- name: contrail-vrouter-init-kernel
image: {{ .Values.global.images.tags.vrouter_init_kernel | quote }}
imagePullPolicy: {{ default "" .Values.global.images.imagePullPolicy | quote }}
securityContext:
privileged: true
envFrom:
- configMapRef:
name: configmap-vrouter
- configMapRef:
name: contrail-vrouter-keystone
volumeMounts:
- mountPath: /etc/sysconfig/network-scripts
name: network-scripts
- mountPath: /host/bin
name: host-bin
{{- end }}
containers:
- name: contrail-vrouter-agent
image: {{ .Values.global.images.tags.vrouter_agent | quote }}
imagePullPolicy: {{ default "" .Values.global.images.imagePullPolicy | quote }}
securityContext:
privileged: true
envFrom:
- configMapRef:
name: contrail-vrouter-kernel
- configMapRef:
name: contrail-vrouter-keystone
volumeMounts:
{{- if eq $host_os "centos"}}
- mountPath: /etc/sysconfig/network-scripts
name: network-scripts
{{- end }}
- mountPath: /var/lib/contrail/
name: var-lib-contrail
- mountPath: /var/log/contrail/
name: contrail-log
- mountPath: /etc/contrail/
name: etc-contrail
- mountPath: /var/crashes
name: var-crashes-vrouter
- mountPath: /host/bin
name: host-bin
- name: contrail-vrouter-nodemgr
image: {{ .Values.global.images.tags.nodemgr | quote }}
imagePullPolicy: {{ default "" .Values.global.images.imagePullPolicy | quote }}
envFrom:
- configMapRef:
name: contrail-vrouter-kernel
- configMapRef:
name: contrail-vrouter-keystone
env:
- name: NODE_TYPE
value: vrouter
- name: DOCKER_HOST
value: "unix://mnt/docker.sock"
# todo: there is type Socket in new kubernetes, it is possible to use full
# path:
# hostPath:
# path: /var/run/docker.sock and
# type: Socket
volumeMounts:
- mountPath: /mnt
name: var-run
- mountPath: /var/log/contrail/
name: contrail-log
- mountPath: /etc/contrail/
name: etc-contrail
- mountPath: /var/crashes
name: var-crashes-vrouter
volumes:
{{- if eq $host_os "ubuntu"}}
- name: usr-src
hostPath:
path: /usr/src
- name: lib-modules
hostPath:
path: /lib/modules
{{- else if $host_os "centos" }}
- name: network-scripts
hostPath:
path: /etc/sysconfig/network-scripts
{{- end }}
- name: var-run
hostPath:
path: /var/run/
- name: var-lib-contrail
hostPath:
path: /var/lib/contrail/
- name: etc-contrail
hostPath:
path: /etc/contrail/vrouter/
- name: contrail-log
hostPath:
path: /var/log/contrail/vrouter/
- name: var-crashes-vrouter
hostPath:
path: /var/crashes/contrail/vrouter
- name: host-bin
hostPath:
path: /bin
{{- end }}