From 01943f92f1e9bc4671ebb434255c0b66f45c5e17 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Thu, 16 Jun 2022 08:41:28 +0000 Subject: [PATCH] fix: fix run on arm64 Make nodeSelector configurable. Make CSI sidecar images repo and tag configurable. Use k8s offical repo as default, as it provides muti-arch images for Arm64. The verfied Arm64 override values are: image: repo: xin3liang nodeSelector: kubernetes.io/arch: arm64 mayastor: nodeSelector: kubernetes.io/arch: arm64 etcd: image: repository: xin3liang/bitnami-etcd tag: 3.5.1-debian-10-r67 replicaCount: 1 volumePermissions: image: repository: xin3liang/bitnami-shell loki-stack: enabled: false Signed-off-by: Xinliang Liu --- chart/README.md | 7 ++++++ .../agents/agent-core-deployment.yaml | 3 +++ .../mayastor/apis/api-rest-deployment.yaml | 3 +++ .../csi/csi-controller-deployment.yaml | 11 +++++---- .../mayastor/csi/csi-node-daemonset.yaml | 8 ++++--- .../operator-diskpool-deployment.yaml | 3 +++ chart/values.yaml | 23 +++++++++++++++++++ 7 files changed, 51 insertions(+), 7 deletions(-) diff --git a/chart/README.md b/chart/README.md index 90b34ca97..f96db9b04 100644 --- a/chart/README.md +++ b/chart/README.md @@ -41,6 +41,7 @@ helm install mayastor . -n | image.repo | image registry's namespace where all Mayastor images exist (default: mayadata) | mayadata | | image.tag | release tag for OpenEBS Mayastor images | develop | | image.pullPolicy | imagePullPolicy for all Mayastor images | Always | +| nodeSelector | Node labels for pod assignment | kubernetes.io/arch: amd64 | | base.default_req_timeout | request timeout for rest & core agents | 5s | | base.cache_poll_period | cache timeout for core agent & diskpool deployment | 30s | | base.initContainers.enabled | | true | @@ -75,6 +76,12 @@ helm install mayastor . -n | license.resources.limits.memory | memory limits for license component | "64Mi" | | license.resources.requests.cpu | cpu requests for license component | "50m" | | license.resources.requests.memory | memory requests for license component | "32Mi" | +| csi.image.registry | image registry to pull all CSI Sidecar images | k8s.gcr.io | +| csi.image.repo | image registry's namespace | sig-storage | +| csi.image.pullPolicy | imagePullPolicy for all CSI Sidecar images | IfNotPresent | +| csi.image.provisionerTag | csi-provisioner image release tag | v2.2.1 | +| csi.image.attacherTag | csi-attacher image release tag | v3.2.1 | +| csi.image.registrarTag | csi-node-driver-registrar image release tag | v2.1.0 | | csi.controller.logLevel | logLevel for the csi controller | info | | csi.controller.resources.limits.cpu | cpu limits for csi controller | "32m" | | csi.controller.resources.limits.memory | memory limits for csi controller | "128Mi" | diff --git a/chart/templates/mayastor/agents/agent-core-deployment.yaml b/chart/templates/mayastor/agents/agent-core-deployment.yaml index 48c8c54d7..04f68c5bc 100644 --- a/chart/templates/mayastor/agents/agent-core-deployment.yaml +++ b/chart/templates/mayastor/agents/agent-core-deployment.yaml @@ -20,6 +20,9 @@ spec: {{- include "base_pull_secrets" . }} initContainers: {{- include "base_init_core_containers" . }} + {{- if .Values.nodeSelector }} + nodeSelector: {{- toYaml .Values.nodeSelector | nindent 8 }} + {{- end }} containers: - name: agent-core resources: diff --git a/chart/templates/mayastor/apis/api-rest-deployment.yaml b/chart/templates/mayastor/apis/api-rest-deployment.yaml index 476b8c15c..5bbe77c68 100644 --- a/chart/templates/mayastor/apis/api-rest-deployment.yaml +++ b/chart/templates/mayastor/apis/api-rest-deployment.yaml @@ -19,6 +19,9 @@ spec: {{- include "base_pull_secrets" . }} initContainers: {{- include "base_init_containers" . }} + {{- if .Values.nodeSelector }} + nodeSelector: {{- toYaml .Values.nodeSelector | nindent 8 }} + {{- end }} containers: - name: api-rest resources: diff --git a/chart/templates/mayastor/csi/csi-controller-deployment.yaml b/chart/templates/mayastor/csi/csi-controller-deployment.yaml index 46f1eb5f5..9583909f0 100644 --- a/chart/templates/mayastor/csi/csi-controller-deployment.yaml +++ b/chart/templates/mayastor/csi/csi-controller-deployment.yaml @@ -23,9 +23,12 @@ spec: initContainers: {{- include "jaeger_agent_init_container" . }} {{- include "rest_agent_init_container" . }} + {{- if .Values.nodeSelector }} + nodeSelector: {{- toYaml .Values.nodeSelector | nindent 8 }} + {{- end }} containers: - name: csi-provisioner - image: k8s.gcr.io/sig-storage/csi-provisioner:v2.2.1 + image: "{{ .Values.csi.image.registry }}/{{ .Values.csi.image.repo }}/csi-provisioner:{{ .Values.csi.image.provisionerTag }}" args: - "--v=2" - "--csi-address=$(ADDRESS)" @@ -35,19 +38,19 @@ spec: env: - name: ADDRESS value: /var/lib/csi/sockets/pluginproxy/csi.sock - imagePullPolicy: "IfNotPresent" + imagePullPolicy: {{ .Values.csi.image.pullPolicy }} volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ - name: csi-attacher - image: k8s.gcr.io/sig-storage/csi-attacher:v3.2.1 + image: "{{ .Values.csi.image.registry }}/{{ .Values.csi.image.repo }}/csi-attacher:{{ .Values.csi.image.attacherTag }}" args: - "--v=2" - "--csi-address=$(ADDRESS)" env: - name: ADDRESS value: /var/lib/csi/sockets/pluginproxy/csi.sock - imagePullPolicy: "IfNotPresent" + imagePullPolicy: {{ .Values.csi.image.pullPolicy }} volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ diff --git a/chart/templates/mayastor/csi/csi-node-daemonset.yaml b/chart/templates/mayastor/csi/csi-node-daemonset.yaml index 081243b50..94c1b191a 100644 --- a/chart/templates/mayastor/csi/csi-node-daemonset.yaml +++ b/chart/templates/mayastor/csi/csi-node-daemonset.yaml @@ -23,8 +23,9 @@ spec: hostNetwork: true imagePullSecrets: {{- include "base_pull_secrets" . }} - nodeSelector: - kubernetes.io/arch: amd64 + {{- if .Values.nodeSelector }} + nodeSelector: {{- toYaml .Values.nodeSelector | nindent 8 }} + {{- end }} # NOTE: Each container must have mem/cpu limits defined in order to # belong to Guaranteed QoS class, hence can never get evicted in case of # pressure unless they exceed those limits. limits and requests must be @@ -78,7 +79,8 @@ spec: cpu: {{ .Values.csi.node.resources.requests.cpu | quote }} memory: {{ .Values.csi.node.resources.requests.memory | quote }} - name: csi-driver-registrar - image: quay.io/k8scsi/csi-node-driver-registrar:v2.1.0 + image: "{{ .Values.csi.image.registry }}/{{ .Values.csi.image.repo }}/csi-node-driver-registrar:{{ .Values.csi.image.registrarTag }}" + imagePullPolicy: {{ .Values.csi.image.pullPolicy }} args: - "--csi-address=/csi/csi.sock" - "--kubelet-registration-path={{ .Values.csi.node.kubeletDir }}/plugins/io.openebs.mayastor/csi.sock" diff --git a/chart/templates/mayastor/operators/operator-diskpool-deployment.yaml b/chart/templates/mayastor/operators/operator-diskpool-deployment.yaml index e81cf2428..82c4968ba 100644 --- a/chart/templates/mayastor/operators/operator-diskpool-deployment.yaml +++ b/chart/templates/mayastor/operators/operator-diskpool-deployment.yaml @@ -20,6 +20,9 @@ spec: {{- include "base_pull_secrets" . }} initContainers: {{- include "base_init_containers" . }} + {{- if .Values.nodeSelector }} + nodeSelector: {{- toYaml .Values.nodeSelector | nindent 8 }} + {{- end }} containers: - name: operator-diskpool resources: diff --git a/chart/values.yaml b/chart/values.yaml index 8637d5f14..e59a9e682 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -8,6 +8,13 @@ image: # imagePullPolicy for all Mayastor images pullPolicy: Always +# Node labels for pod assignment +# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ +# Note that if multi-arch images support 'kubernetes.io/arch: amd64' +# should be removed and set 'nodeSelector' to empty '{}' as default value. +nodeSelector: + kubernetes.io/arch: amd64 + base: # request timeout for rest & core agents default_req_timeout: 5s @@ -131,6 +138,20 @@ license: memory: "32Mi" csi: + image: + # image registry to pull all CSI Sidecar images + registry: k8s.gcr.io + # image registry's namespace + repo: sig-storage + # imagePullPolicy for all CSI Sidecar images + pullPolicy: IfNotPresent + # csi-provisioner image release tag + provisionerTag: v2.2.1 + # csi-attacher image release tag + attacherTag: v3.2.1 + # csi-node-driver-registrar image release tag + registrarTag: v2.1.0 + controller: # logLevel for the csi controller logLevel: info @@ -172,6 +193,8 @@ mayastor: # WARNING: Lowering metricsPollingInterval value will affect performance adversely metricsPollingInterval: "5m" # node selectors to designate mayastor nodes for diskpool creation + # Note that if multi-arch images support 'kubernetes.io/arch: amd64' + # should be removed. nodeSelector: openebs.io/engine: mayastor kubernetes.io/arch: amd64