-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathdaemonset.yaml
More file actions
137 lines (137 loc) · 5.42 KB
/
daemonset.yaml
File metadata and controls
137 lines (137 loc) · 5.42 KB
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
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: ccm-linode
labels:
app: ccm-linode
namespace: {{ required ".Values.namespace required" .Values.namespace }}
spec:
selector:
matchLabels:
app: ccm-linode
template:
metadata:
labels:
app: ccm-linode
spec:
serviceAccountName: ccm-linode
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
hostNetwork: true
containers:
- image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
name: ccm-linode
args:
- --leader-elect-resource-lock=leases
- --v=3
- --secure-port=10253
- --webhook-secure-port=0
{{- with .Values.linodegoDebug }}
- --linodego-debug={{ . }}
{{- end }}
{{- $vpcNames := .Values.vpcNames }}
{{- if and .Values.routeController .Values.routeController.vpcNames }}
{{- $vpcNames = .Values.routeController.vpcNames }}
{{- end }}
{{- $vpcName := .Values.vpcName }}
{{- if and .Values.routeController .Values.routeController.vpcName }}
{{- $vpcName = .Values.routeController.vpcName }}
{{- end }}
{{- if and $vpcName $vpcNames }}
{{- fail "Both vpcName and vpcNames are set. Please use only vpcNames." }}
{{- end }}
{{- $subnetNames := .Values.subnetNames }}
{{- if and .Values.routeController .Values.routeController.subnetNames }}
{{- $subnetNames = .Values.routeController.subnetNames }}
{{- end }}
{{- if .Values.routeController }}
- --enable-route-controller=true
{{- if not (or $vpcName $vpcNames) }}
{{- fail "Neither vpcName nor vpcNames is set. Please set one of them." }}
{{- end }}
- --configure-cloud-routes={{ default true .Values.routeController.configureCloudRoutes }}
- --cluster-cidr={{ required "A valid .Values.routeController.clusterCIDR is required" .Values.routeController.clusterCIDR }}
{{- with .Values.routeController.routeReconciliationPeriod }}
- --route-reconciliation-period={{ . }}
{{- end }}
{{- end }}
{{- with $vpcNames }}
- --vpc-names={{ . }}
{{- end }}
{{- with $vpcName }}
- --vpc-name={{ . }}
{{- end }}
{{- with $subnetNames }}
- --subnet-names={{ . }}
{{ end }}
{{- if .Values.sharedIPLoadBalancing }}
{{- with .Values.sharedIPLoadBalancing.bgpNodeSelector }}
- --bgp-node-selector={{ . }}
{{- end }}
{{- with .Values.sharedIPLoadBalancing.ipHolderSuffix }}
- --ip-holder-suffix={{ . }}
{{- end}}
- --load-balancer-type={{ required "A valid .Values.sharedIPLoadBalancing.loadBalancerType is required for shared IP load-balancing" .Values.sharedIPLoadBalancing.loadBalancerType }}
{{- end }}
{{- with .Values.tokenHealthChecker }}
- --enable-token-health-checker={{ . }}
{{- end }}
{{- with .Values.nodeBalancerTags }}
- --nodebalancer-tags={{ join " " . }}
{{- end }}
{{- if .Values.allowUnauthorizedMetrics }}
- --authorization-always-allow-paths="/metrics"
{{- end }}
{{- if .Values.defaultNBType }}
- --default-nodebalancer-type={{ .Values.defaultNBType }}
{{- end }}
{{- with .Values.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /etc/kubernetes
name: k8s
{{- with .Values.volumeMounts}}
{{- toYaml . | nindent 12 }}
{{- end}}
env:
- name: LINODE_API_TOKEN
valueFrom:
secretKeyRef:
name: {{ if .Values.secretRef }}{{ .Values.secretRef.name | default "ccm-linode" }}{{ else }}"ccm-linode"{{ end }}
key: {{ if .Values.secretRef }}{{ .Values.secretRef.apiTokenRef | default "apiToken" }}{{ else }}"apiToken"{{ end }}
- name: LINODE_REGION
valueFrom:
secretKeyRef:
name: {{ if .Values.secretRef }}{{ .Values.secretRef.name | default "ccm-linode" }}{{ else }}"ccm-linode"{{ end }}
key: {{ if .Values.secretRef }}{{ .Values.secretRef.regionRef | default "region" }}{{ else }}"region"{{ end }}
{{- with .Values.env}}
{{- toYaml . | nindent 12 }}
{{- end}}
volumes:
- name: k8s
hostPath:
path: /etc/kubernetes
{{- with .Values.volumes}}
{{- toYaml . | nindent 8 }}
{{- end}}