Skip to content

Commit 31f2944

Browse files
rammanojrpotlaAshleyDumaine
authored
Template CCM chart to run it as remote container (#348)
* template updatestrategy and hostNetwork * template values to run ccm as remote container * comment logger * address feedback * add trailing new lines * change back log-verbosity to 2 * address feedback * fix linter * Update deploy/chart/templates/daemonset.yaml Co-authored-by: Ashley Dumaine <[email protected]> --------- Co-authored-by: rpotla <[email protected]> Co-authored-by: Ashley Dumaine <[email protected]>
1 parent f9a23e1 commit 31f2944

File tree

6 files changed

+68
-4
lines changed

6 files changed

+68
-4
lines changed

deploy/chart/templates/ccm-linode.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ stringData:
99
region: {{ required ".Values.region required" .Values.region }}
1010
type: Opaque
1111
{{- end }}
12-

deploy/chart/templates/clusterrole-rbac.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if ne .Values.rbacEnabled false }}
12
apiVersion: rbac.authorization.k8s.io/v1
23
kind: ClusterRole
34
metadata:
@@ -38,3 +39,4 @@ rules:
3839
resources: ["ciliumbgppeeringpolicies"]
3940
verbs: ["get", "watch", "list", "create"]
4041
{{- end }}
42+
{{- end }}

deploy/chart/templates/clusterrolebinding-rbac.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if ne .Values.rbacEnabled false }}
12
kind: ClusterRoleBinding
23
apiVersion: rbac.authorization.k8s.io/v1
34
metadata:
@@ -10,3 +11,4 @@ subjects:
1011
- kind: ServiceAccount
1112
name: ccm-linode
1213
namespace: {{ required ".Values.namespace required" .Values.namespace }}
14+
{{- end }}

deploy/chart/templates/daemonset.yaml

+21-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ spec:
99
selector:
1010
matchLabels:
1111
app: ccm-linode
12+
{{- with .Values.updateStrategy }}
13+
updateStrategy:
14+
{{- toYaml . | nindent 4 }}
15+
{{- end }}
1216
template:
1317
metadata:
1418
labels:
@@ -31,14 +35,14 @@ spec:
3135
tolerations:
3236
{{- toYaml . | nindent 8 }}
3337
{{- end }}
34-
hostNetwork: true
38+
hostNetwork: {{ default true .Values.enableHostNetwork }}
3539
containers:
3640
- image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
3741
imagePullPolicy: {{ .Values.image.pullPolicy }}
3842
name: ccm-linode
3943
args:
4044
- --leader-elect-resource-lock=leases
41-
- --v=3
45+
- --v={{ default 3 .Values.logVerbosity }}
4246
- --secure-port=10253
4347
- --webhook-secure-port=0
4448
{{- with .Values.linodegoDebug }}
@@ -106,10 +110,21 @@ spec:
106110
{{- if .Values.nodeBalancerBackendIPv4Subnet }}
107111
- --nodebalancer-backend-ipv4-subnet={{ .Values.nodeBalancerBackendIPv4Subnet }}
108112
{{- end }}
113+
{{- if .Values.extraArgs }}
114+
{{- toYaml .Values.extraArgs | nindent 12 }}
115+
{{- end }}
109116
{{- with .Values.containerSecurityContext }}
110117
securityContext:
111118
{{- toYaml . | nindent 12 }}
112119
{{- end }}
120+
{{- with .Values.readinessProbe }}
121+
readinessProbe:
122+
{{- toYaml . | nindent 12 }}
123+
{{- end }}
124+
{{- with .Values.livenessProbe }}
125+
livenessProbe:
126+
{{- toYaml . | nindent 12 }}
127+
{{- end }}
113128
{{- with .Values.resources }}
114129
resources:
115130
{{- toYaml . | nindent 12 }}
@@ -135,9 +150,13 @@ spec:
135150
{{- toYaml . | nindent 12 }}
136151
{{- end}}
137152
volumes:
153+
{{- with .Values.k8sVolume }}
154+
{{- toYaml . | nindent 8 }}
155+
{{- else }}
138156
- name: k8s
139157
hostPath:
140158
path: /etc/kubernetes
159+
{{- end }}
141160
{{- with .Values.volumes}}
142161
{{- toYaml . | nindent 8 }}
143162
{{- end}}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
{{- if ne .Values.rbacEnabled false }}
12
apiVersion: v1
23
kind: ServiceAccount
34
metadata:
45
name: ccm-linode
56
namespace: {{ required ".Values.namespace required" .Values.namespace }}
7+
{{- end }}

deploy/chart/values.yaml

+41-1
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,44 @@ resources:
124124
# cpu: "1000m"
125125

126126
# This flag allows to scrape /metrics endpoint without authorization
127-
allowUnauthorizedMetrics: false
127+
# allowUnauthorizedMetrics: false
128+
129+
# enables host network
130+
# enableHostNetwork: false
131+
132+
# specify the update strategy
133+
# updateStrategy:
134+
# type: RollingUpdate
135+
# rollingUpdate:
136+
# maxUnavailable: 25%
137+
138+
# log verbosity of the CCM
139+
# logVerbosity: 3
140+
141+
# set the liveness and readiness probes
142+
# livenessProbe:
143+
# tcpSocket:
144+
# port: 10253
145+
# initialDelaySeconds: 15
146+
# timeoutSeconds: 15
147+
# failureThreshold: 8
148+
149+
# readinessProbe:
150+
# tcpSocket:
151+
# port: 10253
152+
# initialDelaySeconds: 15
153+
# timeoutSeconds: 15
154+
# failureThreshold: 8
155+
156+
# set extra arguments to the CCM container.
157+
# extraArgs:
158+
# - --kubeconfig=/etc/kubernetes/value
159+
160+
# add toggle to rbac, useful when running CCM outside a cluster
161+
# rbacEnabled: true
162+
163+
# template kubeconfig volume
164+
# k8sVolume:
165+
# - name: k8s
166+
# hostPath:
167+
# path: /etc/kubeconfig

0 commit comments

Comments
 (0)