aws / aws/eks-charts

Add support for EKS ContainerD Runtime in CloudWatch Metrics charts

Open
#638 2 comments 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
Mustache
Stars
1.3k
Forks
1.1k
Avg merge
22m
Merged PRs (30d)
5

Description

The latest release of the aws-cloudwatch-metrics chart does not work on EKS when using the ContainerD runtime on EKS node groups. Need the ability to set the volumeMounts and volumes hostPath in the daemonset.yaml

https://github.com/aws/eks-charts/blob/v0.0.68/stable/aws-cloudwatch-metrics/templates/daemonset.yaml

More details on the issue here:
https://github.com/aws/amazon-cloudwatch-agent/issues/188
https://github.com/aws/amazon-cloudwatch-agent/issues/261

I cloned the charts and modified the daemonset.yaml to get it working for me. However, it'd be preferable if the Helm chart had a value to select what runtime is being used and set the volume paths accordingly.

```yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ include "aws-cloudwatch-metrics.fullname" . }}
labels:
{{- include "aws-cloudwatch-metrics.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "aws-cloudwatch-metrics.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "aws-cloudwatch-metrics.selectorLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "aws-cloudwatch-metrics.serviceAccountName" . }}
hostNetwork: {{ .Values.hostNetwork }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
# Please don't change below envs
env:
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: HOST_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CI_VERSION
value: "k8s/1.2.2"
#
# Below shows the ContainerD sock volume mount and host path
#
volumeMounts:
- name: cwagentconfig
mountPath: /etc/cwagentconfig
- name: rootfs
mountPath: /rootfs
readOnly: true
- name: dockersock
mountPath: /var/run/docker.sock
readOnly: true
- name: varlibdocker
mountPath: /var/lib/docker
readOnly: true
- name: containerdsock
mountPath: /run/containerd/containerd.sock
readOnly: true
- name: sys
mountPath: /sys
readOnly: true
- name: devdisk
mountPath: /dev/disk
readOnly: true
resources:
{{- toYaml .Values.resources | nindent 10 }}
volumes:
- name: cwagentconfig
configMap:
name: {{ include "aws-cloudwatch-metrics.fullname" . }}
- name: rootfs
hostPath:
path: /
- name: dockersock
hostPath:
path: /var/run/docker.sock
- name: varlibdocker
hostPath:
path: /var/lib/docker
- name: containerdsock
hostPath:
path: /run/dockershim.sock
- name: sys
hostPath:
path: /sys
- name: devdisk
hostPath:
path: /dev/disk/
terminationGracePeriodSeconds: 60
```

Contributor guide

Open the contributing guide

Research direction

Start with stable/aws-cloudwatch-metrics/templates/daemonset.yaml at the referenced chart version, then inspect the chart values and the linked CloudWatch Agent issues for the runtime-specific paths. Define how a runtime selection controls the ContainerD socket and related hostPath mounts, and verify that the rendered DaemonSet works for ContainerD while preserving existing Docker support.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, kubernetes
Domain
devops, infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.