From fdc576dddd0e0f24eaef78e5af96af8d13e2dc16 Mon Sep 17 00:00:00 2001 From: Cesar Celis Hernandez Date: Wed, 16 Aug 2023 00:52:36 -0600 Subject: [PATCH] Add Helm chart for DirectPV operator (#821) ### Objective: Add `Helm Chart` for DirectPV This will be needed for our DirectPV Helm Operator that will be used for the certification. When initializing the Operator, we have a flag where this folder goes: `--helm-chart` then Operator will use that helm chart for reconciling. * Thank you @balamurugana for providing the notes and for finding this method! * Reference: https://github.com/cniackz/public/wiki/Helm-Operator-for-DirectPV --- helm.sh | 64 +++++ helm/.helmignore | 23 ++ helm/Chart.yaml | 10 + helm/templates/CSIDriver.yaml | 19 ++ helm/templates/ClusterRole.yaml | 172 +++++++++++++ helm/templates/ClusterRoleBinding.yaml | 23 ++ helm/templates/DaemonSet.yaml | 231 ++++++++++++++++++ helm/templates/Deployment.yaml | 121 +++++++++ helm/templates/Namespace.yaml | 17 ++ helm/templates/Role.yaml | 28 +++ helm/templates/RoleBinding.yaml | 24 ++ helm/templates/ServiceAccount.yaml | 14 ++ helm/templates/StorageClass.yaml | 26 ++ .../directpvdrives.directpv.min.io.yaml | 162 ++++++++++++ .../directpvinitrequests.directpv.min.io.yaml | 99 ++++++++ .../directpvnodes.directpv.min.io.yaml | 164 +++++++++++++ .../directpvvolumes.directpv.min.io.yaml | 156 ++++++++++++ helm/values.yaml | 82 +++++++ 18 files changed, 1435 insertions(+) create mode 100644 helm.sh create mode 100644 helm/.helmignore create mode 100644 helm/Chart.yaml create mode 100644 helm/templates/CSIDriver.yaml create mode 100644 helm/templates/ClusterRole.yaml create mode 100644 helm/templates/ClusterRoleBinding.yaml create mode 100644 helm/templates/DaemonSet.yaml create mode 100644 helm/templates/Deployment.yaml create mode 100644 helm/templates/Namespace.yaml create mode 100644 helm/templates/Role.yaml create mode 100644 helm/templates/RoleBinding.yaml create mode 100644 helm/templates/ServiceAccount.yaml create mode 100644 helm/templates/StorageClass.yaml create mode 100644 helm/templates/directpvdrives.directpv.min.io.yaml create mode 100644 helm/templates/directpvinitrequests.directpv.min.io.yaml create mode 100644 helm/templates/directpvnodes.directpv.min.io.yaml create mode 100644 helm/templates/directpvvolumes.directpv.min.io.yaml create mode 100644 helm/values.yaml diff --git a/helm.sh b/helm.sh new file mode 100644 index 000000000..6eba338aa --- /dev/null +++ b/helm.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# This file is part of MinIO DirectPV +# Copyright (c) 2023 MinIO, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +set -o errexit +set -o nounset +set -o pipefail + +declare BUILD_VERSION KUBECTL_DIRECTPV + +function init() { + if [ "$#" -ne 1 ]; then + cat < + +EXAMPLE: + $ helm.sh 4.0.7 +EOF + exit 255 + fi + + # assign after trimming 'v' + BUILD_VERSION="${1/v/}" + + KUBECTL_DIRECTPV="./kubectl-directpv_${BUILD_VERSION}_$(go env GOOS)_$(go env GOARCH)" + if which "kubectl-directpv_${BUILD_VERSION}_$(go env GOOS)_$(go env GOARCH)" >/dev/null 2>&1; then + KUBECTL_DIRECTPV="kubectl-directpv_${BUILD_VERSION}_$(go env GOOS)_$(go env GOARCH)" + elif [ ! -f "${KUBECTL_DIRECTPV}" ]; then + echo "Downloading required kubectl-directpv" + curl --silent --location --insecure --fail --output "${KUBECTL_DIRECTPV}" "https://github.com/minio/directpv/releases/download/v${BUILD_VERSION}/${KUBECTL_DIRECTPV:2}" + chmod a+x "${KUBECTL_DIRECTPV}" + fi +} + +function main() { + mkdir -p "./helm/templates/" + "${KUBECTL_DIRECTPV}" install -o yaml | sed -e 's/^---/~~~/g' | awk '{f="file" NR; print $0 > f}' RS='~~~' + for file in file*; do + name=$(awk '/^kind:/ { print $NF }' "${file}") + if [ "${name}" == "CustomResourceDefinition" ]; then + name=$(awk '/^ name:/ { print $NF }' "${file}") + fi + if [ -n "${name}" ]; then + mv "${file}" "./helm/templates/${name}.yaml" + fi + done +} + +init "$@" +main "$@" diff --git a/helm/.helmignore b/helm/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/helm/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/helm/Chart.yaml b/helm/Chart.yaml new file mode 100644 index 000000000..09bb2267b --- /dev/null +++ b/helm/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: directpv-chart +description: A Helm chart for DirectPV +type: application +version: 0.1.0 +appVersion: "4.0.6" +maintainers: +- email: dev@min.io + name: MinIO + diff --git a/helm/templates/CSIDriver.yaml b/helm/templates/CSIDriver.yaml new file mode 100644 index 000000000..e386dcc3f --- /dev/null +++ b/helm/templates/CSIDriver.yaml @@ -0,0 +1,19 @@ + +apiVersion: storage.k8s.io/v1 +kind: CSIDriver +metadata: + creationTimestamp: null + labels: + application-name: directpv.min.io + application-type: CSIDriver + directpv.min.io/created-by: kubectl-directpv + directpv.min.io/version: v1beta1 + name: directpv-min-io +spec: + attachRequired: false + podInfoOnMount: true + volumeLifecycleModes: + - Persistent + - Ephemeral + + diff --git a/helm/templates/ClusterRole.yaml b/helm/templates/ClusterRole.yaml new file mode 100644 index 000000000..d399a6042 --- /dev/null +++ b/helm/templates/ClusterRole.yaml @@ -0,0 +1,172 @@ + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + annotations: + rbac.authorization.kubernetes.io/autoupdate: "true" + creationTimestamp: null + labels: + application-name: directpv.min.io + application-type: CSIDriver + directpv.min.io/created-by: kubectl-directpv + directpv.min.io/version: v1beta1 + name: directpv-min-io +rules: +- apiGroups: + - "" + resources: + - persistentvolumes + verbs: + - create + - delete + - get + - list + - patch + - watch +- apiGroups: + - "" + resources: + - persistentvolumeclaims/status + verbs: + - patch +- apiGroups: + - policy + resources: + - podsecuritypolicies + verbs: + - use +- apiGroups: + - "" + resources: + - persistentvolumeclaims + verbs: + - get + - list + - update + - watch +- apiGroups: + - storage.k8s.io + resources: + - storageclasses + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - events + verbs: + - create + - list + - patch + - update + - watch +- apiGroups: + - snapshot.storage.k8s.io + resources: + - volumesnapshots + verbs: + - get + - list +- apiGroups: + - snapshot.storage.k8s.io + resources: + - volumesnapshotcontents + verbs: + - get + - list +- apiGroups: + - storage.k8s.io + resources: + - csinodes + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - nodes + verbs: + - get + - list + - watch +- apiGroups: + - storage.k8s.io + resources: + - volumeattachments + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - endpoints + verbs: + - create + - delete + - get + - list + - update + - watch +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - create + - delete + - get + - list + - update + - watch +- apiGroups: + - apiextensions.k8s.io + - directpv.min.io + resources: + - customresourcedefinitions + - customresourcedefinition + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - directpv.min.io + resources: + - directpvdrives + - directpvvolumes + - directpvnodes + - directpvinitrequests + verbs: + - create + - delete + - get + - list + - update + - watch +- apiGroups: + - "" + resources: + - pods + - pod + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - secrets + - secret + verbs: + - get + - list + - watch + + diff --git a/helm/templates/ClusterRoleBinding.yaml b/helm/templates/ClusterRoleBinding.yaml new file mode 100644 index 000000000..448cb6921 --- /dev/null +++ b/helm/templates/ClusterRoleBinding.yaml @@ -0,0 +1,23 @@ + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + annotations: + rbac.authorization.kubernetes.io/autoupdate: "true" + creationTimestamp: null + labels: + application-name: directpv.min.io + application-type: CSIDriver + directpv.min.io/created-by: kubectl-directpv + directpv.min.io/version: v1beta1 + name: directpv-min-io +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: directpv-min-io +subjects: +- kind: ServiceAccount + name: directpv-min-io + namespace: directpv + + diff --git a/helm/templates/DaemonSet.yaml b/helm/templates/DaemonSet.yaml new file mode 100644 index 000000000..9981747e4 --- /dev/null +++ b/helm/templates/DaemonSet.yaml @@ -0,0 +1,231 @@ + +apiVersion: apps/v1 +kind: DaemonSet +metadata: + creationTimestamp: null + labels: + application-name: directpv.min.io + application-type: CSIDriver + directpv.min.io/created-by: kubectl-directpv + directpv.min.io/version: v1beta1 + name: node-server + namespace: directpv +spec: + selector: + matchLabels: + selector.directpv.min.io: directpv-min-io-k7yqe + template: + metadata: + annotations: + created-by: kubectl-directpv + creationTimestamp: null + labels: + selector.directpv.min.io: directpv-min-io-k7yqe + selector.directpv.min.io.service: enabled + name: node-server + namespace: directpv + spec: + containers: + - args: + - --v=3 + - --csi-address=unix:///csi/csi.sock + - --kubelet-registration-path=/var/lib/kubelet/plugins/directpv-min-io/csi.sock + env: + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + image: quay.io/minio/csi-node-driver-registrar@sha256:c805fdc166761218dc9478e7ac8e0ad0e42ad442269e75608823da3eb761e67e + name: node-driver-registrar + resources: {} + terminationMessagePath: /var/log/driver-registrar-termination-log + terminationMessagePolicy: FallbackToLogsOnError + volumeMounts: + - mountPath: /csi + mountPropagation: None + name: socket-dir + - mountPath: /registration + mountPropagation: None + name: registration-dir + - args: + - node-server + - -v=3 + - --identity=directpv-min-io + - --csi-endpoint=$(CSI_ENDPOINT) + - --kube-node-name=$(KUBE_NODE_NAME) + - --readiness-port=30443 + - --metrics-port=10443 + env: + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: CSI_ENDPOINT + value: unix:///csi/csi.sock + image: quay.io/minio/directpv:v4.0.7 + livenessProbe: + failureThreshold: 5 + httpGet: + path: /healthz + port: healthz + initialDelaySeconds: 60 + periodSeconds: 10 + timeoutSeconds: 10 + name: node-server + ports: + - containerPort: 30443 + name: readinessport + protocol: TCP + - containerPort: 9898 + name: healthz + protocol: TCP + - containerPort: 10443 + name: metrics + protocol: TCP + readinessProbe: + failureThreshold: 5 + httpGet: + path: /ready + port: readinessport + scheme: HTTP + initialDelaySeconds: 60 + periodSeconds: 10 + timeoutSeconds: 10 + resources: {} + securityContext: + privileged: true + terminationMessagePath: /var/log/driver-termination-log + terminationMessagePolicy: FallbackToLogsOnError + volumeMounts: + - mountPath: /csi + mountPropagation: None + name: socket-dir + - mountPath: /var/lib/kubelet/pods + mountPropagation: Bidirectional + name: mountpoint-dir + - mountPath: /var/lib/kubelet/plugins + mountPropagation: Bidirectional + name: plugins-dir + - mountPath: /var/lib/directpv/ + mountPropagation: Bidirectional + name: directpv-common-root + - mountPath: /sys + mountPropagation: Bidirectional + name: sysfs + - mountPath: /dev + mountPropagation: HostToContainer + name: devfs + readOnly: true + - mountPath: /run/udev/data + mountPropagation: Bidirectional + name: run-udev-data-dir + readOnly: true + - mountPath: /var/lib/direct-csi/ + mountPropagation: Bidirectional + name: direct-csi-common-root + - args: + - node-controller + - -v=3 + - --kube-node-name=$(KUBE_NODE_NAME) + env: + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + image: quay.io/minio/directpv:v4.0.7 + name: node-controller + resources: {} + securityContext: + privileged: true + terminationMessagePath: /var/log/driver-termination-log + terminationMessagePolicy: FallbackToLogsOnError + volumeMounts: + - mountPath: /csi + mountPropagation: None + name: socket-dir + - mountPath: /var/lib/kubelet/pods + mountPropagation: Bidirectional + name: mountpoint-dir + - mountPath: /var/lib/kubelet/plugins + mountPropagation: Bidirectional + name: plugins-dir + - mountPath: /var/lib/directpv/ + mountPropagation: Bidirectional + name: directpv-common-root + - mountPath: /sys + mountPropagation: Bidirectional + name: sysfs + - mountPath: /dev + mountPropagation: HostToContainer + name: devfs + readOnly: true + - mountPath: /run/udev/data + mountPropagation: Bidirectional + name: run-udev-data-dir + readOnly: true + - mountPath: /var/lib/direct-csi/ + mountPropagation: Bidirectional + name: direct-csi-common-root + - args: + - --csi-address=/csi/csi.sock + - --health-port=9898 + image: quay.io/minio/livenessprobe@sha256:f3bc9a84f149cd7362e4bd0ae8cd90b26ad020c2591bfe19e63ff97aacf806c3 + name: liveness-probe + resources: {} + terminationMessagePath: /var/log/driver-liveness-termination-log + terminationMessagePolicy: FallbackToLogsOnError + volumeMounts: + - mountPath: /csi + mountPropagation: None + name: socket-dir + hostPID: true + serviceAccountName: directpv-min-io + volumes: + - hostPath: + path: /var/lib/kubelet/plugins/directpv-min-io + type: DirectoryOrCreate + name: socket-dir + - hostPath: + path: /var/lib/kubelet/pods + type: DirectoryOrCreate + name: mountpoint-dir + - hostPath: + path: /var/lib/kubelet/plugins_registry + type: DirectoryOrCreate + name: registration-dir + - hostPath: + path: /var/lib/kubelet/plugins + type: DirectoryOrCreate + name: plugins-dir + - hostPath: + path: /var/lib/directpv/ + type: DirectoryOrCreate + name: directpv-common-root + - hostPath: + path: /sys + type: DirectoryOrCreate + name: sysfs + - hostPath: + path: /dev + type: DirectoryOrCreate + name: devfs + - hostPath: + path: /run/udev/data + type: DirectoryOrCreate + name: run-udev-data-dir + - hostPath: + path: /var/lib/direct-csi/ + type: DirectoryOrCreate + name: direct-csi-common-root + updateStrategy: + type: RollingUpdate +status: + currentNumberScheduled: 0 + desiredNumberScheduled: 0 + numberMisscheduled: 0 + numberReady: 0 + + diff --git a/helm/templates/Deployment.yaml b/helm/templates/Deployment.yaml new file mode 100644 index 000000000..46e8b78eb --- /dev/null +++ b/helm/templates/Deployment.yaml @@ -0,0 +1,121 @@ + +apiVersion: apps/v1 +kind: Deployment +metadata: + creationTimestamp: null + finalizers: + - directpv-min-io/delete-protection + labels: + application-name: directpv.min.io + application-type: CSIDriver + directpv.min.io/created-by: kubectl-directpv + directpv.min.io/version: v1beta1 + name: controller + namespace: directpv +spec: + replicas: 3 + selector: + matchLabels: + selector.directpv.min.io: controller-gpfig + strategy: + type: Recreate + template: + metadata: + annotations: + created-by: kubectl-directpv + creationTimestamp: null + labels: + selector.directpv.min.io: controller-gpfig + name: controller + namespace: directpv + spec: + containers: + - args: + - --v=3 + - --timeout=300s + - --csi-address=$(CSI_ENDPOINT) + - --leader-election + - --feature-gates=Topology=true + - --strict-topology + env: + - name: CSI_ENDPOINT + value: unix:///csi/csi.sock + image: quay.io/minio/csi-provisioner@sha256:7b5c070ec70d30b0895d91b10c39a0e6cc81c18e0d1566c77aeff2a3587fa316 + name: csi-provisioner + resources: {} + securityContext: + privileged: true + terminationMessagePath: /var/log/controller-provisioner-termination-log + terminationMessagePolicy: FallbackToLogsOnError + volumeMounts: + - mountPath: /csi + mountPropagation: None + name: socket-dir + - args: + - --v=3 + - --timeout=300s + - --csi-address=$(CSI_ENDPOINT) + - --leader-election + env: + - name: CSI_ENDPOINT + value: unix:///csi/csi.sock + image: quay.io/minio/csi-resizer@sha256:819f68a4daf75acec336302843f303cf360d4941249f9f5019ffbb690c8ac7c0 + name: csi-resizer + resources: {} + securityContext: + privileged: true + terminationMessagePath: /var/log/controller-csi-resizer-termination-log + terminationMessagePolicy: FallbackToLogsOnError + volumeMounts: + - mountPath: /csi + mountPropagation: None + name: socket-dir + - args: + - controller + - --identity=directpv-min-io + - -v=3 + - --csi-endpoint=$(CSI_ENDPOINT) + - --kube-node-name=$(KUBE_NODE_NAME) + - --readiness-port=30443 + env: + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: CSI_ENDPOINT + value: unix:///csi/csi.sock + image: quay.io/minio/directpv:v4.0.7 + name: controller + ports: + - containerPort: 30443 + name: readinessport + protocol: TCP + - containerPort: 9898 + name: healthz + protocol: TCP + readinessProbe: + failureThreshold: 5 + httpGet: + path: /ready + port: readinessport + scheme: HTTP + initialDelaySeconds: 60 + periodSeconds: 10 + timeoutSeconds: 10 + resources: {} + securityContext: + privileged: true + volumeMounts: + - mountPath: /csi + mountPropagation: None + name: socket-dir + serviceAccountName: directpv-min-io + volumes: + - hostPath: + path: /var/lib/kubelet/plugins/controller-controller + type: DirectoryOrCreate + name: socket-dir +status: {} + + diff --git a/helm/templates/Namespace.yaml b/helm/templates/Namespace.yaml new file mode 100644 index 000000000..32bcf0d65 --- /dev/null +++ b/helm/templates/Namespace.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Namespace +metadata: + creationTimestamp: null + finalizers: + - foregroundDeletion + labels: + application-name: directpv.min.io + application-type: CSIDriver + directpv.min.io/created-by: kubectl-directpv + directpv.min.io/version: v1beta1 + pod-security.kubernetes.io/enforce: privileged + name: directpv +spec: {} +status: {} + + diff --git a/helm/templates/Role.yaml b/helm/templates/Role.yaml new file mode 100644 index 000000000..9fb48aa12 --- /dev/null +++ b/helm/templates/Role.yaml @@ -0,0 +1,28 @@ + +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + annotations: + rbac.authorization.kubernetes.io/autoupdate: "true" + creationTimestamp: null + labels: + application-name: directpv.min.io + application-type: CSIDriver + directpv.min.io/created-by: kubectl-directpv + directpv.min.io/version: v1beta1 + name: directpv-min-io + namespace: directpv +rules: +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - create + - delete + - get + - list + - update + - watch + + diff --git a/helm/templates/RoleBinding.yaml b/helm/templates/RoleBinding.yaml new file mode 100644 index 000000000..c79239fe9 --- /dev/null +++ b/helm/templates/RoleBinding.yaml @@ -0,0 +1,24 @@ + +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + annotations: + rbac.authorization.kubernetes.io/autoupdate: "true" + creationTimestamp: null + labels: + application-name: directpv.min.io + application-type: CSIDriver + directpv.min.io/created-by: kubectl-directpv + directpv.min.io/version: v1beta1 + name: directpv-min-io + namespace: directpv +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: directpv-min-io +subjects: +- kind: ServiceAccount + name: directpv-min-io + namespace: directpv + + diff --git a/helm/templates/ServiceAccount.yaml b/helm/templates/ServiceAccount.yaml new file mode 100644 index 000000000..b0d6934ed --- /dev/null +++ b/helm/templates/ServiceAccount.yaml @@ -0,0 +1,14 @@ + +apiVersion: v1 +kind: ServiceAccount +metadata: + creationTimestamp: null + labels: + application-name: directpv.min.io + application-type: CSIDriver + directpv.min.io/created-by: kubectl-directpv + directpv.min.io/version: v1beta1 + name: directpv-min-io + namespace: directpv + + diff --git a/helm/templates/StorageClass.yaml b/helm/templates/StorageClass.yaml new file mode 100644 index 000000000..4cd16c7a3 --- /dev/null +++ b/helm/templates/StorageClass.yaml @@ -0,0 +1,26 @@ + +allowVolumeExpansion: true +allowedTopologies: +- matchLabelExpressions: + - key: directpv.min.io/identity + values: + - directpv-min-io +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + creationTimestamp: null + finalizers: + - foregroundDeletion + labels: + application-name: directpv.min.io + application-type: CSIDriver + directpv.min.io/created-by: kubectl-directpv + directpv.min.io/version: v1beta1 + name: directpv-min-io +parameters: + fstype: xfs +provisioner: directpv-min-io +reclaimPolicy: Delete +volumeBindingMode: WaitForFirstConsumer + + diff --git a/helm/templates/directpvdrives.directpv.min.io.yaml b/helm/templates/directpvdrives.directpv.min.io.yaml new file mode 100644 index 000000000..567988ec3 --- /dev/null +++ b/helm/templates/directpvdrives.directpv.min.io.yaml @@ -0,0 +1,162 @@ + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + labels: + directpv.min.io/version: v1beta1 + name: directpvdrives.directpv.min.io +spec: + conversion: + strategy: None + group: directpv.min.io + names: + kind: DirectPVDrive + listKind: DirectPVDriveList + plural: directpvdrives + singular: directpvdrive + scope: Cluster + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: DirectPVDrive denotes drive CRD object. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: DriveSpec represents DirectPV drive specification values. + properties: + relabel: + type: boolean + unschedulable: + type: boolean + type: object + status: + description: DriveStatus denotes drive information. + properties: + allocatedCapacity: + format: int64 + type: integer + conditions: + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + freeCapacity: + format: int64 + type: integer + fsuuid: + type: string + make: + type: string + status: + description: DriveStatus denotes drive status + type: string + topology: + additionalProperties: + type: string + type: object + totalCapacity: + format: int64 + type: integer + required: + - allocatedCapacity + - freeCapacity + - fsuuid + - status + - topology + - totalCapacity + type: object + required: + - metadata + - status + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null + + diff --git a/helm/templates/directpvinitrequests.directpv.min.io.yaml b/helm/templates/directpvinitrequests.directpv.min.io.yaml new file mode 100644 index 000000000..317aaafbf --- /dev/null +++ b/helm/templates/directpvinitrequests.directpv.min.io.yaml @@ -0,0 +1,99 @@ + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + labels: + directpv.min.io/version: v1beta1 + name: directpvinitrequests.directpv.min.io +spec: + conversion: + strategy: None + group: directpv.min.io + names: + kind: DirectPVInitRequest + listKind: DirectPVInitRequestList + plural: directpvinitrequests + singular: directpvinitrequest + scope: Cluster + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: DirectPVInitRequest denotes DirectPVInitRequest CRD object. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: InitRequestSpec represents the spec for InitRequest. + properties: + devices: + items: + description: InitDevice represents the device requested for initialization. + properties: + force: + type: boolean + id: + type: string + name: + type: string + required: + - force + - id + - name + type: object + type: array + x-kubernetes-list-type: atomic + required: + - devices + type: object + status: + description: InitRequestStatus represents the status of the InitRequest. + properties: + results: + items: + description: InitDeviceResult represents the result of the InitDeviceRequest. + properties: + error: + type: string + name: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-type: atomic + status: + description: InitStatus denotes initialization status + type: string + required: + - results + - status + type: object + required: + - metadata + - spec + - status + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null + + diff --git a/helm/templates/directpvnodes.directpv.min.io.yaml b/helm/templates/directpvnodes.directpv.min.io.yaml new file mode 100644 index 000000000..b46b105cb --- /dev/null +++ b/helm/templates/directpvnodes.directpv.min.io.yaml @@ -0,0 +1,164 @@ + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + labels: + directpv.min.io/version: v1beta1 + name: directpvnodes.directpv.min.io +spec: + conversion: + strategy: None + group: directpv.min.io + names: + kind: DirectPVNode + listKind: DirectPVNodeList + plural: directpvnodes + singular: directpvnode + scope: Cluster + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: DirectPVNode denotes Node CRD object. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: NodeSpec represents DirectPV node specification values. + properties: + refresh: + type: boolean + type: object + status: + description: NodeStatus denotes node information. + properties: + conditions: + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + devices: + items: + description: Device denotes the device information in a drive + properties: + deniedReason: + type: string + fsType: + type: string + fsuuid: + type: string + id: + type: string + majorMinor: + type: string + make: + type: string + name: + type: string + size: + format: int64 + type: integer + required: + - id + - majorMinor + - name + - size + type: object + type: array + x-kubernetes-list-type: atomic + required: + - devices + type: object + required: + - metadata + - status + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null + + diff --git a/helm/templates/directpvvolumes.directpv.min.io.yaml b/helm/templates/directpvvolumes.directpv.min.io.yaml new file mode 100644 index 000000000..217fc4169 --- /dev/null +++ b/helm/templates/directpvvolumes.directpv.min.io.yaml @@ -0,0 +1,156 @@ + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + labels: + directpv.min.io/version: v1beta1 + name: directpvvolumes.directpv.min.io +spec: + conversion: + strategy: None + group: directpv.min.io + names: + kind: DirectPVVolume + listKind: DirectPVVolumeList + plural: directpvvolumes + singular: directpvvolume + scope: Cluster + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: DirectPVVolume denotes volume CRD object. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + status: + description: VolumeStatus denotes volume information. + properties: + availableCapacity: + format: int64 + type: integer + conditions: + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + dataPath: + type: string + fsuuid: + type: string + stagingTargetPath: + type: string + status: + description: VolumeStatus represents status of a volume. + type: string + targetPath: + type: string + totalCapacity: + format: int64 + type: integer + usedCapacity: + format: int64 + type: integer + required: + - availableCapacity + - dataPath + - fsuuid + - stagingTargetPath + - status + - targetPath + - totalCapacity + - usedCapacity + type: object + required: + - metadata + - status + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null + + diff --git a/helm/values.yaml b/helm/values.yaml new file mode 100644 index 000000000..02bbb6dd4 --- /dev/null +++ b/helm/values.yaml @@ -0,0 +1,82 @@ +# Default values for directpv-chart. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +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:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {}