Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for EKS ContainerD Runtime in CloudWatch Metrics charts #638

Open
fitchtech opened this issue Nov 12, 2021 · 2 comments · May be fixed by #1171
Open

Add support for EKS ContainerD Runtime in CloudWatch Metrics charts #638

fitchtech opened this issue Nov 12, 2021 · 2 comments · May be fixed by #1171
Labels
enhancement New feature or request

Comments

@fitchtech
Copy link

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:
aws/amazon-cloudwatch-agent#188
aws/amazon-cloudwatch-agent#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.

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
@fitchtech fitchtech added the enhancement New feature or request label Nov 12, 2021
@muellerk22
Copy link

@fitchtech , thanks for this as I ran into same issue.

@stv-io
Copy link

stv-io commented Apr 25, 2022

This seems to be fixed (or at least improved / supported) in #706

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants