From c2b5de72064f292905f76cb7f27a8f08b1c2b7b3 Mon Sep 17 00:00:00 2001
From: Zach <unixbird@racky.systems>
Date: Fri, 18 Aug 2023 18:11:51 +0700
Subject: [PATCH] Update node-collector-container-metrics-ds.yaml and
 values.yml

* Added the containerd path if specified via the values.yml
* Adjusted the values.yml to allow customization of the containerd
  runtime path

Change-Id: I600776dbccbc5a97efbdce0db41d9efd78319912
---
 .../templates/node-collector-container-metrics-ds.yaml        | 3 +++
 deploy/charts/checkmk/values.yaml                             | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/deploy/charts/checkmk/templates/node-collector-container-metrics-ds.yaml b/deploy/charts/checkmk/templates/node-collector-container-metrics-ds.yaml
index e327d69..09bd1bc 100644
--- a/deploy/charts/checkmk/templates/node-collector-container-metrics-ds.yaml
+++ b/deploy/charts/checkmk/templates/node-collector-container-metrics-ds.yaml
@@ -63,6 +63,9 @@ spec:
           {{- with .Values.nodeCollector.cadvisor.additionalArgs }}
             {{ toYaml . | nindent 12 }}
           {{- end }}
+          {{- if .Values.containerdOverride }}
+            - --containerd={{ .Values.containerdOverride }}
+          {{- end }}
           resources:
             {{- toYaml .Values.nodeCollector.cadvisor.resources | nindent 12 }}
           ports:
diff --git a/deploy/charts/checkmk/values.yaml b/deploy/charts/checkmk/values.yaml
index 7dfd00a..fc4f1cd 100644
--- a/deploy/charts/checkmk/values.yaml
+++ b/deploy/charts/checkmk/values.yaml
@@ -6,6 +6,10 @@ nameOverride: ""
 fullnameOverride: ""
 kubeVersionOverride: ""
 
+## k3s and Rancher RKE2 host containerd in a different location.
+## If you are using one of them, or containerd is located in an alternate location, please uncomment / adapt the override.   
+#containerdOverride: "/run/k3s/containerd/containerd.sock"
+
 tlsCommunication:
   enabled: false
   verifySsl: false