diff --git a/charts/mayastor/.helmignore b/charts/mayastor/.helmignore new file mode 100644 index 00000000..b47f5974 --- /dev/null +++ b/charts/mayastor/.helmignore @@ -0,0 +1,25 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store + +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ + +# Common backup files +*.swp +*.bak +*.tmp +*~ + +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ \ No newline at end of file diff --git a/charts/mayastor/Chart.yaml b/charts/mayastor/Chart.yaml new file mode 100644 index 00000000..0daccc3d --- /dev/null +++ b/charts/mayastor/Chart.yaml @@ -0,0 +1,46 @@ +annotations: + category: Storage +apiVersion: v2 +appVersion: 1.0.2 +dependencies: + - name: common + repository: https://charts.bitnami.com/bitnami + tags: + - bitnami-common + version: 1.x.x + - name: etcd + condition: etcd.enabled + repository: https://charts.bitnami.com/bitnami + tags: + - bitnami-etcd + version: 8.x.x + - name: jaeger-operator + condition: jaeger.enabled + repository: https://jaegertracing.github.io/helm-charts + version: 2.32.2 + - name: loki-stack + condition: lokiStack.enabled + version: 2.6.5 + repository: https://grafana.github.io/helm-charts +description: Mayastor is a cloud-native declarative data plane written in Rust. + Our goal is to abstract storage resources and their differences through the data + plane such that users only need to supply the what and do not have to worry about + the how so that individual teams stay in control. +home: https://github.com/startechnica/apps/tree/main/charts/mayastor +icon: https://openebs.io/images/seo/openebs.png +keywords: + - mayastor + - openebs +maintainers: + - name: firmansyahn + email: firmansyah@nainggolan.id + url: https://firmansyah.nainggolan.id +name: mayastor +sources: + - https://github.com/openebs/mayastor + - https://github.com/openebs/mayastor-control-plane + - https://github.com/openebs/mayastor-api + - https://openebs.io/docs/concepts/mayastor + - https://mayastor.gitbook.io +type: application +version: 0.1.0 diff --git a/charts/mayastor/README.md b/charts/mayastor/README.md new file mode 100644 index 00000000..ddd52f3b --- /dev/null +++ b/charts/mayastor/README.md @@ -0,0 +1,108 @@ + + +# Helm chart for Mayastor + +Mayastor is a cloud-native declarative data plane written in Rust. The goal is to abstract storage resources and their differences through the data plane such that users only need to supply the what and do not have to worry about the how so that individual teams stay in control. + +Mayastor also try to be as unopinionated as possible. What this means is that we try to work with the existing storage systems you might already have and unify them as abstract resources instead of swapping them out whenever the resources are local or remote. + +[Overview of Mayastor](https://mayastor.gitbook.io) + +**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/startechnica/apps/issues/new/choose)** + +## TL;DR + +```bash +$ helm repo add startechnica https://startechnica.github.io/apps +$ helm install my-release startechnica/mayastor +``` + +## Prerequisites + +- Kubernetes 1.20+ +- Helm 3.2.0+ + +## Installing the Chart + +To install the chart with the release name `my-release` on `my-release` namespace: + +```bash +$ helm repo add startechnica https://startechnica.github.io/apps +$ helm install my-release startechnica/mayastor --namespace my-release --create-namespace +``` + +These commands deploy Mayastor on the Kubernetes cluster in the default configuration. + +> **Tip**: List all releases using `helm list -A` + +## Uninstalling the Chart + +To uninstall/delete the `my-release` deployment: + +```bash +$ helm delete my-release --namespace my-release +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Parameters + +### Global parameters + +| Name | Description | Value | +| ------------------------- | ----------------------------------------------- | ----- | +| `global.imageRegistry` | Global Docker image registry | `""` | +| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` | + +### Common parameters + +| Name | Description | Value | +| ------------------- | ------------------------------------------------------------------------------------------ | --------------- | +| `nameOverride` | String to partially override mayastor.fullname template (will maintain the release name) | `""` | +| `namespaceOverride` | | `""` | +| `fullnameOverride` | String to fully override mayastor.fullname template | `""` | +| `kubeVersion` | Force target Kubernetes version (using Helm capabilities if not set) | `""` | +| `clusterDomain` | Kubernetes Cluster Domain | `cluster.local` | +| `extraDeploy` | Extra objects to deploy (value evaluated as a template) | `[]` | +| `commonLabels` | Add labels to all the deployed resources | `{}` | +| `commonAnnotations` | Add annotations to all the deployed resources | `{}` | + +### I/O Engine Dataplane Deployment + +### CSI Node Deployment + +### CSI Controller Deployment + +### Agent Core Deployment + +### API Rest Deployment + +### ETCD Deployment + +### Setting Pod's affinity + +This chart allows you to set your custom affinity using the `affinity` parameter. Find more information about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity). + +### Deploying extra resources + +There are cases where you may want to deploy extra objects, such a ConfigMap containing your app's configuration or some extra deployment with a micro service used by your app. For covering this case, the chart allows adding the full specification of other objects using the `extraDeploy` parameter. + +## Troubleshooting + +Find more information about how to deal with common errors related to Startechnica's Helm charts in [this troubleshooting guide](https://startechnica.github.io/doc/troubleshoot-helm-chart-issues). + +## License + +Copyright © 2022 Startechnica + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/charts/mayastor/archive/CSIDriver.yaml b/charts/mayastor/archive/CSIDriver.yaml new file mode 100644 index 00000000..508cb26f --- /dev/null +++ b/charts/mayastor/archive/CSIDriver.yaml @@ -0,0 +1,9 @@ +{{- if .Values.csiDriver.create -}} +apiVersion: storage.k8s.io/v1 +kind: CSIDriver +metadata: + name: io.openebs.csi-mayastor +spec: + podInfoOnMount: {{ .Values.csiDriver.podInfoOnMount }} + attachRequired: {{ .Values.csiDriver.attachRequired }} +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/archive/DaemonSet.yaml b/charts/mayastor/archive/DaemonSet.yaml new file mode 100644 index 00000000..5cd7a408 --- /dev/null +++ b/charts/mayastor/archive/DaemonSet.yaml @@ -0,0 +1,140 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: {{ printf "%s" (include "common.names.fullname" .) }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + openebs.io/engine: io-engine + app.kubernetes.io/component: mayastor + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} +spec: + revisionHistoryLimit: 2 + selector: + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + app.kubernetes.io/component: mayastor + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 1 + minReadySeconds: 10 + template: + metadata: + {{- if .Values.podAnnotations }} + annotations: + {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} + {{- end }} + labels: {{- include "common.labels.standard" . | nindent 8 }} + app.kubernetes.io/component: mayastor + {{- if .Values.podLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} + {{- end }} + spec: + # To resolve services from mayastor's namespace + dnsPolicy: ClusterFirstWithHostNet + hostNetwork: true + {{- include "mayastor.imagePullSecrets" . | nindent 6 }} + {{- if .Values.nodeSelector }} + nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "mayastor.serviceAccountName" . }} + {{- if .Values.tolerations }} + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} + {{- end }} + {{- if .Values.topologySpreadConstraints }} + topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" .) | nindent 8 }} + {{- end }} + containers: + - name: mayastor + image: {{ include "mayastor.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy | quote }} + env: + - name: NVMF_TCP_MAX_QUEUE_DEPTH + value: "32" + - name: MY_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: RUST_LOG + value: info,mayastor={{ .Values.mayastorLogLevel }} + - name: RUST_BACKTRACE + value: full + {{- if .Values.diagnosticMode.enabled }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} + {{- else if .Values.command }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} + {{- else }} + command: + - mayastor + {{- end }} + {{- if .Values.diagnosticMode.enabled }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} + {{- else if .Values.args }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} + {{- else }} + args: + # The -l argument accepts cpu-list. Indexing starts at zero. + # For example -l 1,2,10-20 means use core 1, 2, 10 to 20. + # Note: Ensure that the CPU resources are updated accordingly. + # If you use 2 CPUs, the CPU: field should also read 2. + - "-N$(MY_NODE_NAME)" + - "-g$(MY_POD_IP)" + - "-y/var/local/mayastor/config.yaml" + - "-l{{ include "mayastorCpuSpec" . }}" + - "-pmayastor-etcd" + {{- end }} + securityContext: + privileged: true + resources: + # 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 the same. + limits: + cpu: "{{ .Values.mayastorCpuCount }}" + memory: "1Gi" + hugepages-2Mi: "{{ max .Values.mayastorHugePagesGiB 2 }}Gi" + requests: + cpu: "{{ .Values.mayastorCpuCount }}" + memory: "1Gi" + hugepages-2Mi: "{{ max .Values.mayastorHugePagesGiB 2 }}Gi" + ports: + - containerPort: 10124 + name: mayastor + protocol: TCP + volumeMounts: + - name: device + mountPath: /dev + - name: run-udev + mountPath: /run/udev + - name: dshm + mountPath: /dev/shm + - name: configlocation + mountPath: /var/local/mayastor/ + volumes: + - name: device + hostPath: + path: /dev + type: Directory + - name: run-udev + hostPath: + path: /run/udev + type: Directory + - name: dshm + emptyDir: + medium: Memory + sizeLimit: "1Gi" + - name: hugepage + emptyDir: + medium: HugePages + - name: configlocation + hostPath: + path: /var/local/mayastor/ + type: DirectoryOrCreate \ No newline at end of file diff --git a/charts/mayastor/archive/crds/MayastorPool.yaml b/charts/mayastor/archive/crds/MayastorPool.yaml new file mode 100644 index 00000000..93f59fb2 --- /dev/null +++ b/charts/mayastor/archive/crds/MayastorPool.yaml @@ -0,0 +1,142 @@ +--- +# Source: mayastor-control-plane/templates/mayastorpoolcrd.yaml +{ + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "name": "mayastorpools.openebs.io" + }, + "spec": { + "group": "openebs.io", + "names": { + "categories": [], + "kind": "MayastorPool", + "plural": "mayastorpools", + "shortNames": [ + "msp" + ], + "singular": "mayastorpool" + }, + "scope": "Namespaced", + "versions": [ + { + "additionalPrinterColumns": [ + { + "description": "node the pool is on", + "jsonPath": ".spec.node", + "name": "node", + "type": "string" + }, + { + "description": "pool status", + "jsonPath": ".status.state", + "name": "status", + "type": "string" + }, + { + "description": "total bytes", + "format": "int64", + "jsonPath": ".status.capacity", + "name": "capacity", + "type": "integer" + }, + { + "description": "used bytes", + "format": "int64", + "jsonPath": ".status.used", + "name": "used", + "type": "integer" + }, + { + "description": "available bytes", + "format": "int64", + "jsonPath": ".status.available", + "name": "available", + "type": "integer" + } + ], + "name": "v1alpha1", + "schema": { + "openAPIV3Schema": { + "description": "Auto-generated derived type for MayastorPoolSpec via `CustomResource`", + "properties": { + "spec": { + "description": "The pool spec which contains the parameters we use when creating the pool", + "properties": { + "disks": { + "description": "The disk device the pool is located on", + "items": { + "type": "string" + }, + "type": "array" + }, + "node": { + "description": "The node the pool is placed on", + "type": "string" + } + }, + "required": [ + "disks", + "node" + ], + "type": "object" + }, + "status": { + "description": "Status of the pool which is driven and changed by the controller loop", + "nullable": true, + "properties": { + "available": { + "description": "Available number of bytes", + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "capacity": { + "description": "Capacity as number of bytes", + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "state": { + "description": "The state of the pool", + "enum": [ + "Creating", + "Created", + "Online", + "Unknown", + "Error" + ], + "type": "string" + }, + "used": { + "description": "Used number of bytes", + "format": "uint64", + "minimum": 0.0, + "type": "integer" + } + }, + "required": [ + "available", + "capacity", + "state", + "used" + ], + "type": "object" + } + }, + "required": [ + "spec" + ], + "title": "MayastorPool", + "type": "object" + } + }, + "served": true, + "storage": true, + "subresources": { + "status": {} + } + } + ] + } +} \ No newline at end of file diff --git a/charts/mayastor/templates/ClusterRole.yaml b/charts/mayastor/templates/ClusterRole.yaml new file mode 100644 index 00000000..db39caa6 --- /dev/null +++ b/charts/mayastor/templates/ClusterRole.yaml @@ -0,0 +1,72 @@ +# Source: mayastor-control-plane/templates/operator-rbac.yaml + +{{- if and .Values.serviceAccount.create .Values.rbac.create }} +apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} +kind: ClusterRole +metadata: + name: {{ include "common.names.fullname" . }} +rules: + # must create mayastor crd if it doesn't exist +- apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["create", "list"] + + # must read diskpool info +- apiGroups: ["openebs.io"] + resources: ["diskpools"] + verbs: ["get", "list", "watch", "update", "replace", "patch"] + # must update diskpool status +- apiGroups: ["openebs.io"] + resources: ["diskpools/status"] + verbs: ["update", "patch"] + + # external provisioner & attacher +- apiGroups: [""] + resources: ["persistentvolumes"] + verbs: ["get", "list", "watch", "update", "create", "delete", "patch"] +- apiGroups: [""] + resources: ["nodes"] + verbs: ["get", "list", "watch"] + + # external provisioner +- apiGroups: [""] + resources: ["persistentvolumeclaims"] + verbs: ["get", "list", "watch", "update"] +- apiGroups: ["storage.k8s.io"] + resources: ["storageclasses"] + verbs: ["get", "list", "watch"] +- apiGroups: [""] + resources: ["events"] + verbs: ["list", "watch", "create", "update", "patch"] +- apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshots"] + verbs: ["get", "list"] +- apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshotcontents"] + verbs: ["get", "list"] +- apiGroups: [""] + resources: ["nodes"] + verbs: ["get", "list", "watch"] + + # external attacher +- apiGroups: ["storage.k8s.io"] + resources: ["volumeattachments"] + verbs: ["get", "list", "watch", "update", "patch"] +- apiGroups: ["storage.k8s.io"] + resources: ["volumeattachments/status"] + verbs: ["patch"] + + # CSI nodes must be listed +- apiGroups: ["storage.k8s.io"] + resources: ["csinodes"] + verbs: ["get", "list", "watch"] + + # get kube-system namespace to retrieve Uid +- apiGroups: [""] + resources: ["namespaces"] + verbs: ["get"] + +- apiGroups: ["monitoring.coreos.com"] + resources: ["servicemonitors"] + verbs: ["get", "create"] +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/ClusterRoleBinding.yaml b/charts/mayastor/templates/ClusterRoleBinding.yaml new file mode 100644 index 00000000..a972cab9 --- /dev/null +++ b/charts/mayastor/templates/ClusterRoleBinding.yaml @@ -0,0 +1,23 @@ +# Source: mayastor-control-plane/includes/operator-rbac.yaml + +{{- if and .Values.serviceAccount.create .Values.rbac.create }} +apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} +kind: ClusterRoleBinding +metadata: + name: {{ include "common.names.fullname" . }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +subjects: + - kind: ServiceAccount + name: {{ include "mayastor.serviceAccountName" . }} + namespace: {{ include "common.names.namespace" . | quote }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "common.names.fullname" . }} +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/DiskPool.yaml b/charts/mayastor/templates/DiskPool.yaml new file mode 100644 index 00000000..5d1e9eb9 --- /dev/null +++ b/charts/mayastor/templates/DiskPool.yaml @@ -0,0 +1,19 @@ +## ref: https://github.com/openebs/mayastor/blob/master/deploy/pool.yaml + +{{- if .Values.diskPools.create }} +{{- range .Values.diskPools.pools }} +apiVersion: "openebs.io/v1alpha1" +kind: DiskPool +metadata: + {{- if not (empty $.Values.diskPools.generateName) }} + generateName: {{ $.Values.diskPools.generateName }} + {{- else }} + name: pool-on-{{ .node }} + {{- end }} + namespace: {{ include "common.names.namespace" $ | quote }} +spec: + node: {{ .node }} + disks: ["{{ .device }}"] +--- +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/ServiceAccount.yaml b/charts/mayastor/templates/ServiceAccount.yaml new file mode 100644 index 00000000..f4927760 --- /dev/null +++ b/charts/mayastor/templates/ServiceAccount.yaml @@ -0,0 +1,21 @@ +{{- if .Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "mayastor.serviceAccountName" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }} + annotations: + {{- if .Values.commonAnnotations }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.serviceAccount.annotations }} + {{- include "common.tplvalues.render" (dict "value" .Values.serviceAccount.annotations "context" $) | nindent 4 }} + {{- end }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/StorageClass.yaml b/charts/mayastor/templates/StorageClass.yaml new file mode 100644 index 00000000..4a77036c --- /dev/null +++ b/charts/mayastor/templates/StorageClass.yaml @@ -0,0 +1,28 @@ +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: mayastor-1 +parameters: + repl: '1' + protocol: 'nvmf' + ioTimeout: '60' + local: 'false' + # It is recommended to use xfs for Mayastor + csi.storage.k8s.io/fstype: 'xfs' +provisioner: io.openebs.csi-mayastor +volumeBindingMode: WaitForFirstConsumer +--- +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: mayastor-3 +parameters: + repl: '3' + protocol: 'nvmf' + ioTimeout: '60' + local: 'false' + # It is recommended to use xfs for Mayastor + csi.storage.k8s.io/fstype: 'xfs' +provisioner: io.openebs.csi-mayastor +volumeBindingMode: WaitForFirstConsumer +--- \ No newline at end of file diff --git a/charts/mayastor/templates/_helper.tpl b/charts/mayastor/templates/_helper.tpl new file mode 100644 index 00000000..81345916 --- /dev/null +++ b/charts/mayastor/templates/_helper.tpl @@ -0,0 +1,153 @@ + +{{- define "mayastor.agentCore.fullname" -}} + {{- printf "%s-agent-core" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} +{{- end -}} + +{{- define "mayastor.apiRest.fullname" -}} + {{- printf "%s-api-rest" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} +{{- end -}} + +{{- define "mayastor.csiNode.fullname" -}} + {{- printf "%s-csi-node" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} +{{- end -}} + +{{- define "mayastor.csiController.fullname" -}} + {{- printf "%s-csi-controller" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} +{{- end -}} + +{{- define "mayastor.etcd.fullname" -}} + {{- printf "%s-etcd" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} +{{- end -}} + +{{- define "mayastor.jaeger.fullname" -}} + {{- printf "%s-jaeger" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} +{{- end -}} + +{{- define "mayastor.ioEngine.fullname" -}} + {{- printf "%s-io-engine" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} +{{- end -}} + +{{- define "mayastor.metrics.fullname" -}} + {{- printf "%s-metrics" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} +{{- end -}} + +{{- define "mayastor.operator.fullname" -}} + {{- printf "%s-operator" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} +{{- end -}} + +{{/* Create the name of the service account to use for the deployment */}} +{{- define "mayastor.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (printf "%s" (include "common.names.fullname" .)) .Values.serviceAccount.name | trunc 63 | trimSuffix "-" }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{- define "mayastor.csiNode.serviceAccountName" -}} +{{- if .Values.csiNode.serviceAccount.create -}} + {{ default (printf "%s" (include "mayastor.csiNode.fullname" .)) .Values.csiNode.serviceAccount.name | trunc 63 | trimSuffix "-" }} +{{- else -}} + {{ default "default" .Values.csiNode.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* Return the proper Mayastor image name */}} +{{- define "mayastor.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Mayastor Agent Core image name */}} +{{- define "mayastor.agentCore.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.agentCore.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Mayastor Rest image name */}} +{{- define "mayastor.apiRest.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.apiRest.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Mayastor CSI Controller image name */}} +{{- define "mayastor.csiController.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.csiController.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Mayastor CSI Controller Attacher image name */}} +{{- define "mayastor.csiController.attacher.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.csiController.attacher.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Mayastor CSI Controller Health Monitor image name */}} +{{- define "mayastor.csiController.healthMonitor.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.csiController.healthMonitor.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Mayastor CSI Controller Provisioner image name */}} +{{- define "mayastor.csiController.provisioner.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.csiController.provisioner.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Mayastor CSI Node image name */}} +{{- define "mayastor.csiNode.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.csiNode.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Mayastor CSI Node image name */}} +{{- define "mayastor.csiNode.driverRegistrar.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.csiNode.driverRegistrar.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Mayastor CSI Controller Livenessprobe image name */}} +{{- define "mayastor.csiNode.livenessprobe.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.csiNode.livenessprobe.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Mayastor I/O Engine image name */}} +{{- define "mayastor.ioEngine.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.ioEngine.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper image name (for the init container volume-permissions image) */}} +{{- define "mayastor.metrics.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.metrics.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Mayastor Operator image name */}} +{{- define "mayastor.operator.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.operator.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Mayastor Probe image name */}} +{{- define "mayastor.probe.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.probe.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper image name (for the init container volume-permissions image) */}} +{{- define "mayastor.volumePermissions.image" -}} + {{ include "common.images.image" (dict "imageRoot" .Values.volumePermissions.image "global" .Values.global) }} +{{- end -}} + +{{/* Return the proper Docker Image Registry Secret Names */}} +{{- define "mayastor.imagePullSecrets" -}} + {{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.volumePermissions.image) "global" .Values.global) -}} +{{- end -}} + +{{/* Generate CPU list specification based on CPU count (-l param of mayastor) */}} +{{- define "mayastor.cpuFlag" -}} +{{- range $i, $e := until (int .Values.ioEngine.cpuCount) }} +{{- if gt $i 0 }} + {{- printf "," }} +{{- end }} +{{- printf "%d" (add $i 1) }} +{{- end }} +{{- end }} + +{{/* Return the etcd hostname */}} +{{- define "mayastor.etcd.host" -}} + {{- ternary (include "mayastor.etcd.fullname" .) .Values.externalEtcd.host .Values.etcd.enabled -}} +{{- end -}} + +{{/* Return the etcd client port */}} +{{- define "mayastor.etcd.clientPort" -}} + {{- ternary .Values.etcd.service.ports.client .Values.externalEtcd.port .Values.etcd.enabled -}} +{{- end -}} \ No newline at end of file diff --git a/charts/mayastor/templates/agent-core/Deployment.yaml b/charts/mayastor/templates/agent-core/Deployment.yaml new file mode 100644 index 00000000..a53ec66a --- /dev/null +++ b/charts/mayastor/templates/agent-core/Deployment.yaml @@ -0,0 +1,104 @@ +## ref: https://raw.githubusercontent.com/openebs/mayastor-control-plane/master/deploy/agent-core-deployment.yaml + +{{- if .Values.agentCore.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "mayastor.agentCore.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: agent-core + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.replicaCount }} + revisionHistoryLimit: 2 + selector: + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + app.kubernetes.io/component: agent-core + template: + metadata: + {{- if .Values.podAnnotations }} + annotations: + {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} + {{- end }} + labels: {{- include "common.labels.standard" . | nindent 8 }} + app.kubernetes.io/component: agent-core + {{- if .Values.podLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} + {{- end }} + spec: + {{- if .Values.hostAliases }} + hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} + {{- end }} + {{- include "mayastor.imagePullSecrets" . | nindent 6 }} + serviceAccountName: {{ include "mayastor.serviceAccountName" . }} + {{- if .Values.tolerations }} + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} + {{- end }} + {{- if .Values.topologySpreadConstraints }} + topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" .) | nindent 8 }} + {{- end }} + initContainers: + - name: etcd-probe + image: {{ include "mayastor.probe.image" . }} + imagePullPolicy: {{ .Values.probe.image.pullPolicy }} + command: + - sh + - -c + - | + trap "exit 1" TERM + until nc -vzw 5 {{ include "mayastor.etcd.host" . }} {{ include "mayastor.etcd.clientPort" . }} + do + date + echo "Waiting for etcd..." + sleep 1; + done + containers: + - name: agent-core + image: {{ include "mayastor.agentCore.image" . }} + imagePullPolicy: {{ .Values.agentCore.image.pullPolicy | quote }} + {{- if .Values.diagnosticMode.enabled }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} + {{- else if .Values.command }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.diagnosticMode.enabled }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} + {{- else if .Values.args }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} + {{- else }} + args: + - "--store={{ include "mayastor.etcd.host" . }}:{{ include "mayastor.etcd.clientPort" . }}" + - "--request-timeout={{ .Values.agentCore.requestTimeout | default "5s" }}" + - "--cache-period=30s" + {{ if .Values.jaeger.enabled }} + - "--jaeger={{ .Values.jaeger.agent.name }}:{{ .Values.jaeger.agent.port }}" + {{ end }} + - "--grpc-server-addr=https://0.0.0.0:{{ .Values.agentCore.containerPorts.grpc }}" + {{- end }} + env: + - name: MY_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: MY_POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: RUST_BACKTRACE + value: {{ ternary "full" "1" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} + - name: RUST_LOG + value: {{ ternary "debug" (.Values.agentCore.logLevel) (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} + ports: + - name: grpc + containerPort: {{ .Values.agentCore.containerPorts.grpc }} + protocol: TCP + {{- if .Values.agentCore.resources }} + resources: {{ toYaml .Values.agentCore.resources | nindent 12 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/agent-core/Service.yaml b/charts/mayastor/templates/agent-core/Service.yaml new file mode 100644 index 00000000..7d3be058 --- /dev/null +++ b/charts/mayastor/templates/agent-core/Service.yaml @@ -0,0 +1,62 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mayastor.agentCore.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: agent-core + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if or .Values.service.annotations .Values.commonAnnotations }} + annotations: + {{- if .Values.commonAnnotations }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.service.annotations }} + {{- include "common.tplvalues.render" (dict "value" .Values.service.annotations "context" $) | nindent 4 }} + {{- end }} + {{- if and .Values.metrics.enabled .Values.metrics.annotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.annotations "context" $ ) | nindent 4 }} + {{- end }} + {{- end }} +spec: + type: {{ .Values.agentCore.service.type }} + {{- if and (eq .Values.agentCore.service.type "LoadBalancer") (not (empty .Values.service.allocateLoadBalancerNodePorts)) }} + allocateLoadBalancerNodePorts: {{ .Values.service.allocateLoadBalancerNodePorts }} + {{- end }} + {{- if and .Values.service.clusterIP (eq .Values.agentCore.service.type "ClusterIP") }} + clusterIP: {{ .Values.service.clusterIP }} + {{- end }} + {{- if and .Values.service.externalTrafficPolicy (or (eq .Values.agentCore.service.type "LoadBalancer") (eq .Values.agentCore.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }} + {{- if and (eq .Values.agentCore.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerClass)) }} + loadBalancerClass: {{ .Values.service.loadBalancerClass }} + {{- end }} + {{- if (and (eq .Values.agentCore.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} + {{- if and (eq .Values.agentCore.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerSourceRanges)) }} + loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} + {{- end }} + {{- if .Values.service.sessionAffinity }} + sessionAffinity: {{ .Values.service.sessionAffinity }} + {{- end }} + {{- if .Values.service.sessionAffinityConfig }} + sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.service.sessionAffinityConfig "context" $) | nindent 4 }} + {{- end }} + ports: + - name: grpc + port: {{ .Values.agentCore.service.ports.grpc }} + protocol: TCP + targetPort: {{ .Values.agentCore.containerPorts.grpc }} + {{- if (and (or (eq .Values.agentCore.service.type "NodePort") (eq .Values.agentCore.service.type "LoadBalancer")) .Values.agentCore.service.nodePorts.grpc) }} + nodePort: {{ coalesce .Values.agentCore.service.nodePorts.http .Values.agentCore.service.nodePort }} + {{- else if eq .Values.agentCore.service.type "ClusterIP" }} + nodePort: null + {{- end }} + selector: {{ include "common.labels.matchLabels" . | nindent 4 }} + app.kubernetes.io/component: agent-core +--- \ No newline at end of file diff --git a/charts/mayastor/templates/api-rest/Deployment.yaml b/charts/mayastor/templates/api-rest/Deployment.yaml new file mode 100644 index 00000000..9d8f16a8 --- /dev/null +++ b/charts/mayastor/templates/api-rest/Deployment.yaml @@ -0,0 +1,86 @@ +## ref: https://raw.githubusercontent.com/openebs/mayastor-control-plane/master/deploy/rest-deployment.yaml + +{{- if .Values.apiRest.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "mayastor.apiRest.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: api-rest + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.replicaCount }} + revisionHistoryLimit: 2 + selector: + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + app.kubernetes.io/component: api-rest + template: + metadata: + {{- if .Values.podAnnotations }} + annotations: + {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} + {{- end }} + labels: {{- include "common.labels.standard" . | nindent 8 }} + app.kubernetes.io/component: api-rest + {{- if .Values.podLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} + {{- end }} + spec: + {{- if .Values.hostAliases }} + hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} + {{- end }} + {{- include "mayastor.imagePullSecrets" . | nindent 6 }} + serviceAccountName: {{ include "mayastor.serviceAccountName" . }} + {{- if .Values.tolerations }} + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} + {{- end }} + {{- if .Values.topologySpreadConstraints }} + topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" .) | nindent 8 }} + {{- end }} + initContainers: + - name: etcd-probe + image: {{ include "mayastor.probe.image" . }} + imagePullPolicy: {{ .Values.probe.image.pullPolicy }} + command: + - sh + - -c + - | + trap "exit 1" TERM + until nc -vzw 5 {{ include "mayastor.etcd.host" . }} {{ include "mayastor.etcd.clientPort" . }} + do + date + echo "Waiting for etcd..." + sleep 1 + done + containers: + - name: api-rest + image: {{ include "mayastor.apiRest.image" . }} + imagePullPolicy: {{ .Values.apiRest.image.pullPolicy | quote }} + {{- if .Values.apiRest.resources }} + resources: {{ toYaml .Values.apiRest.resources | nindent 12 }} + {{- end }} + args: + - "--dummy-certificates" + - "--no-auth" + - "--http=0.0.0.0:{{ .Values.apiRest.containerPorts.https }}" + - "--request-timeout=5s" + - "--core-grpc=https://{{ include "mayastor.agentCore.fullname" . }}:{{ .Values.agentCore.service.ports.grpc }}" + env: + - name: RUST_BACKTRACE + value: {{ ternary "full" "1" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} + - name: RUST_LOG + value: {{ ternary "debug" (.Values.apiRest.logLevel) (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} + ports: + - name: http + containerPort: {{ .Values.apiRest.containerPorts.http }} + protocol: TCP + - name: https + containerPort: {{ .Values.apiRest.containerPorts.https }} + protocol: TCP +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/api-rest/Service.yaml b/charts/mayastor/templates/api-rest/Service.yaml new file mode 100644 index 00000000..767c7752 --- /dev/null +++ b/charts/mayastor/templates/api-rest/Service.yaml @@ -0,0 +1,73 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mayastor.apiRest.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: api-rest + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if or .Values.service.annotations .Values.commonAnnotations }} + annotations: + {{- if .Values.commonAnnotations }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.service.annotations }} + {{- include "common.tplvalues.render" (dict "value" .Values.service.annotations "context" $) | nindent 4 }} + {{- end }} + {{- if and .Values.metrics.enabled .Values.metrics.annotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.annotations "context" $ ) | nindent 4 }} + {{- end }} + {{- end }} +spec: + type: {{ .Values.apiRest.service.type }} + {{- if and (eq .Values.apiRest.service.type "LoadBalancer") (not (empty .Values.service.allocateLoadBalancerNodePorts)) }} + allocateLoadBalancerNodePorts: {{ .Values.service.allocateLoadBalancerNodePorts }} + {{- end }} + {{- if and .Values.service.clusterIP (eq .Values.apiRest.service.type "ClusterIP") }} + clusterIP: {{ .Values.service.clusterIP }} + {{- end }} + {{- if and .Values.service.externalTrafficPolicy (or (eq .Values.apiRest.service.type "LoadBalancer") (eq .Values.apiRest.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }} + {{- if and (eq .Values.apiRest.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerClass)) }} + loadBalancerClass: {{ .Values.service.loadBalancerClass }} + {{- end }} + {{- if (and (eq .Values.apiRest.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} + {{- if and (eq .Values.apiRest.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerSourceRanges)) }} + loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} + {{- end }} + {{- if .Values.service.sessionAffinity }} + sessionAffinity: {{ .Values.service.sessionAffinity }} + {{- end }} + {{- if .Values.service.sessionAffinityConfig }} + sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.service.sessionAffinityConfig "context" $) | nindent 4 }} + {{- end }} + ports: + - name: http + port: {{ .Values.apiRest.service.ports.http }} + protocol: TCP + targetPort: {{ .Values.apiRest.containerPorts.http }} + {{- if (and (or (eq .Values.apiRest.service.type "NodePort") (eq .Values.apiRest.service.type "LoadBalancer")) .Values.apiRest.service.nodePorts.http) }} + nodePort: {{ coalesce .Values.apiRest.service.nodePorts.http .Values.apiRest.service.nodePort }} + {{- else if eq .Values.apiRest.service.type "ClusterIP" }} + nodePort: null + {{- end }} + {{- if .Values.apiRest.tls.enabled }} + - name: https + port: {{ .Values.apiRest.service.ports.https }} + protocol: TCP + targetPort: {{ .Values.apiRest.containerPorts.https }} + {{- if (and (or (eq .Values.apiRest.service.type "NodePort") (eq .Values.apiRest.service.type "LoadBalancer")) .Values.apiRest.service.nodePorts.https) }} + nodePort: {{ .Values.apiRest.service.nodePorts.https }} + {{- else if eq .Values.apiRest.service.type "ClusterIP" }} + nodePort: null + {{- end }} + {{- end }} + selector: {{ include "common.labels.matchLabels" . | nindent 4 }} + app.kubernetes.io/component: api-rest +--- \ No newline at end of file diff --git a/charts/mayastor/templates/csi-controller/Deployment.yaml b/charts/mayastor/templates/csi-controller/Deployment.yaml new file mode 100644 index 00000000..2ff346b4 --- /dev/null +++ b/charts/mayastor/templates/csi-controller/Deployment.yaml @@ -0,0 +1,176 @@ +## ref: https://raw.githubusercontent.com/openebs/mayastor-control-plane/master/deploy/csi-deployment.yaml + +{{- if .Values.csiController.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "mayastor.csiController.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: csi-controller + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.replicaCount }} + revisionHistoryLimit: 2 + selector: + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + app.kubernetes.io/component: csi-controller + template: + metadata: + {{- if .Values.podAnnotations }} + annotations: + {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} + {{- end }} + labels: {{- include "common.labels.standard" . | nindent 8 }} + app.kubernetes.io/component: csi-controller + {{- if .Values.podLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} + {{- end }} + spec: + dnsPolicy: ClusterFirstWithHostNet + {{- if .Values.hostAliases }} + hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} + {{- end }} + hostNetwork: true + {{- include "mayastor.imagePullSecrets" . | nindent 6 }} + {{- if .Values.ioEngine.nodeSelector }} + nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.ioEngine.nodeSelector "context" $) | nindent 8 }} + {{- end }} + priorityClassName: {{ printf "%s-critical" (include "mayastor.csiController.fullname" .) }} + serviceAccountName: {{ include "mayastor.serviceAccountName" . }} + {{- if .Values.tolerations }} + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} + {{- end }} + {{- if .Values.topologySpreadConstraints }} + topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" .) | nindent 8 }} + {{- end }} + initContainers: + - name: api-rest-probe + image: {{ include "mayastor.probe.image" . }} + command: + - sh + args: + - -c + - | + trap "exit 1" TERM + until nc -vzw 5 {{ include "mayastor.apiRest.fullname" . }} {{ .Values.apiRest.service.ports.https }} + do + date + echo "$(date) Waiting for REST API endpoint to become available" + sleep 1 + done + containers: + - name: csi-provisioner + image: {{ include "mayastor.csiController.provisioner.image" . }} + imagePullPolicy: {{ .Values.csiController.image.pullPolicy | quote }} + args: + - "--csi-address=$(ADDRESS)" + - "--feature-gates=Topology=true" + - "--strict-topology=false" + - "--default-fstype=ext4" + - "--v=5" + {{- if .Values.csiController.attacher.metrics.enabled }} + - "--http-endpoint=:{{ .Values.csiController.attacher.containerPorts.metrics }}" + {{- end }} + env: + - name: ADDRESS + value: {{ .Values.csiController.csiSocketAddress | quote }} + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + ports: + - name: csi-provisioner + containerPort: {{ .Values.csiController.attacher.containerPorts.metrics }} + protocol: TCP + volumeMounts: + - name: socket-dir + mountPath: /var/lib/csi/sockets/pluginproxy/ + {{- if .Values.csiController.attacher.enabled }} + - name: csi-attacher + image: {{ include "mayastor.csiController.attacher.image" . }} + imagePullPolicy: {{ .Values.csiController.image.pullPolicy | quote }} + args: + - "--csi-address=$(ADDRESS)" + - "--v=5" + env: + - name: ADDRESS + value: {{ .Values.csiController.csiSocketAddress | quote }} + - name: RUST_BACKTRACE + {{- if .Values.diagnosticMode.enabled }} + value: full + {{- else }} + value: "1" + {{- end }} + - name: RUST_LOG + value: {{ .Values.csiController.logLevel }} + {{- if .Values.csiController.attacher.resources }} + resources: {{ toYaml .Values.csiController.attacher.resources | nindent 12 }} + {{- end }} + volumeMounts: + - name: socket-dir + mountPath: /var/lib/csi/sockets/pluginproxy/ + {{- end }} + {{- if .Values.csiController.healthMonitor.enabled }} + - name: csi-health-monitor + image: {{ include "mayastor.csiController.healthMonitor.image" . }} + imagePullPolicy: {{ .Values.csiController.healthMonitor.image.pullPolicy | quote }} + args: + - "--csi-address=$(ADDRESS)" + - "--v=5" + env: + - name: ADDRESS + value: {{ .Values.csiController.csiSocketAddress | quote }} + - name: RUST_BACKTRACE + {{- if .Values.diagnosticMode.enabled }} + value: full + {{- else }} + value: full + {{- end }} + - name: RUST_LOG + value: {{ .Values.csiController.logLevel }} + volumeMounts: + - name: socket-dir + mountPath: /var/lib/csi/sockets/pluginproxy/ + {{- end }} + - name: csi-controller + image: {{ include "mayastor.csiController.image" . }} + imagePullPolicy: {{ .Values.csiController.image.pullPolicy | quote }} + args: + - "--csi-socket=/var/lib/csi/sockets/pluginproxy/csi.sock" + - "--rest-endpoint=http://{{ include "mayastor.apiRest.fullname" . }}:{{ .Values.apiRest.service.ports.https }}" + {{- range $key, $val := .Values.ioEngine.nodeSelector }} + - "--io-engine-selector={{ $key }}:{{ $val }}" + {{- end }} + env: + - name: RUST_BACKTRACE + {{- if .Values.diagnosticMode.enabled }} + value: full + {{- else }} + value: full + {{- end }} + - name: RUST_LOG + value: {{ .Values.csiController.logLevel }} + {{- if .Values.csiController.resources }} + resources: {{ toYaml .Values.csiController.resources | nindent 12 }} + {{- end }} + volumeMounts: + - name: socket-dir + mountPath: /var/lib/csi/sockets/pluginproxy/ + volumes: + - name: socket-dir + emptyDir: {} +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/csi-controller/PriorityClass.yaml b/charts/mayastor/templates/csi-controller/PriorityClass.yaml new file mode 100644 index 00000000..65facbd4 --- /dev/null +++ b/charts/mayastor/templates/csi-controller/PriorityClass.yaml @@ -0,0 +1,15 @@ +apiVersion: scheduling.k8s.io/v1 +kind: PriorityClass +description: This priority class should be used for the Mayastor CSI Controller deployment only. +globalDefault: false +metadata: + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: csi-controller + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} + name: {{ printf "%s-critical" (include "mayastor.csiController.fullname" .) }} +value: 910001000 \ No newline at end of file diff --git a/charts/mayastor/templates/csi-node/ClusterRole.yaml b/charts/mayastor/templates/csi-node/ClusterRole.yaml new file mode 100644 index 00000000..e8113583 --- /dev/null +++ b/charts/mayastor/templates/csi-node/ClusterRole.yaml @@ -0,0 +1,81 @@ +{{- if and .Values.csiNode.serviceAccount.create .Values.csiNode.rbac.create }} +apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} +kind: ClusterRole +metadata: + name: {{ include "mayastor.csiNode.fullname" . }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} +rules: + # must create mayastor crd if it doesn't exist +- apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["create", "list"] + + # must read diskpool info +- apiGroups: ["openebs.io"] + resources: ["diskpools"] + verbs: ["get", "list", "watch", "update", "replace", "patch"] + # must update diskpool status +- apiGroups: ["openebs.io"] + resources: ["diskpools/status"] + verbs: ["update", "patch"] + + # external provisioner & attacher +- apiGroups: [""] + resources: ["persistentvolumes"] + verbs: ["get", "list", "watch", "update", "create", "delete", "patch"] +- apiGroups: [""] + resources: ["nodes"] + verbs: ["get", "list", "watch"] + + # external provisioner +- apiGroups: [""] + resources: ["persistentvolumeclaims"] + verbs: ["get", "list", "watch", "update"] +- apiGroups: ["storage.k8s.io"] + resources: ["storageclasses"] + verbs: ["get", "list", "watch"] +- apiGroups: [""] + resources: ["events"] + verbs: ["list", "watch", "create", "update", "patch"] +- apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshots"] + verbs: ["get", "list"] +- apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshotcontents"] + verbs: ["get", "list"] +- apiGroups: [""] + resources: ["nodes"] + verbs: ["get", "list", "watch"] + + # external attacher +- apiGroups: ["storage.k8s.io"] + resources: ["volumeattachments"] + verbs: ["get", "list", "watch", "update", "patch"] +- apiGroups: ["storage.k8s.io"] + resources: ["volumeattachments/status"] + verbs: ["patch"] + + # CSI nodes must be listed +- apiGroups: ["storage.k8s.io"] + resources: ["csinodes"] + verbs: ["get", "list", "watch"] + + # get kube-system namespace to retrieve Uid +- apiGroups: [""] + resources: ["namespaces"] + verbs: ["get"] + +- apiGroups: ["monitoring.coreos.com"] + resources: ["servicemonitors"] + verbs: ["get", "create"] + + {{- if .Values.csiNode.rbac.rules }} + {{- include "common.tplvalues.render" ( dict "value" .Values.csiNode.rbac.rules "context" $ ) | nindent 2 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/csi-node/ClusterRoleBinding.yaml b/charts/mayastor/templates/csi-node/ClusterRoleBinding.yaml new file mode 100644 index 00000000..5fd76865 --- /dev/null +++ b/charts/mayastor/templates/csi-node/ClusterRoleBinding.yaml @@ -0,0 +1,23 @@ +# Source: mayastor-control-plane/includes/operator-rbac.yaml + +{{- if and .Values.serviceAccount.create .Values.rbac.create }} +apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} +kind: ClusterRoleBinding +metadata: + name: {{ include "mayastor.csiNode.fullname" . }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +subjects: + - kind: ServiceAccount + name: {{ include "mayastor.csiNode.serviceAccountName" . }} + namespace: {{ include "common.names.namespace" . | quote }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "mayastor.csiNode.fullname" . }} +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/csi-node/DaemonSet.yaml b/charts/mayastor/templates/csi-node/DaemonSet.yaml new file mode 100644 index 00000000..674cb939 --- /dev/null +++ b/charts/mayastor/templates/csi-node/DaemonSet.yaml @@ -0,0 +1,202 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + + name: {{ include "mayastor.csiNode.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: csi-node + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} +spec: + revisionHistoryLimit: 2 + selector: + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + app.kubernetes.io/component: csi-node + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 1 + minReadySeconds: 10 + template: + metadata: + {{- if .Values.podAnnotations }} + annotations: + {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} + {{- end }} + labels: {{- include "common.labels.standard" . | nindent 8 }} + app.kubernetes.io/component: csi-node + {{- if .Values.podLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} + {{- end }} + spec: + {{- if .Values.hostAliases }} + hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} + {{- end }} + hostNetwork: true + {{- include "mayastor.imagePullSecrets" . | nindent 6 }} + {{- if .Values.csiNode.nodeSelector }} + nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.csiNode.nodeSelector "context" $) | nindent 8 }} + {{- end }} + priorityClassName: {{ printf "%s-critical" (include "mayastor.csiNode.fullname" .) }} + serviceAccountName: {{ include "mayastor.csiNode.serviceAccountName" . }} + {{- if .Values.csiNode.tolerations }} + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.csiNode.tolerations "context" .) | nindent 8 }} + {{- end }} + {{- if .Values.csiNode.topologySpreadConstraints }} + topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.csiNode.topologySpreadConstraints "context" .) | 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 + # the same. + containers: + - name: csi-plugin + image: {{ include "mayastor.csiNode.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy | quote }} + {{- if .Values.diagnosticMode.enabled }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} + {{- else if .Values.command }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} + {{- else }} + command: + - csi-node + {{- end }} + {{- if .Values.diagnosticMode.enabled }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} + {{- else if .Values.args }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} + {{- else }} + args: + - "--csi-socket=$(CSI_SOCKET_ADDRESS)" + - "--node-name=$(MY_NODE_NAME)" + - "--grpc-endpoint=$(MY_POD_IP):{{ .Values.csiNode.containerPorts.grpc }}" + {{- if .Values.csiNode.nvme.io_timeout_enabled }} + - "--nvme-core-io-timeout={{ .Values.csiNode.nvme.io_timeout }}" + {{- end }} + - "--nvme-nr-io-queues=2" + - "-v" + {{- end }} + {{- if .Values.csiNode.containerSecurityContext.enabled }} + securityContext: {{- omit .Values.csiNode.containerSecurityContext "enabled" | toYaml | nindent 12 }} + {{- end }} + env: + - name: CSI_SOCKET_ADDRESS + value: {{ .Values.csiNode.socketAddress | quote }} + - name: MY_NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: RUST_BACKTRACE + value: {{ ternary "full" "1" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} + - name: RUST_LOG + value: {{ ternary "debug" (.Values.csiNode.logLevel) (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} + ports: + - name: grpc + containerPort: {{ .Values.csiNode.containerPorts.grpc }} + protocol: TCP + {{- if .Values.csiNode.resources }} + resources: {{ toYaml .Values.csiNode.resources | nindent 12 }} + {{- end }} + volumeMounts: + - name: device + mountPath: /dev + - name: sys + mountPath: /sys + - name: run-udev + mountPath: /run/udev + - name: plugin-dir + mountPath: /csi + - name: kubelet-dir + mountPath: /var/lib/kubelet + mountPropagation: "Bidirectional" + - name: csi-driver-registrar + image: {{ include "mayastor.csiNode.driverRegistrar.image" . }} + imagePullPolicy: {{ .Values.csiNode.driverRegistrar.image.pullPolicy | quote }} + args: + - "--csi-address=$(CSI_SOCKET_ADDRESS)" + - "--kubelet-registration-path=/var/lib/kubelet/plugins/io.openebs.mayastor/csi.sock" + - "--http-endpoint=$(MY_POD_IP):{{ .Values.csiNode.driverRegistrar.containerPorts.http }}" + - "--v=5" + env: + - name: CSI_SOCKET_ADDRESS + value: {{ .Values.csiNode.socketAddress | quote }} + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + livenessProbe: + httpGet: + path: /healthz + port: {{ .Values.csiNode.livenessprobe.containerPorts.http }} + initialDelaySeconds: 5 + timeoutSeconds: 5 + ports: + - containerPort: {{ .Values.csiNode.driverRegistrar.containerPorts.http }} + name: healthz + protocol: TCP + {{- if .Values.csiNode.driverRegistrar.resources }} + resources: {{ toYaml .Values.csiNode.driverRegistrar.resources | nindent 12 }} + {{- end }} + volumeMounts: + - name: plugin-dir + mountPath: /csi + - name: registration-dir + mountPath: /registration + - name: liveness-probe + image: {{ include "mayastor.csiNode.livenessprobe.image" . }} + imagePullPolicy: {{ .Values.csiNode.livenessprobe.image.pullPolicy | quote }} + args: + - "--csi-address=$(CSI_SOCKET_ADDRESS)" + - "--http-endpoint=$(MY_POD_IP):{{ .Values.csiNode.livenessprobe.containerPorts.http }}" + env: + - name: CSI_SOCKET_ADDRESS + value: {{ .Values.csiNode.socketAddress | quote }} + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + {{- if .Values.csiNode.livenessprobe.resources }} + resources: {{ toYaml .Values.csiNode.livenessprobe.resources | nindent 12 }} + {{- end }} + volumeMounts: + - name: plugin-dir + mountPath: /csi + volumes: + - name: device + hostPath: + path: /dev + type: Directory + - name: sys + hostPath: + path: /sys + type: Directory + - name: run-udev + hostPath: + path: /run/udev + type: Directory + - name: registration-dir + hostPath: + path: /var/lib/kubelet/plugins_registry/ + type: Directory + - name: plugin-dir + hostPath: + path: /var/lib/kubelet/plugins/io.openebs.mayastor/ + type: DirectoryOrCreate + - name: kubelet-dir + hostPath: + path: /var/lib/kubelet + type: Directory \ No newline at end of file diff --git a/charts/mayastor/templates/csi-node/PriorityClass.yaml b/charts/mayastor/templates/csi-node/PriorityClass.yaml new file mode 100644 index 00000000..905ceb56 --- /dev/null +++ b/charts/mayastor/templates/csi-node/PriorityClass.yaml @@ -0,0 +1,15 @@ +apiVersion: scheduling.k8s.io/v1 +kind: PriorityClass +description: This priority class should be used for the Mayastor CSI driver node deployment only. +globalDefault: false +metadata: + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: csi-node + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} + name: {{ printf "%s-critical" (include "mayastor.csiNode.fullname" .) }} +value: 910000000 \ No newline at end of file diff --git a/charts/mayastor/templates/csi-node/ServiceAccount.yaml b/charts/mayastor/templates/csi-node/ServiceAccount.yaml new file mode 100644 index 00000000..ed72b8ac --- /dev/null +++ b/charts/mayastor/templates/csi-node/ServiceAccount.yaml @@ -0,0 +1,21 @@ +{{- if .Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "mayastor.csiNode.serviceAccountName" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if or .Values.csiNode.serviceAccount.annotations .Values.commonAnnotations }} + annotations: + {{- if .Values.commonAnnotations }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.csiNode.serviceAccount.annotations }} + {{- include "common.tplvalues.render" (dict "value" .Values.csiNode.serviceAccount.annotations "context" $) | nindent 4 }} + {{- end }} + {{- end }} +automountServiceAccountToken: {{ .Values.csiNode.serviceAccount.automountServiceAccountToken }} +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/io-engine/DaemonSet.yaml b/charts/mayastor/templates/io-engine/DaemonSet.yaml new file mode 100644 index 00000000..6d3c0664 --- /dev/null +++ b/charts/mayastor/templates/io-engine/DaemonSet.yaml @@ -0,0 +1,235 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: {{ include "mayastor.ioEngine.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: io-engine + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + app.kubernetes.io/component: io-engine + {{- if .Values.ioEngine.updateStrategy }} + updateStrategy: {{- toYaml .Values.ioEngine.updateStrategy | nindent 4 }} + {{- end }} + minReadySeconds: 10 + template: + metadata: + {{- if .Values.ioEngine.podAnnotations }} + annotations: + {{- include "common.tplvalues.render" (dict "value" .Values.ioEngine.podAnnotations "context" $) | nindent 8 }} + {{- end }} + labels: {{- include "common.labels.standard" . | nindent 8 }} + app.kubernetes.io/component: io-engine + openebs.io/logging: "true" + {{- if .Values.ioEngine.podLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.ioEngine.podLabels "context" $) | nindent 8 }} + {{- end }} + spec: + {{- if .Values.ioEngine.affinity }} + affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.ioEngine.affinity "context" $) | nindent 8 }} + {{- else }} + affinity: + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.ioEngine.podAffinityPreset "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.ioEngine.podAntiAffinityPreset "context" $) | nindent 10 }} + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.ioEngine.nodeAffinityPreset.type "key" .Values.ioEngine.nodeAffinityPreset.key "values" .Values.ioEngine.nodeAffinityPreset.values) | nindent 10 }} + {{- end }} + dnsPolicy: ClusterFirstWithHostNet + {{- if .Values.hostAliases }} + hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} + {{- end }} + hostNetwork: true + {{- include "mayastor.imagePullSecrets" . | nindent 6 }} + {{- if .Values.ioEngine.nodeSelector }} + nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.ioEngine.nodeSelector "context" $) | nindent 8 }} + {{- end }} + {{- if .Values.ioEngine.priorityClassName }} + priorityClassName: {{ .Values.ioEngine.priorityClassName | quote }} + {{- else if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName | quote }} + {{- else }} + priorityClassName: {{ printf "%s-critical" (include "mayastor.ioEngine.fullname" .) }} + {{- end }} + serviceAccountName: {{ include "mayastor.serviceAccountName" . }} + {{- if .Values.ioEngine.tolerations }} + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.ioEngine.tolerations "context" .) | nindent 8 }} + {{- end }} + {{- if .Values.ioEngine.topologySpreadConstraints }} + topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.ioEngine.topologySpreadConstraints "context" .) | nindent 8 }} + {{- end }} + initContainers: + - name: etcd-probe + image: {{ include "mayastor.probe.image" . }} + imagePullPolicy: {{ .Values.probe.image.pullPolicy }} + command: + - sh + - -c + - | + trap "exit 1" TERM + until nc -vzw 5 {{ include "mayastor.etcd.host" . }} {{ include "mayastor.etcd.clientPort" . }} + do + date + echo "Waiting for etcd..." + sleep 1 + done + - name: agent-core-probe + image: {{ include "mayastor.probe.image" . }} + imagePullPolicy: {{ .Values.probe.image.pullPolicy }} + command: + - sh + - -c + - | + trap "exit 1" TERM + until nc -vzw 5 {{ include "mayastor.agentCore.fullname" . }} {{ .Values.agentCore.service.ports.grpc }} + do + date + echo "Waiting for agent-core-grpc services..." + sleep 1 + done + {{- if .Values.initContainers }} + {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | trim | nindent 8 }} + {{- end }} + {{- if .Values.ioEngine.initContainers }} + {{- include "common.tplvalues.render" (dict "value" .Values.ioEngine.initContainers "context" $) | trim | nindent 8 }} + {{- end }} + containers: + - name: io-engine + image: {{ include "mayastor.ioEngine.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.diagnosticMode.enabled }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} + {{- else if .Values.command }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} + {{- else }} + command: + - io-engine + {{- end }} + {{- if .Values.diagnosticMode.enabled }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} + {{- else if .Values.args }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} + {{- else }} + args: + # The -l argument accepts cpu-list. Indexing starts at zero. + # For example -l 1,2,10-20 means use core 1, 2, 10 to 20. + # Note: Ensure that the CPU resources are updated accordingly. + # If you use 2 CPUs, the CPU: field should also read 2. + - "-g$(MY_POD_IP)" + {{- if .Values.ioEngine.cpuCount }} + - "-l{{ include "mayastor.cpuFlag" . | quote }}" + {{- end }} + - "-p{{ include "mayastor.etcd.host" . }}:{{ include "mayastor.etcd.clientPort" . }}" + - "-Rhttps://{{ include "mayastor.agentCore.fullname" . }}:{{ .Values.agentCore.service.ports.grpc }}" + - "-y/var/local/io-engine/config.yaml" + {{- end }} + env: + - name: MY_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: NVME_QPAIR_CONNECT_ASYNC + value: "true" + - name: NVMF_TCP_MAX_QUEUE_DEPTH + value: "32" + - name: RUST_BACKTRACE + value: {{ ternary "full" "1" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} + - name: RUST_LOG + value: debug,io_engine={{ ternary "debug" (.Values.ioEngine.logLevel) (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} + ports: + - name: io-engine + containerPort: {{ .Values.ioEngine.containerPorts.ioEngine }} + protocol: TCP + {{- if .Values.ioEngine.resources }} + resources: {{ toYaml .Values.ioEngine.resources | nindent 12 }} + {{- end }} + {{- if .Values.ioEngine.containerSecurityContext.enabled }} + securityContext: {{- omit .Values.ioEngine.containerSecurityContext "enabled" | toYaml | nindent 12 }} + {{- end }} + volumeMounts: + - name: device + mountPath: /dev + - name: udev + mountPath: /run/udev + - name: dshm + mountPath: /dev/shm + - name: configlocation + mountPath: /var/local/io-engine/ + - mountPath: /etc/podinfo + name: podinfo + {{- if .Values.extraVolumeMounts }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.ioEngine.extraVolumeMounts }} + {{- include "common.tplvalues.render" (dict "value" .Values.ioEngine.extraVolumeMounts "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.metrics.enabled }} + - name: metrics-exporter-pool + image: {{ .Values.metrics.image }} + imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} + command: + - metrics-exporter-pool + env: + - name: MY_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + ports: + - name: metrics + containerPort: {{ .Values.metrics.containerPorts.metrics }} + protocol: TCP + {{- if .Values.metrics.livenessProbe.enabled }} + livenessProbe: {{- omit .Values.metrics.livenessProbe "enabled" | toYaml | nindent 12 }} + httpGet: + path: /metrics + port: metrics + {{- end }} + {{- if .Values.metrics.readinessProbe.enabled }} + readinessProbe: {{- omit .Values.metrics.readinessProbe "enabled" | toYaml | nindent 12 }} + httpGet: + path: /metrics + port: metrics + {{- end }} + {{- if .Values.metrics.resources }} + resources: {{ toYaml .Values.metrics.resources | nindent 12 }} + {{- end }} + {{- end }} + {{- if .Values.ioEngine.sidecars }} + {{- include "common.tplvalues.render" ( dict "value" .Values.ioEngine.sidecars "context" $) | nindent 8 }} + {{- end }} + volumes: + - name: device + hostPath: + path: /dev + type: Directory + - name: udev + hostPath: + path: /run/udev + type: Directory + - name: dshm + emptyDir: + medium: Memory + sizeLimit: "1Gi" + - name: hugepage + emptyDir: + medium: HugePages + - name: configlocation + hostPath: + path: /var/local/io-engine/ + type: DirectoryOrCreate + {{- if .Values.ioEngine.extraVolumes }} + {{- include "common.tplvalues.render" (dict "value" .Values.ioEngine.extraVolumes "context" $) | nindent 8 }} + {{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/io-engine/PriorityClass.yaml b/charts/mayastor/templates/io-engine/PriorityClass.yaml new file mode 100644 index 00000000..92987332 --- /dev/null +++ b/charts/mayastor/templates/io-engine/PriorityClass.yaml @@ -0,0 +1,15 @@ +apiVersion: scheduling.k8s.io/v1 +kind: PriorityClass +description: This priority class should be used for the Mayastor CSI Dataplane deployment only. +globalDefault: false +metadata: + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: csi-node + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} + name: {{ printf "%s-critical" (include "mayastor.ioEngine.fullname" .) }} +value: 910002000 \ No newline at end of file diff --git a/charts/mayastor/templates/jaeger-operator/Jaeger.yaml b/charts/mayastor/templates/jaeger-operator/Jaeger.yaml new file mode 100644 index 00000000..d530bb39 --- /dev/null +++ b/charts/mayastor/templates/jaeger-operator/Jaeger.yaml @@ -0,0 +1,20 @@ +{{- if .Values.jaeger.enabled }} +apiVersion: jaegertracing.io/v1 +kind: Jaeger +metadata: + name: {{ include "mayastor.jaeger.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} +spec: + strategy: allInOne + ingress: + enabled: false + {{- include "jaeger_scheduling" . }} + query: + serviceType: NodePort + nodePort: 30012 + storage: + type: memory + options: + memory: + max-traces: 100000 +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/metrics/PrometheusRule.yaml b/charts/mayastor/templates/metrics/PrometheusRule.yaml new file mode 100644 index 00000000..085ad4b2 --- /dev/null +++ b/charts/mayastor/templates/metrics/PrometheusRule.yaml @@ -0,0 +1,26 @@ +{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ include "common.names.fullname" . }} + {{- if .Values.metrics.prometheusRule.namespace }} + namespace: {{ .Values.metrics.prometheusRule.namespace }} + {{- else }} + namespace: {{ include "common.names.namespace" . | quote }} + {{- end }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: metrics + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.metrics.prometheusRule.additionalLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + groups: + - name: {{ include "common.names.fullname" . }} + rules: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.rules "context" $ ) | nindent 6 }} +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/metrics/Service.yaml b/charts/mayastor/templates/metrics/Service.yaml new file mode 100644 index 00000000..8335c5d2 --- /dev/null +++ b/charts/mayastor/templates/metrics/Service.yaml @@ -0,0 +1,63 @@ +{{- if .Values.metrics.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mayastor.metrics.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: metrics + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if or .Values.service.annotations .Values.commonAnnotations }} + annotations: + {{- if .Values.commonAnnotations }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.service.annotations }} + {{- include "common.tplvalues.render" (dict "value" .Values.service.annotations "context" $) | nindent 4 }} + {{- end }} + {{- if and .Values.metrics.enabled .Values.metrics.annotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.annotations "context" $ ) | nindent 4 }} + {{- end }} + {{- end }} +spec: + type: {{ .Values.metrics.service.type }} + {{- if and (eq .Values.metrics.service.type "LoadBalancer") (not (empty .Values.service.allocateLoadBalancerNodePorts)) }} + allocateLoadBalancerNodePorts: {{ .Values.service.allocateLoadBalancerNodePorts }} + {{- end }} + {{- if and .Values.service.clusterIP (eq .Values.metrics.service.type "ClusterIP") }} + clusterIP: {{ .Values.service.clusterIP }} + {{- end }} + {{- if and .Values.service.externalTrafficPolicy (or (eq .Values.metrics.service.type "LoadBalancer") (eq .Values.metrics.service.type "NodePort")) }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} + {{- end }} + ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }} + {{- if and (eq .Values.metrics.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerClass)) }} + loadBalancerClass: {{ .Values.service.loadBalancerClass }} + {{- end }} + {{- if (and (eq .Values.metrics.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} + {{- if and (eq .Values.metrics.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerSourceRanges)) }} + loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} + {{- end }} + {{- if .Values.service.sessionAffinity }} + sessionAffinity: {{ .Values.service.sessionAffinity }} + {{- end }} + {{- if .Values.service.sessionAffinityConfig }} + sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.service.sessionAffinityConfig "context" $) | nindent 4 }} + {{- end }} + ports: + - name: tcp-metrics + port: {{ .Values.metrics.service.ports.metrics }} + protocol: TCP + targetPort: {{ .Values.metrics.containerPorts.metrics }} + {{- if (and (or (eq .Values.metrics.service.type "NodePort") (eq .Values.metrics.service.type "LoadBalancer")) .Values.metrics.service.nodePorts.metrics) }} + nodePort: {{ coalesce .Values.metrics.service.nodePorts.metrics .Values.metrics.service.nodePort }} + {{- else if eq .Values.metrics.service.type "ClusterIP" }} + nodePort: null + {{- end }} + selector: {{ include "common.labels.matchLabels" . | nindent 4 }} + app.kubernetes.io/component: metrics +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/metrics/ServiceMonitor.yaml b/charts/mayastor/templates/metrics/ServiceMonitor.yaml new file mode 100644 index 00000000..fc2f9ee4 --- /dev/null +++ b/charts/mayastor/templates/metrics/ServiceMonitor.yaml @@ -0,0 +1,49 @@ +{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ printf "%s-exporter" (include "common.names.fullname" .) }} + namespace: {{ default (include "common.names.namespace" .) .Values.metrics.serviceMonitor.namespace | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.labels }} + {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.labels "context" $) | nindent 4 }} + {{- end }} + app.kubernetes.io/component: metrics + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} +spec: + {{- if .Values.metrics.serviceMonitor.jobLabel }} + jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel }} + {{- end }} + selector: + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + {{- if .Values.metrics.serviceMonitor.selector }} + {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }} + {{- end }} + app.kubernetes.io/component: metrics + endpoints: + - port: http-metrics + path: /metrics + {{- if .Values.metrics.serviceMonitor.interval }} + interval: {{ .Values.metrics.serviceMonitor.interval }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.relabelings }} + relabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.relabelings "context" $) | nindent 6 }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.metricRelabelings }} + metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.metricRelabelings "context" $) | nindent 6 }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.honorLabels }} + honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} + {{- end }} + namespaceSelector: + matchNames: + - {{ include "common.names.namespace" . | quote }} +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/templates/operator/Deployment.yaml b/charts/mayastor/templates/operator/Deployment.yaml new file mode 100644 index 00000000..f9bc1b45 --- /dev/null +++ b/charts/mayastor/templates/operator/Deployment.yaml @@ -0,0 +1,87 @@ +##ref: https://raw.githubusercontent.com/openebs/mayastor-control-plane/master/deploy/msp-deployment.yaml + +{{- if .Values.operator.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "mayastor.operator.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: operator + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.replicaCount }} + revisionHistoryLimit: 1 + selector: + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + app.kubernetes.io/component: operator + template: + metadata: + {{- if .Values.podAnnotations }} + annotations: + {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} + {{- end }} + labels: {{- include "common.labels.standard" . | nindent 8 }} + app.kubernetes.io/component: operator + {{- if .Values.podLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} + {{- end }} + spec: + {{- if .Values.hostAliases }} + hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} + {{- end }} + {{- include "mayastor.imagePullSecrets" . | nindent 6 }} + serviceAccountName: {{ include "mayastor.serviceAccountName" . }} + {{- if .Values.tolerations }} + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} + {{- end }} + {{- if .Values.topologySpreadConstraints }} + topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" .) | nindent 8 }} + {{- end }} + initContainers: + - name: etcd-probe + image: busybox:latest + command: + - sh + - -c + - | + trap "exit 1" TERM + until nc -vzw 5 mayastor-etcd 2379 + do + date + echo "Waiting for etcd..." + sleep 1 + done + {{- if .Values.probe.resources }} + resources: {{ toYaml .Values.probe.resources | nindent 12 }} + {{- end }} + containers: + - name: operator + image: {{ include "mayastor.operator.image" . }} + imagePullPolicy: {{ .Values.operator.image.pullPolicy | quote }} + args: + - "-e http://{{ include "mayastor.apiRest.fullname" . }}:{{ .Values.apiRest.containerPorts.https }}" + - "-n={{ include "common.names.namespace" . }}" + - "--request-timeout={{ .Values.operator.requestTimeout | default "5s" }}" + - "--interval=30s" + {{ if .Values.jaeger.enabled }} + - "--jaeger={{ .Values.jaeger.agent.name }}:{{ .Values.jaeger.agent.port }}" + {{ end }} + env: + - name: MY_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: RUST_BACKTRACE + value: {{ ternary "full" "1" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} + - name: RUST_LOG + value: info,operator_diskpool={{ ternary "debug" (.Values.operator.logLevel) (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} + {{- if .Values.operator.resources }} + resources: {{ toYaml .Values.operator.resources | nindent 12 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/mayastor/values-test.yaml b/charts/mayastor/values-test.yaml new file mode 100644 index 00000000..1fb2e895 --- /dev/null +++ b/charts/mayastor/values-test.yaml @@ -0,0 +1,80 @@ + +clusterDomain: nebula.mci.net.id +diagnosticMode: + enabled: false + +tolerations: + - effect: NoSchedule + key: node-role.kubernetes.io/control-plane + operator: Exists + - effect: NoSchedule + key: node-role.kubernetes.io/master + operator: Exists + +csiNode: + tolerations: + - effect: NoSchedule + key: node-role.kubernetes.io/control-plane + operator: Exists + - effect: NoSchedule + key: node-role.kubernetes.io/master + operator: Exists + +etcd: + clusterDomain: nebula.mci.net.id + persistence: + enabled: true + storageClass: openebs-hostpath + +diskPools: + create: true + pools: + - node: alberta-lin-k8m.jkt2.mci.net.id + device: /dev/sdb + # - node: einbech-lin-k8m.jkt2.mci.net.id + # device: /dev/sdb + - node: lutie-lin-k8m.jkt2.mci.net.id + device: /dev/sdb + - node: rachel-lin-k8w.jkt2.mci.net.id + device: /dev/sda + # - node: verus-lin-k8w.jkt2.mci.net.id + # device: /dev/sdb + +ioEngine: + logLevel: debug + tolerations: + - effect: NoSchedule + key: node-role.kubernetes.io/control-plane + operator: Exists + - effect: NoSchedule + key: node-role.kubernetes.io/master + operator: Exists + extraVolumes: + - name: podinfo + downwardAPI: + items: + - path: "hugepages_2Mi_request" + resourceFieldRef: + containerName: io-engine + resource: requests.hugepages-2Mi + divisor: 1Mi + sidecars: + - name: debug-probe + image: busybox:latest + command: + - sh + - -c + - | + echo "$(REQUESTS_HUGEPAGES_2MI)" + ls -liah /etc/podinfo + cat /etc/podinfo/hugepages_2Mi_request + sleep inf + env: + - name: REQUESTS_HUGEPAGES_2MI + valueFrom: + resourceFieldRef: + containerName: io-engine + resource: requests.hugepages-2Mi + volumeMounts: + - mountPath: /etc/podinfo + name: podinfo \ No newline at end of file diff --git a/charts/mayastor/values.yaml b/charts/mayastor/values.yaml new file mode 100644 index 00000000..6074162a --- /dev/null +++ b/charts/mayastor/values.yaml @@ -0,0 +1,1616 @@ +## @section Global parameters +## Global Docker image parameters +## Please, note that this will override the image parameters, including dependencies, configured to use the global value +## Current available global Docker image parameters: imageRegistry, imagePullSecrets and storageClass + +## @param global.imageRegistry Global Docker image registry +## @param global.imagePullSecrets Global Docker registry secret names as an array +## @param global.storageClass Global StorageClass for Persistent Volume(s) +## +global: + imageRegistry: "" + ## E.g. + ## imagePullSecrets: + ## - myRegistryKeySecretName + ## + imagePullSecrets: [] + storageClass: "" + +## @section Common parameters + +## @param kubeVersion Force target Kubernetes version (using Helm capabilities if not set) +## +kubeVersion: "" +## @param nameOverride String to partially override Mayastor Control Plane Rest.fullname +## +nameOverride: "" +namespaceOverride: "" +## @param fullnameOverride String to fully override Mayastor Control Plane Rest.fullname +## +fullnameOverride: "" +## @param hostAliases Add deployment host aliases +## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ +## +hostAliases: [] +## @param commonLabels Labels to add to all deployed objects +## +commonLabels: {} +## @param commonAnnotations Annotations to add to all deployed objects +## +commonAnnotations: {} +## @param clusterDomain Default Kubernetes cluster domain +## +clusterDomain: cluster.local +## @param extraDeploy Array of extra objects to deploy with the release +## +extraDeploy: [] + +## Enable diagnostic mode in the deployment +## +diagnosticMode: + ## @param diagnosticMode.enabled Enable diagnostic mode (all probes will be disabled and the command will be overridden) + ## + enabled: false + ## @param diagnosticMode.command Command to override all containers in the deployment + ## + command: + - sleep + ## @param diagnosticMode.args Args to override all containers in the deployment + ## + args: + - infinity + +## @section Mayastor common parameters + +## Mayastor image +## ref: https://hub.docker.com/r/mayadata/mayastor/tags +## @param image.registry Mayastor Control Plane Rest image registry +## @param image.repository Mayastor Control Plane Rest image repository +## @param image.tag Mayastor Control Plane Rest image tag (immutable tags are recommended) +## @param image.pullPolicy Mayastor Control Plane Rest image pull policy +## @param image.pullSecrets Specify docker-registry secret names as an array +## @param image.debug Specify if debug logs should be enabled +## +image: + registry: docker.io + repository: mayastor-io-engine + tag: develop + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## Set to true if you would like to see extra information on logs + ## It turns BASH and/or NAMI debugging in the image + ## + debug: false + +## @section Mayastor Deployment parameters + +## @param replicaCount Desired number of cluster nodes +## +replicaCount: 1 +## @param updateStrategy.type updateStrategy for Mayastor Daemonset +## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies +## +updateStrategy: + type: RollingUpdate +## @param podLabels Extra labels for Mayastor pods +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +## +podLabels: {} +## @param podAnnotations Annotations for Mayastor pods +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} +## @param podAffinityPreset Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` +## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity +## +podAffinityPreset: "" +## @param podAntiAffinityPreset Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` +## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity +## +podAntiAffinityPreset: soft +## Node affinity preset +## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity +## +nodeAffinityPreset: + ## @param nodeAffinityPreset.type Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` + ## + type: "" + ## @param nodeAffinityPreset.key Node label key to match. Ignored if `affinity` is set. + ## E.g. + ## key: "kubernetes.io/e2e-az-name" + ## + key: "" + ## @param nodeAffinityPreset.values Node label values to match. Ignored if `affinity` is set. + ## E.g. + ## values: + ## - e2e-az1 + ## - e2e-az2 + ## + values: [] +## @param affinity Affinity for Mayastor pods assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set +## +affinity: {} +## @param nodeSelector Node labels for Mayastor pods assignment +## Ref: https://kubernetes.io/docs/user-guide/node-selection/ +## +nodeSelector: + openebs.io/engine: mayastor + kubernetes.io/arch: amd64 +## @param tolerations Tolerations for Mayastor pods assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +## +tolerations: [] +## @param topologySpreadConstraints Topology Spread Constraints for Mayastor pods assignment +## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ +## E.g. +## topologySpreadConstraints: +## - maxSkew: 1 +## topologyKey: topology.kubernetes.io/zone +## whenUnsatisfiable: DoNotSchedule +## +topologySpreadConstraints: {} + +## @param priorityClassName Priority class for Mayastor pods assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ +## +priorityClassName: "" +## @param schedulerName Name of the k8s scheduler (other than default) +## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ +## +schedulerName: "" +## @param podManagementPolicy podManagementPolicy to manage scaling operation of Mayastor pods +## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-management-policies +## +podManagementPolicy: "" + +## @section Persistence Parameters + +## Persistence Parameters +## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/ +## +persistence: + ## @param persistence.enabled Enable persistence on Mayastor replicas using a `PersistentVolumeClaim` + ## + enabled: false + ## @param persistence.existingClaim Name of an existing `PersistentVolumeClaim` for Mayastor primary replicas + ## NOTE: When it's set the rest of persistence parameters are ignored + ## + existingClaim: "" + ## @param persistence.subPath Subdirectory of the volume to mount at + ## + subPath: "" + ## @param persistence.storageClass Mayastor persistent volume storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + storageClass: "" + ## @param persistence.annotations Mayastor persistent volume claim annotations + ## + annotations: {} + ## @param persistence.accessModes Mayastor persistent volume access Modes + ## + accessModes: + - ReadWriteOnce + ## @param persistence.size Mayastor persistent volume size + ## + size: 8Gi + ## @param persistence.selector Selector to match an existing Persistent Volume + ## selector: + ## matchLabels: + ## app: my-app + ## + selector: {} +## 'volumePermissions' init container parameters +## Changes the owner and group of the persistent volume mount point to runAsUser:fsGroup values +## based on the podSecurityContext/containerSecurityContext parameters +## +volumePermissions: + ## @param volumePermissions.enabled Enable init container that changes the owner/group of the PV mount point to `runAsUser:fsGroup` + ## + enabled: false + ## Bitnami Shell image + ## ref: https://hub.docker.com/r/bitnami/bitnami-shell/tags/ + ## @param volumePermissions.image.registry Bitnami Shell image registry + ## @param volumePermissions.image.repository Bitnami Shell image repository + ## @param volumePermissions.image.tag Bitnami Shell image tag (immutable tags are recommended) + ## @param volumePermissions.image.pullPolicy Bitnami Shell image pull policy + ## @param volumePermissions.image.pullSecrets Bitnami Shell image pull secrets + ## + image: + registry: docker.io + repository: bitnami/bitnami-shell + tag: 11-debian-11-r0 + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## e.g: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## Init container's resource requests and limits + ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ + ## @param volumePermissions.resources.limits The resources limits for the init container + ## @param volumePermissions.resources.requests The requested resources for the init container + ## + resources: + limits: {} + requests: {} + ## Init container Container Security Context + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container + ## @param volumePermissions.securityContext.runAsUser Set init container's Security Context runAsUser + ## NOTE: when runAsUser is set to special value "auto", init container will try to chown the + ## data folder to auto-determined user&group, using commands: `id -u`:`id -G | cut -d" " -f2` + ## "auto" is especially useful for OpenShift which has scc with dynamic user ids (and 0 is not allowed) + ## + securityContext: + runAsUser: 0 +## @param extraVolumes Optionally specify extra list of additional volumes to the Mayastor pod(s) +## +extraVolumes: [] +## @param extraVolumeMounts Optionally specify extra list of additional volumeMounts for the Mayastor container(s) +## +extraVolumeMounts: [] +## @param initContainers Add additional init containers for the Mayastor pod(s) +## +initContainers: [] +## @param sidecars Add additional sidecar containers for the Mayastor pod(s) +## +sidecars: [] + +## @section Traffic Exposure Parameters + +## Mayastor service parameters +## +service: + ## @param service.type Mayastor Kubernetes service type + ## + type: ClusterIP + ## @param service.ports.auth Mayastor Kubernetes service port + ## + ports: + http: 1812 + https: 1813 + ## @param service.nodePorts.mysql Mayastor Kubernetes service node port + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + nodePorts: + http: "" + https: "" + ## @param service.clusterIP Mayastor Kubernetes service clusterIP IP + ## + clusterIP: "" + ## @param service.loadBalancerIP Mayastor loadBalancerIP if service type is `LoadBalancer` + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + loadBalancerIP: "" + ## @param service.ipFamilyPolicy Mayastor Kubernetes service ipFamilyPolicy policy + ## + ipFamilyPolicy: SingleStack + ## @param service.externalTrafficPolicy Enable client source IP preservation + ## ref https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster + ## @param service.allocateLoadBalancerNodePorts Allow users to disable node ports for Service Type=LoadBalancer. This is useful for + ## bare metal / on-prem environments that rely on VIP based LB implementations. + allocateLoadBalancerNodePorts: false + ## @param service.loadBalancerClass Enables to use a load balancer implementation other than the cloud provider default. + ## https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class + ## + loadBalancerClass: "" + ## @param service.loadBalancerSourceRanges Address that are allowed when Mayastor service is LoadBalancer + ## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service + ## E.g. + ## loadBalancerSourceRanges: + ## - 10.10.10.0/24 + ## + loadBalancerSourceRanges: [] + ## @param service.extraPorts Extra ports to expose (normally used with the `sidecar` value) + ## + extraPorts: [] + ## @param service.annotations Provide any additional annotations which may be required + ## + annotations: {} + ## @param service.sessionAffinity Session Affinity for Kubernetes service, can be "None" or "ClientIP" + ## If "ClientIP", consecutive client requests will be directed to the same Pod + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies + ## + sessionAffinity: None + ## @param service.sessionAffinityConfig Additional settings for the sessionAffinity + ## sessionAffinityConfig: + ## clientIP: + ## timeoutSeconds: 300 + sessionAffinityConfig: {} + +csiController: + enabled: true + logLevel: info + ## Mayastor CSI Controller image + ## ref: https://hub.docker.com/r/mayadata/mayastor/tags + ## @param image.registry Mayastor CSI Controller image registry + ## @param image.repository Mayastor CSI Controller image repository + ## @param image.tag Mayastor CSI Controller image tag (immutable tags are recommended) + ## @param image.pullPolicy Mayastor CSI Controller image pull policy + ## @param image.pullSecrets Specify docker-registry secret names as an array + ## @param image.debug Specify if debug logs should be enabled + ## + image: + registry: docker.io + repository: mayadata/mayastor-csi-controller + tag: develop + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## CSI controller resource requests and limits + ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ + ## @param controller.resources.limits The resources limits for CSI controller containers + ## @param controller.resources.requests The requested resources for CSI controller containers + ## + resources: + limits: + cpu: 32m + memory: 128Mi + requests: + cpu: 16m + memory: 64Mi + + ## @section Kubernetes CSI Driver Parameters + ## ref: https://kubernetes-csi.github.io/docs/introduction.html + + ## CSI external-attacher + ## ref: https://github.com/kubernetes-csi/external-attacher + ## + attacher: + enabled: true + image: + registry: k8s.gcr.io + repository: sig-storage/csi-attacher + tag: v3.5.0 + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## @param csiController.attacher.containerPorts.http Mayastor Agent Core GRPC container port + ## + containerPorts: + metrics: 9601 + ## CSI attacher resource requests and limits + ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ + ## @param csiController.attacher.resources.limits The resources limits for CSI attacher containers + ## @param csiController.attacher.resources.requests The requested resources for CSI attacher containers + ## + resources: + ## Example: + ## limits: + ## cpu: 100m + ## memory: 256Mi + ## + limits: {} + ## Examples: + ## requests: + ## cpu: 100m + ## memory: 256Mi + ## + requests: {} + metrics: + enabled: false + + ## CSI external-health-monitor-controller + ## ref: https://kubernetes-csi.github.io/docs/external-health-monitor-controller.html + ## + healthMonitor: + enabled: false + image: + registry: k8s.gcr.io + repository: sig-storage/csi-external-health-monitor-controller + tag: v0.5.0 + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + + ## CSI external-provisioner + ## ref: https://github.com/kubernetes-csi/external-provisioner + ## + provisioner: + image: + registry: k8s.gcr.io + repository: sig-storage/csi-provisioner + tag: v3.1.1 + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + + csiSocketAddress: "/var/lib/csi/sockets/pluginproxy/csi.sock" + +csiNode: + enabled: true + logLevel: info + ## Mayastor CSI Node image + ## ref: https://hub.docker.com/r/mayadata/mayastor-csi-node/tags + ## @param csiNode.image.registry Mayastor CSI Node image registry + ## @param csiNode.image.repository Mayastor CSI Node image repository + ## @param csiNode.image.tag Mayastor CSI Node image tag (immutable tags are recommended) + ## @param csiNode.image.pullPolicy Mayastor CSI Node image pull policy + ## @param csiNode.image.pullSecrets Specify docker-registry secret names as an array + ## @param csiNode.image.debug Specify if debug logs should be enabled + ## + image: + registry: docker.io + repository: mayadata/mayastor-csi-node + tag: develop + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## @param csiNode.containerPorts.http Mayastor Agent Core GRPC container port + ## + containerPorts: + grpc: 10199 + ## Configure Pods Security Context + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod + ## @param csiNode.podSecurityContext.enabled Enabled Mayastor I/O Engine pods' Security Context + ## @param csiNode.podSecurityContext.fsGroup Set Mayastor I/O Engine pod's Security Context fsGroup + ## + podSecurityContext: + enabled: false + fsGroup: 1001 + ## Configure Container Security Context + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container + ## @param csiNode.containerSecurityContext.enabled Enabled Mayastore CSI Plugin containers' Security Context + ## @param csiNode.containerSecurityContext.runAsUser Set Mayastore CSI Plugin containers' Security Context runAsUser + ## @param csiNode.containerSecurityContext.runAsNonRoot Set Mayastore CSI Plugin containers' Security Context runAsNonRoot + ## @param csiNode.containerSecurityContext.readOnlyRootFilesystem Set Mayastore CSI Plugin containers' Security Context runAsNonRoot + ## + containerSecurityContext: + enabled: true + privileged: true + ## Mayastor CSI Plugin container's resource requests and limits + ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ + ## @param csiNode..resources.limits The resources limits for MariaDB primary containers + ## @param csiNode..resources.requests The requested resources for MariaDB primary containers + ## + resources: + limits: + cpu: 100m + memory: 64Mi + requests: + cpu: 100m + memory: 64Mi + ## @param csiNode.affinity Affinity for CSI Plugin Engine pods assignment + ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity + ## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set + ## + affinity: {} + ## @param csiNode.nodeSelector Node labels for CSI Plugin Engine pods assignment + ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ + ## + nodeSelector: {} + ## @param csiNode.tolerations Tolerations for CSI Plugin Engine pods assignment + ## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + ## + tolerations: [] + ## @param csiNode.topologySpreadConstraints Topology Spread Constraints for CSI Plugin Engine pods assignment + ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ + ## E.g. + ## topologySpreadConstraints: + ## - maxSkew: 1 + ## topologyKey: topology.kubernetes.io/zone + ## whenUnsatisfiable: DoNotSchedule + ## + topologySpreadConstraints: {} + + ## CSI node-driver-registrar + ## ref: https://github.com/kubernetes-csi/node-driver-registrar + ## + driverRegistrar: + image: + # registry: quay.io + # repository: k8scsi/csi-node-driver-registrar + # tag: v2.1.0 + registry: k8s.gcr.io + repository: sig-storage/csi-node-driver-registrar + tag: v2.5.1 + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## @param csiNode.driverRegistrar.containerPorts.http Mayastor Agent Core GRPC container port + ## + containerPorts: + http: 9809 + ## CSI Driver Registrar resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## @param csiNode.driverRegistrar.resources.limits The resources limits for the Mayastor I/O Engine containers + ## @param csiNode.driverRegistrar.resources.requests The requested resources for the Mayastor I/O Engine containers + ## + resources: + limits: + cpu: 100m + memory: 64Mi + requests: + cpu: 100m + memory: 64Mi + + ## CSI livenessprobe + ## ref: https://github.com/kubernetes-csi/livenessprobe + ## + livenessprobe: + image: + # registry: quay.io + # repository: k8scsi/csi-node-driver-registrar + # tag: v2.1.0 + registry: k8s.gcr.io + repository: sig-storage/livenessprobe + tag: v2.7.0 + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## @param csiNode.livenessprobe.containerPorts.http Mayastor Agent Core GRPC container port + ## + containerPorts: + http: 9810 + ## CSI liveness Probe resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## @param csiNode.livenessprobe.resources.limits The resources limits for the Mayastor I/O Engine containers + ## @param csiNode.livenessprobe.resources.requests The requested resources for the Mayastor I/O Engine containers + ## + resources: + limits: + cpu: 100m + memory: 64Mi + requests: + cpu: 100m + memory: 64Mi + + nvme: + # nvme_core module io timeout in seconds + io_timeout: "30" + io_timeout_enabled: true + + socketAddress: /csi/csi.sock + + ## Specifies whether a ServiceAccount should be created + ## + serviceAccount: + ## @param csiNode.serviceAccount.create Enable the creation of a ServiceAccount for Mayastor Control Plane Rest pods + ## + create: true + ## @param csiNode.serviceAccount.name Name of the created ServiceAccount + ## If not set and create is true, a name is generated using the fullname template + ## + name: "" + ## @param csiNode.serviceAccount.automountServiceAccountToken Auto-mount the service account token in the pod + ## + automountServiceAccountToken: true + ## @param csiNode.serviceAccount.annotations Additional custom annotations for the ServiceAccount + ## + annotations: {} + ## Role Based Access + ## Ref: https://kubernetes.io/docs/admin/authorization/rbac/ + ## + rbac: + ## @param csiNode.rbac.create Specify whether RBAC resources should be created and used + ## + create: true + ## @param csiNode.rbac.rules Custom RBAC rules + ## Example: + ## rules: + ## - apiGroups: + ## - "" + ## resources: + ## - pods + ## verbs: + ## - get + ## - list + ## + rules: [] + +## @section etcd parameters +## +etcd: + ## @param etcd.enabled Enable etcd service + ## + enabled: true + ## @param etcd.clusterDomain Default Kubernetes cluster domain + ## + clusterDomain: cluster.local + ## Authentication parameters + ## + auth: + ## Role-based access control parameters + ## ref: https://etcd.io/docs/current/op-guide/authentication/ + ## + rbac: + ## @param etcd.auth.rbac.create Switch to enable RBAC authentication + ## + create: false + ## @param etcd.auth.rbac.allowNoneAuthentication Allow to use etcd without configuring RBAC authentication + ## + allowNoneAuthentication: true + ## @param etcd.auth.rbac.rootPassword Root user password. The root user is always `root` + ## + rootPassword: "" + ## @param etcd.auth.rbac.existingSecret Name of the existing secret containing credentials for the root user + ## + existingSecret: "" + ## @param etcd.auth.rbac.existingSecretPasswordKey Name of key containing password to be retrieved from the existing secret + ## + existingSecretPasswordKey: "" + ## Authentication token + ## ref: https://etcd.io/docs/latest/learning/design-auth-v3/#two-types-of-tokens-simple-and-jwt + ## + token: + ## @param etcd.auth.token.type Authentication token type. Allowed values: 'simple' or 'jwt' + ## ref: https://etcd.io/docs/latest/op-guide/configuration/#--auth-token + ## + type: simple + ## TLS authentication for client-to-server communications + ## ref: https://etcd.io/docs/current/op-guide/security/ + ## + client: + secureTransport: false + ## TLS authentication for server-to-server communications + ## ref: https://etcd.io/docs/current/op-guide/security/ + ## + peer: + secureTransport: false + ## @param etcd.initialClusterState Initial cluster state. Allowed values: 'new' or 'existing' + ## If this values is not set, the default values below are set: + ## - 'new': when installing the chart ('helm install ...') + ## - 'existing': when upgrading the chart ('helm upgrade ...') + ## + initialClusterState: "" + ## @param etcd.removeMemberOnContainerTermination Use a PreStop hook to remove the etcd members from the etcd cluster on container termination + ## they the containers are terminated + ## NOTE: Ignored if lifecycleHooks is set or replicaCount=1 + ## + removeMemberOnContainerTermination: false + ## @param etcd.replicaCount Number of etcd replicas to deploy + ## + replicaCount: 1 + ## @param etcd.podLabels [object] Extra labels for etcd pods + ## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + ## + podLabels: + app.kubernetes.io/component: etcd + ## Enable etcd.persistence using Persistent Volume Claims + ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ + ## + persistence: + ## If true, use a Persistent Volume Claim. If false, use emptyDir. + ## + enabled: false + ## Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + storageClass: "" + ## Persistent Volume size + ## + size: 2Gi + serviceAccount: + ## @param etcd.serviceAccount.create Enable/disable service account creation + ## + create: true + ## @param serviceAccount.name Name of the service account to create or use + ## + # name: {{ include "mayastor.serviceAccountName" $ }} + name: "" + ## Init containers parameters: + ## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section. + ## + volumePermissions: + enabled: true + ## Set to true if you would like to see extra information on logs + ## + debug: false + ## Pod anti-affinity preset + ## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity + ## Allowed values: soft, hard + ## + podAntiAffinityPreset: "hard" + + ## @section Traffic exposure parameters + ## + service: + port: 2379 + ## @param etcd.service.ports.client etcd client port + ## @param etcd.service.ports.peer etcd peer port + ## + ports: + client: 2379 + peer: 2380 + +externalEtcd: + host: "" + port: "" + +jaeger: + enabled: false + +lokiStack: + enabled: false + +nats: + enabled: false + ## Number of replicas + ## + replicaCount: 1 + ## Kubernetes Cluster Domain + ## + clusterDomain: cluster.local + podLabels: + app.kubernetes.io/component: nats + ## Enable persistence using Persistent Volume Claims + ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ + ## + persistence: + ## If true, use a Persistent Volume Claim. If false, use emptyDir. + ## + enabled: false + ## Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + storageClass: "" + ## Persistent Volume size + ## + size: 2Gi + serviceAccount: + ## @param serviceAccount.create Enable/disable service account creation + ## + create: false + ## @param serviceAccount.name Name of the service account to create or use + ## + # name: {{ include "mayastor.serviceAccountName" $ }} + name: mayastor + cluster: + enabled: false + auth: + enabled: false + exporter: + enabled: false + logging: + debug: false + trace: false + metrics: + enabled: false + +agentCore: + enabled: true + logLevel: debug + ## Mayastor Control Plane Core Agent image + ## ref: https://hub.docker.com/r/mayadata/mayastor/tags + ## @param image.registry Mayastor Control Plane Rest image registry + ## @param image.repository Mayastor Control Plane Rest image repository + ## @param image.tag Mayastor Control Plane Rest image tag (immutable tags are recommended) + ## @param image.pullPolicy Mayastor Control Plane Rest image pull policy + ## @param image.pullSecrets Specify docker-registry secret names as an array + ## @param image.debug Specify if debug logs should be enabled + ## + image: + registry: docker.io + repository: mayadata/mayastor-agent-core + tag: develop + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## @param agentCore.containerPorts.http Mayastor Agent Core GRPC container port + ## + containerPorts: + grpc: 50051 + ## Mayastor Agent Core resource requests and limits + ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ + ## @param agentCore.resources.limits The resources limits for Mayastor Agent Core containers + ## @param agentCore.resources.requests The requested resources for Mayastor Agent Core containers + ## + resources: + limits: + cpu: 1000m + memory: 32Mi + requests: + cpu: 500m + memory: 16Mi + service: + ## @param service.type Mayastor Control Plane Rest Kubernetes service type + ## + type: ClusterIP + ## @param service.ports.auth Mayastor Control Plane Rest Kubernetes service port + ## + ports: + grpc: 50051 + ## @param service.nodePorts.mysql Mayastor Control Plane Rest Kubernetes service node port + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + nodePorts: + grpc: "" + ## @param service.clusterIP Mayastor Control Plane Rest Kubernetes service clusterIP IP + ## + clusterIP: "" + ## @param service.loadBalancerIP Mayastor Control Plane Rest loadBalancerIP if service type is `LoadBalancer` + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + loadBalancerIP: "" + ## @param service.ipFamilyPolicy Mayastor Control Plane Rest Kubernetes service ipFamilyPolicy policy + ## + ipFamilyPolicy: SingleStack + ## @param service.externalTrafficPolicy Enable client source IP preservation + ## ref https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster + ## @param service.allocateLoadBalancerNodePorts Allow users to disable node ports for Service Type=LoadBalancer. This is useful for + ## bare metal / on-prem environments that rely on VIP based LB implementations. + allocateLoadBalancerNodePorts: false + ## @param service.loadBalancerClass Enables to use a load balancer implementation other than the cloud provider default. + ## https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class + ## + loadBalancerClass: "" + ## @param service.loadBalancerSourceRanges Address that are allowed when Mayastor Control Plane Rest service is LoadBalancer + ## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service + ## E.g. + ## loadBalancerSourceRanges: + ## - 10.10.10.0/24 + ## + loadBalancerSourceRanges: [] + ## @param service.extraPorts Extra ports to expose (normally used with the `sidecar` value) + ## + extraPorts: [] + ## @param service.annotations Provide any additional annotations which may be required + ## + annotations: {} + ## @param service.sessionAffinity Session Affinity for Kubernetes service, can be "None" or "ClientIP" + ## If "ClientIP", consecutive client requests will be directed to the same Pod + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies + ## + sessionAffinity: None + ## @param service.sessionAffinityConfig Additional settings for the sessionAffinity + ## sessionAffinityConfig: + ## clientIP: + ## timeoutSeconds: 300 + sessionAffinityConfig: {} + +apiRest: + enabled: true + logLevel: info + ## Mayastor Control Plane Rest image + ## ref: https://hub.docker.com/r/mayadata/mcp-rest/tags + ## @param image.registry Mayastor Control Plane Rest image registry + ## @param image.repository Mayastor Control Plane Rest image repository + ## @param image.tag Mayastor Control Plane Rest image tag (immutable tags are recommended) + ## @param image.pullPolicy Mayastor Control Plane Rest image pull policy + ## @param image.pullSecrets Specify docker-registry secret names as an array + ## @param image.debug Specify if debug logs should be enabled + ## + image: + registry: docker.io + repository: mayadata/mayastor-api-rest + tag: develop + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## @param mcpRest.containerPorts.http Mayastor Control Plane Rest HTTP container port + ## @param mcpRest.containerPorts.https Mayastor Control Plane Rest HTTPS container port + ## + containerPorts: + http: 8080 + https: 8081 + ## Mayastor API Rest resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## @param apiRest.resources.limits The resources limits for the Mayastor API Rest containers + ## @param apiRest.resources.requests The requested resources for the Mayastor API Rest containers + ## + resources: + limits: + cpu: 100m + memory: 64Mi + requests: + cpu: 50m + memory: 32Mi + tls: + enabled: true + ## Mayastor Control Plane Rest service parameters + ## + service: + ## @param service.type Mayastor Control Plane Rest Kubernetes service type + ## + type: ClusterIP + ## @param service.ports.auth Mayastor Control Plane Rest Kubernetes service port + ## + ports: + http: 8080 + https: 8081 + ## @param service.nodePorts.mysql Mayastor Control Plane Rest Kubernetes service node port + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + nodePorts: + http: "" + https: "" + ## @param service.clusterIP Mayastor Control Plane Rest Kubernetes service clusterIP IP + ## + clusterIP: "" + ## @param service.loadBalancerIP Mayastor Control Plane Rest loadBalancerIP if service type is `LoadBalancer` + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer + ## + loadBalancerIP: "" + ## @param service.ipFamilyPolicy Mayastor Control Plane Rest Kubernetes service ipFamilyPolicy policy + ## + ipFamilyPolicy: SingleStack + ## @param service.externalTrafficPolicy Enable client source IP preservation + ## ref https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster + ## @param service.allocateLoadBalancerNodePorts Allow users to disable node ports for Service Type=LoadBalancer. This is useful for + ## bare metal / on-prem environments that rely on VIP based LB implementations. + allocateLoadBalancerNodePorts: false + ## @param service.loadBalancerClass Enables to use a load balancer implementation other than the cloud provider default. + ## https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class + ## + loadBalancerClass: "" + ## @param service.loadBalancerSourceRanges Address that are allowed when Mayastor Control Plane Rest service is LoadBalancer + ## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service + ## E.g. + ## loadBalancerSourceRanges: + ## - 10.10.10.0/24 + ## + loadBalancerSourceRanges: [] + ## @param service.extraPorts Extra ports to expose (normally used with the `sidecar` value) + ## + extraPorts: [] + ## @param service.annotations Provide any additional annotations which may be required + ## + annotations: {} + ## @param service.sessionAffinity Session Affinity for Kubernetes service, can be "None" or "ClientIP" + ## If "ClientIP", consecutive client requests will be directed to the same Pod + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies + ## + sessionAffinity: None + ## @param service.sessionAffinityConfig Additional settings for the sessionAffinity + ## sessionAffinityConfig: + ## clientIP: + ## timeoutSeconds: 300 + sessionAffinityConfig: {} + + requestTimeout: 5s + +## @section Mayastor I/O Engine Dataplane parameters +## +ioEngine: + logLevel: info + cpuCount: "" + ## Mayastor I/O Engine image + ## ref: https://hub.docker.com/r/mayadata/mcp-msp-operator/tags + ## @param ioEngine.image.registry Mayastor Control Plane MSP Operator image registry + ## @param ioEngine.image.repository Mayastor Control Plane MSP Operator image repository + ## @param ioEngine.image.tag Mayastor Control Plane MSP Operator image tag (immutable tags are recommended) + ## @param ioEngine.image.pullPolicy Mayastor Control Plane MSP Operator image pull policy + ## @param ioEngine.image.pullSecrets Specify docker-registry secret names as an array + ## @param ioEngine.image.debug Specify if debug logs should be enabled + ## + image: + registry: docker.io + repository: mayadata/mayastor-io-engine + tag: develop + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## @param ioEngine.updateStrategy.type updateStrategy for Mayastor Daemonset + ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies + ## + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 1 + ## @param ioEngine.podLabels Extra labels for Mayastor pods + ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + ## + podLabels: {} + ## @param ioEngine.podAnnotations Annotations for Mayastor pods + ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + ## + podAnnotations: {} + ## @param ioEngine.podAffinityPreset Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` + ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity + ## + podAffinityPreset: "" + ## @param ioEngine.podAntiAffinityPreset Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` + ## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity + ## + podAntiAffinityPreset: "" + ## Node affinity preset + ## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity + ## + nodeAffinityPreset: + ## @param ioEngine.nodeAffinityPreset.type Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` + ## + type: "" + ## @param ioEngine.nodeAffinityPreset.key Node label key to match. Ignored if `affinity` is set. + ## E.g. + ## key: "kubernetes.io/e2e-az-name" + ## + key: "" + ## @param ioEngine.nodeAffinityPreset.values Node label values to match. Ignored if `affinity` is set. + ## E.g. + ## values: + ## - e2e-az1 + ## - e2e-az2 + ## + values: [] + ## @param ioEngine.affinity Affinity for Mayastor I/O Engine pods assignment + ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity + ## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set + ## + affinity: {} + ## @param ioEngine.nodeSelector Node labels for Mayastor I/O Engine pods assignment + ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ + ## + nodeSelector: + openebs.io/engine: mayastor + kubernetes.io/arch: amd64 + ## @param ioEngine.tolerations Tolerations for Mayastor I/O Engine pods assignment + ## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + ## + tolerations: [] + ## @param ioEngine.topologySpreadConstraints Topology Spread Constraints for Mayastor I/O Engine pods assignment + ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ + ## E.g. + ## topologySpreadConstraints: + ## - maxSkew: 1 + ## topologyKey: topology.kubernetes.io/zone + ## whenUnsatisfiable: DoNotSchedule + ## + topologySpreadConstraints: {} + ## @param ioEngine.priorityClassName Priority class for Mayastor I/O Engine primary pods assignment + ## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ + ## + priorityClassName: "" + ## @param ioEngine.containerPorts.http Mayastor I/O Engine HTTP container port + ## @param ioEngine.containerPorts.https Mayastor I/O Engine HTTPS container port + ## + containerPorts: + ioEngine: 10124 + ## Configure extra options for Mayastor I/O Engine containers' liveness and readiness probes + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes + ## @param ioEngine.livenessProbe.enabled Enable livenessProbe on Mayastor I/O Engine containers + ## @param ioEngine.livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe + ## @param ioEngine.livenessProbe.periodSeconds Period seconds for livenessProbe + ## @param ioEngine.livenessProbe.timeoutSeconds Timeout seconds for livenessProbe + ## @param ioEngine.livenessProbe.failureThreshold Failure threshold for livenessProbe + ## @param ioEngine.livenessProbe.successThreshold Success threshold for livenessProbe + ## + livenessProbe: + enabled: false + initialDelaySeconds: foo + periodSeconds: bar + timeoutSeconds: foo + failureThreshold: bar + successThreshold: foo + ## @param ioEngine.readinessProbe.enabled Enable readinessProbe on Mayastor I/O Engine containers + ## @param ioEngine.readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe + ## @param ioEngine.readinessProbe.periodSeconds Period seconds for readinessProbe + ## @param ioEngine.readinessProbe.timeoutSeconds Timeout seconds for readinessProbe + ## @param ioEngine.readinessProbe.failureThreshold Failure threshold for readinessProbe + ## @param ioEngine.readinessProbe.successThreshold Success threshold for readinessProbe + ## + readinessProbe: + enabled: false + initialDelaySeconds: foo + periodSeconds: bar + timeoutSeconds: foo + failureThreshold: bar + successThreshold: foo + ## @param ioEngine.startupProbe.enabled Enable startupProbe on Mayastor I/O Engine containers + ## @param ioEngine.startupProbe.initialDelaySeconds Initial delay seconds for startupProbe + ## @param ioEngine.startupProbe.periodSeconds Period seconds for startupProbe + ## @param ioEngine.startupProbe.timeoutSeconds Timeout seconds for startupProbe + ## @param ioEngine.startupProbe.failureThreshold Failure threshold for startupProbe + ## @param ioEngine.startupProbe.successThreshold Success threshold for startupProbe + ## + startupProbe: + enabled: false + initialDelaySeconds: foo + periodSeconds: bar + timeoutSeconds: foo + failureThreshold: bar + successThreshold: foo + ## @param ioEngine.customLivenessProbe Custom livenessProbe that overrides the default one + ## + customLivenessProbe: {} + ## @param ioEngine.customReadinessProbe Custom readinessProbe that overrides the default one + ## + customReadinessProbe: {} + ## @param ioEngine.customStartupProbe Custom startupProbe that overrides the default one + ## + customStartupProbe: {} + ## Mayastor I/O Engine resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## @param ioEngine.resources.limits The resources limits for the Mayastor I/O Engine containers + ## @param ioEngine.resources.requests The requested resources for the Mayastor I/O Engine containers + ## + resources: + limits: + cpu: 2 + memory: 1Gi + hugepages-2Mi: 2Gi + requests: + cpu: 2 + memory: 1Gi + hugepages-2Mi: 2Gi + ## Configure Pods Security Context + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod + ## @param ioEngine.podSecurityContext.enabled Enabled Mayastor I/O Engine pods' Security Context + ## @param ioEngine.podSecurityContext.fsGroup Set Mayastor I/O Engine pod's Security Context fsGroup + ## + podSecurityContext: + enabled: false + fsGroup: 1001 + ## Configure Container Security Context + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container + ## @param ioEngine.containerSecurityContext.enabled Enabled Mayastor I/O Engine containers' Security Context + ## @param ioEngine.containerSecurityContext.runAsUser Set Mayastor I/O Engine containers' Security Context runAsUser + ## @param ioEngine.containerSecurityContext.runAsNonRoot Set Mayastor I/O Engine containers' Security Context runAsNonRoot + ## @param ioEngine.containerSecurityContext.readOnlyRootFilesystem Set Mayastor I/O Engine containers' Security Context runAsNonRoot + ## + containerSecurityContext: + enabled: true + privileged: true + ## @param ioEngine.extraVolumes Optionally specify extra list of additional volumes to the FreeRADIUS pod(s) + ## + extraVolumes: [] + ## @param ioEngine.extraVolumeMounts Optionally specify extra list of additional volumeMounts for the FreeRADIUS container(s) + ## + extraVolumeMounts: [] + ## @param ioEngine.initContainers Add additional init containers for the FreeRADIUS pod(s) + ## + initContainers: [] + ## @param ioEngine.sidecars Add additional sidecar containers for the FreeRADIUS pod(s) + ## + sidecars: [] + +operator: + enabled: true + logLevel: info + ## Mayastor CSI Operator image + ## ref: https://hub.docker.com/r/mayadata/mcp-msp-operator/tags + ## @param operator.image.registry Mayastor CSI MSP Operator image registry + ## @param operator.image.repository Mayastor CSI MSP Operator image repository + ## @param operator.image.tag Mayastor CSI MSP Operator image tag (immutable tags are recommended) + ## @param operator.image.pullPolicy Mayastor CSI MSP Operator image pull policy + ## @param operator.image.pullSecrets Specify docker-registry secret names as an array + ## @param operator.image.debug Specify if debug logs should be enabled + ## + image: + registry: docker.io + repository: mayadata/mayastor-operator-diskpool + tag: develop + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## Mayastor Operator resource requests and limits + ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ + ## @param operator.resources.limits The resources limits for Mayastor Operator containers + ## @param operator.resources.requests The requested resources for Mayastor Operator containers + ## + resources: + limits: + cpu: 100m + memory: 32Mi + requests: + cpu: 50m + memory: 16Mi + + requestTimeout: 5s + +probe: + enabled: true + ## Mayastor CSI Operator image + ## ref: https://hub.docker.com/r/mayadata/mcp-msp-operator/tags + ## @param operator.image.registry Mayastor CSI MSP Operator image registry + ## @param operator.image.repository Mayastor CSI MSP Operator image repository + ## @param operator.image.tag Mayastor CSI MSP Operator image tag (immutable tags are recommended) + ## @param operator.image.pullPolicy Mayastor CSI MSP Operator image pull policy + ## @param operator.image.pullSecrets Specify docker-registry secret names as an array + ## @param operator.image.debug Specify if debug logs should be enabled + ## + image: + registry: docker.io + repository: busybox + tag: latest + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## Mayastor Probe resource requests and limits + ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ + ## @param probe.resources.limits The resources limits for Mayastor Probe containers + ## @param probe.resources.requests The requested resources for Mayastor Probe containers + ## + resources: + limits: + cpu: 100m + memory: 32Mi + requests: + cpu: 50m + memory: 16Mi + +## @param diskPools.create +## +diskPools: + create: false + ## @param diskPools.generateName Let Kubernetes generate pool name + ## + generateName: "" + ## @param diskPools.pools Custom RBAC rules + ## Example: + ## pools: + ## - node: node-1 + ## device: /dev/sdb + pools: [] + +## @section RBAC parameter +# + +## Specifies whether a ServiceAccount should be created +## +serviceAccount: + ## @param serviceAccount.create Enable the creation of a ServiceAccount for Mayastor Control Plane Rest pods + ## + create: true + ## @param serviceAccount.name Name of the created ServiceAccount + ## If not set and create is true, a name is generated using the fullname template + ## + name: "" + ## @param serviceAccount.automountServiceAccountToken Auto-mount the service account token in the pod + ## + automountServiceAccountToken: true + ## @param serviceAccount.annotations Additional custom annotations for the ServiceAccount + ## + annotations: {} +## Role Based Access +## Ref: https://kubernetes.io/docs/admin/authorization/rbac/ +## +rbac: + ## @param rbac.create Specify whether RBAC resources should be created and used + ## + create: true + ## @param rbac.rules Custom RBAC rules + ## Example: + ## rules: + ## - apiGroups: + ## - "" + ## resources: + ## - pods + ## verbs: + ## - get + ## - list + ## + rules: [] + + +## @section Metrics parameters +## + +metrics: + ## @param metrics.enabled Start a side-car prometheus exporter + ## + enabled: false + ## @param metrics.image.registry Exporter image registry + ## @param metrics.image.repository Exporter image repository + ## @param metrics.image.tag Exporter image tag (immutable tags are recommended) + ## @param metrics.image.pullPolicy Exporter image pull policy + ## @param metrics.image.pullSecrets Specify docker-registry secret names as an array + ## + image: + registry: docker.io + repository: mayadata/mayastor-metrics-exporter-pool + tag: develop + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## @param metrics.annotations [object] Annotations for the Exporter pod + ## + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9502" + ## Mayastor metrics container ports to open + ## @param containerPorts.metrics Exporter port to expose at container level + ## + containerPorts: + metrics: 9502 + ## Mayastor metrics container Security Context + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container + ## @param metrics.containerSecurityContext.enabled Enable security context for Mayastor metrics container + ## Example: + ## containerSecurityContext: + ## enabled: true + ## capabilities: + ## drop: ["NET_RAW"] + ## readOnlyRootFilesystem: true + ## + containerSecurityContext: + enabled: false + ## Mayastor Prometheus exporter resource requests and limits + ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ + ## We usually recommend not to specify default resources and to leave this as a conscious + ## choice for the user. This also increases chances charts run on environments with little + ## resources, such as Minikube. If you do want to specify resources, uncomment the following + ## lines, adjust them as necessary, and remove the curly braces after 'resources:'. + ## @param metrics.resources.limits The resources limits for MariaDB prometheus exporter containers + ## @param metrics.resources.requests The requested resources for MariaDB prometheus exporter containers + ## + resources: + ## Example: + ## limits: + ## cpu: 100m + ## memory: 256Mi + ## + limits: {} + ## Examples: + ## requests: + ## cpu: 100m + ## memory: 256Mi + ## + requests: {} + ## Configure extra options for liveness probe + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes + ## @param metrics.livenessProbe.enabled Enable livenessProbe + ## @param metrics.livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe + ## @param metrics.livenessProbe.periodSeconds Period seconds for livenessProbe + ## @param metrics.livenessProbe.timeoutSeconds Timeout seconds for livenessProbe + ## @param metrics.livenessProbe.failureThreshold Failure threshold for livenessProbe + ## @param metrics.livenessProbe.successThreshold Success threshold for livenessProbe + ## + livenessProbe: + enabled: true + initialDelaySeconds: 120 + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 + ## Configure extra options for readiness probe + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes + ## @param metrics.readinessProbe.enabled Enable readinessProbe + ## @param metrics.readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe + ## @param metrics.readinessProbe.periodSeconds Period seconds for readinessProbe + ## @param metrics.readinessProbe.timeoutSeconds Timeout seconds for readinessProbe + ## @param metrics.readinessProbe.failureThreshold Failure threshold for readinessProbe + ## @param metrics.readinessProbe.successThreshold Success threshold for readinessProbe + ## + readinessProbe: + enabled: true + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 + ## Prometheus Service Monitor + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + ## + podMonitor: + ## @param metrics.podMonitor.enabled Create PodMonitor Resource for scraping metrics using PrometheusOperator + ## + enabled: false + ## @param metrics.podMonitor.namespace Namespace in which Prometheus is running + ## + namespace: monitoring + ## @param metrics.podMonitor.interval Specify the interval at which metrics should be scraped + ## + interval: 30s + ## @param metrics.podMonitor.scrapeTimeout Specify the timeout after which the scrape is ended + ## + scrapeTimeout: 30s + ## @param metrics.podMonitor.additionalLabels [object] Additional labels that can be used so PodMonitors will be discovered by Prometheus + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec + ## + additionalLabels: {} + ## @param metrics.podMonitor.scheme Scheme to use for scraping + ## + scheme: http + ## @param metrics.podMonitor.tlsConfig [object] TLS configuration used for scrape endpoints used by Prometheus + ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#tlsconfig + ## e.g: + ## tlsConfig: + ## ca: + ## secret: + ## name: existingSecretName + ## + tlsConfig: {} + ## @param metrics.podMonitor.relabelings [array] Prometheus relabeling rules + ## + relabelings: [] + ## Prometheus Service Monitor + ## ref: https://github.com/coreos/prometheus-operator + ## + serviceMonitor: + ## @param metrics.serviceMonitor.enabled Create ServiceMonitor Resource for scraping metrics using PrometheusOperator + ## + enabled: false + ## @param metrics.serviceMonitor.namespace Namespace which Prometheus is running in + ## + namespace: "" + ## @param metrics.serviceMonitor.jobLabel The name of the label on the target service to use as the job name in prometheus. + ## + jobLabel: "" + ## @param metrics.serviceMonitor.interval Interval at which metrics should be scraped + ## + interval: 30s + ## @param metrics.serviceMonitor.scrapeTimeout Specify the timeout after which the scrape is ended + ## e.g: + ## scrapeTimeout: 30s + ## + scrapeTimeout: "" + ## @param metrics.serviceMonitor.relabelings RelabelConfigs to apply to samples before scraping + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig + ## + relabelings: [] + ## @param metrics.serviceMonitor.metricRelabelings MetricRelabelConfigs to apply to samples before ingestion + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig + ## + metricRelabelings: [] + ## @param metrics.serviceMonitor.honorLabels honorLabels chooses the metric's labels on collisions with target labels + ## + honorLabels: false + ## @param metrics.serviceMonitor.selector ServiceMonitor selector labels + ## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration + ## + ## selector: + ## prometheus: my-prometheus + ## + selector: {} + ## @param metrics.serviceMonitor.labels Extra labels for the ServiceMonitor + ## + labels: {} + ## Prometheus Operator PrometheusRule configuration + ## + prometheusRule: + ## @param metrics.prometheusRule.enabled Create a Prometheus Operator PrometheusRule (also requires `metrics.enabled` to be `true` and `metrics.prometheusRule.rules`) + ## + enabled: false + ## @param metrics.prometheusRule.namespace Namespace for the PrometheusRule Resource (defaults to the Release Namespace) + ## + namespace: "" + ## @param metrics.prometheusRule.additionalLabels Additional labels that can be used so PrometheusRule will be discovered by Prometheus + ## + additionalLabels: {} + ## @param metrics.prometheusRule.rules Prometheus Rule definitions + # - alert: ETCD has no leader + # annotations: + # summary: "ETCD has no leader" + # description: "pod {{`{{`}} $labels.pod {{`}}`}} state error, can't connect leader" + # for: 1m + # expr: etcd_server_has_leader == 0 + # labels: + # severity: critical + # group: PaaS + ## + rules: [] \ No newline at end of file