From 0178ed9b1df1e5a0714d196fb6190f7c2db8a97f Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Fri, 1 Nov 2024 20:27:40 +0800 Subject: [PATCH] feat: support custom containerd runtime path Signed-off-by: Qi Zhang --- templates/deployment.yaml | 14 +------------- templates/rbdcomponent_helm.yaml | 4 +--- values.yaml | 5 ++--- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 841fbac..202b831 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -30,17 +30,10 @@ spec: spec: serviceAccountName: {{ .Values.serviceAccount.name }} volumes: - {{- if .Values.useK3sContainerd }} - hostPath: - path: /var/run/k3s/containerd + path: {{ .Values.Cluster.containerdRuntimePath }} type: Directory name: rundir - {{- else }} - - hostPath: - path: /run - type: Directory - name: rundir - {{- end }} - hostPath: path: /var type: Directory @@ -82,11 +75,6 @@ spec: volumeMounts: - mountPath: /var name: vardir - {{- if .Values.useK3sContainerd }} - mountPath: /run/containerd name: rundir - {{- else }} - - mountPath: /run - name: rundir - {{- end }} terminationGracePeriodSeconds: 10 diff --git a/templates/rbdcomponent_helm.yaml b/templates/rbdcomponent_helm.yaml index 2cfe490..a93167d 100644 --- a/templates/rbdcomponent_helm.yaml +++ b/templates/rbdcomponent_helm.yaml @@ -128,16 +128,14 @@ items: name: rbd-chaos namespace: {{ .Release.Namespace }} spec: - {{- if .Values.useK3sContainerd }} volumeMounts: - name: containerdsock mountPath: /run/containerd volumes: - name: containerdsock hostPath: - path: /var/run/k3s/containerd + path: {{ .Values.Cluster.containerdRuntimePath }} type: Directory - {{- end }} image: {{ .Values.Cluster.rainbondImageRepository }}/rbd-chaos:{{ .Values.Cluster.installVersion }} imagePullPolicy: {{ .Values.Cluster.imagePullPolicy }} replicas: {{ .Values.Cluster.replicas }} diff --git a/values.yaml b/values.yaml index 34d8fcf..f1c3147 100644 --- a/values.yaml +++ b/values.yaml @@ -16,9 +16,6 @@ serviceAccount: name: rainbond-operator -# Use K3s Containerd -useK3sContainerd: false - # rainbondOperator operator: name: rainbond-operator @@ -82,6 +79,8 @@ Cluster: # Number of component copies replicas: 1 + # Define containerd runtime directory path, default: /run/containerd, if use k3s or RKE2, set to /var/run/k3s/containerd + containerdRuntimePath: /run/containerd ############################################