diff --git a/charts/portworx/templates/portworx-ds.yaml b/charts/portworx/templates/portworx-ds.yaml index 33250c10a..f924e36d0 100644 --- a/charts/portworx/templates/portworx-ds.yaml +++ b/charts/portworx/templates/portworx-ds.yaml @@ -18,7 +18,8 @@ {{- $pksInstall := .Values.pksInstall | default false }} {{- $internalKVDB := .Values.internalKVDB | default false }} {{- $kvdbDevice := .Values.kvdbDevice | default "none" }} -{{- $csi := .Values.csi | default false }} +{{- $isK3s := not (.Capabilities.KubeVersion.GitVersion | toString | regexFind "(k3s|rke2)" | empty)}} +{{- $csi := .Values.csi | default $isK3s }} {{- $etcdCredentials := .Values.etcd.credentials | default "none:none" }} {{- $etcdCertPath := .Values.etcd.certPath | default "none" }} @@ -258,6 +259,10 @@ spec: {{- if not (eq $etcdCertPath "none") }} - mountPath: /etc/pwx/etcdcerts name: etcdcerts + {{- end }} + {{- if $isK3s }} + - name: containerd-k3s + mountPath: /run/containerd/containerd.sock {{- end }} - name: diagsdump mountPath: /var/cores @@ -348,8 +353,6 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName - securityContext: - privileged: true volumeMounts: - name: csi-driver-path mountPath: /csi @@ -358,6 +361,11 @@ spec: {{- end }} restartPolicy: Always + {{- if $isK3s }} + tolerations: + - key: node-role.kubernetes.io/master + effect: NoSchedule + {{- end }} serviceAccountName: px-account volumes: {{- if not (eq $etcdCertPath "none") }} @@ -376,6 +384,11 @@ spec: path: client-key.key {{- end -}} {{- end}} + {{- if $isK3s }} + - name: containerd-k3s + hostPath: + path: /run/k3s/containerd/containerd.sock + {{- end }} - name: diagsdump hostPath: path: {{if eq $pksInstall true }}/var/vcap/store/cores{{else}}/var/cores{{end}} @@ -507,7 +520,7 @@ spec: serviceAccountName: px-account {{- if eq $csi true }} --- -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 kind: CSIDriver metadata: name: "pxd.portworx.com"