62
62
63
63
{{- $clusterName := .Values.clusterName | required ".Values.clusterName is required." -}}
64
64
{{- $region := .Values.region | required ".Values.region is required." -}}
65
-
65
+ {{- $isROSA := eq $.Values.k8sMode "ROSA" -}}
66
66
{{- range .Values.agents }}
67
67
{{- $agent := merge . (deepCopy $.Values.agent) }}
68
68
apiVersion : cloudwatch.aws.amazon.com/v1alpha1
77
77
nodeSelector :
78
78
kubernetes.io/os : linux
79
79
serviceAccount : {{ $agent.serviceAccount.name | default (include "cloudwatch-agent.serviceAccountName" $) }}
80
+ {{ if $isROSA }}
81
+ securityContext :
82
+ runAsNonRoot : false
83
+ capabilities :
84
+ add :
85
+ - SYS_ADMIN
86
+ {{ end }}
80
87
priorityClassName : {{ $agent.priorityClassName | default $.Values.agent.priorityClassName }}
81
88
affinity :
82
89
nodeAffinity :
94
101
config : {{ include "cloudwatch-agent.modify-config" (merge (dict "Config" $agent.defaultConfig) $ ) }}
95
102
{{- end }}
96
103
{{- if $agent.otelConfig }}
97
- otelConfig : {{ include "cloudwatch-agent.modify-yaml -config" (merge (dict "OtelConfig" $agent.otelConfig) . ) }}
104
+ otelConfig : {{ include "cloudwatch-agent.modify-otel -config" (merge (dict "OtelConfig" $agent.otelConfig) . ) }}
98
105
{{- end }}
99
106
{{- if $agent.prometheus.config }}
100
107
prometheus :
@@ -124,6 +131,12 @@ spec:
124
131
readOnly : true
125
132
- mountPath : /run/containerd/containerd.sock
126
133
name : containerdsock
134
+ - mountPath : /var/run/crio/crio.sock
135
+ name : criosock
136
+ - mountPath : /var/lib/containers
137
+ name : criocontainer
138
+ - mountPath : /var/log/pods
139
+ name : criologs
127
140
- mountPath : /var/lib/docker
128
141
name : varlibdocker
129
142
readOnly : true
@@ -147,6 +160,10 @@ spec:
147
160
readOnly : true
148
161
- mountPath : /var/lib/kubelet/pod-resources
149
162
name : kubelet-podresources
163
+ {{ if $isROSA }}
164
+ - mountPath : /etc/kubernetes/kubelet-ca.crt
165
+ name : kubelet-ca
166
+ {{ end }}
150
167
volumes :
151
168
- name : kubelet-podresources
152
169
hostPath :
@@ -164,6 +181,15 @@ spec:
164
181
- hostPath :
165
182
path : /run/containerd/containerd.sock
166
183
name : containerdsock
184
+ - hostPath :
185
+ path : /var/run/crio/crio.sock
186
+ name : criosock
187
+ - hostPath :
188
+ path : /var/lib/containers
189
+ name : criocontainer
190
+ - hostPath :
191
+ path : /var/log/pods
192
+ name : criologs
167
193
- hostPath :
168
194
path : /sys
169
195
name : sys
@@ -198,6 +224,11 @@ spec:
198
224
path : client.crt
199
225
- key : tls.key
200
226
path : client.key
227
+ {{ if $isROSA }}
228
+ - name : kubelet-ca
229
+ hostPath :
230
+ path : /etc/kubernetes/kubelet-ca.crt
231
+ {{end }}
201
232
env :
202
233
- name : K8S_NODE_NAME
203
234
valueFrom :
@@ -215,6 +246,12 @@ spec:
215
246
valueFrom :
216
247
fieldRef :
217
248
fieldPath : metadata.namespace
249
+ {{ if $isROSA }}
250
+ - name : RUN_IN_ROSA
251
+ value : " True"
252
+ {{ end }}
253
+ - name : K8S_CLUSTER_NAME
254
+ value : {{ $.Values.clusterName }}
218
255
{{- with $.Values.tolerations }}
219
256
tolerations : {{- toYaml . | nindent 2}}
220
257
{{- end }}
0 commit comments