From 0a40f2baad6a4f41141fc644d735a41c781b88f0 Mon Sep 17 00:00:00 2001 From: Niladri Halder Date: Sun, 17 Mar 2024 01:12:31 +0530 Subject: [PATCH 1/9] ci: update GitHub Actions workflows Signed-off-by: Niladri Halder --- .github/workflows/chart-lint-test.yml | 17 +++++++++-------- .github/workflows/release-charts.yml | 8 ++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/chart-lint-test.yml b/.github/workflows/chart-lint-test.yml index cf0048e4..645d8c29 100644 --- a/.github/workflows/chart-lint-test.yml +++ b/.github/workflows/chart-lint-test.yml @@ -17,35 +17,36 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Helm - uses: azure/setup-helm@v1 + uses: azure/setup-helm@v4 with: - version: v3.4.0 + version: v3.14.3 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: '3.10' + check-latest: true - name: Set up chart-testing - uses: helm/chart-testing-action@v2.0.1 + uses: helm/chart-testing-action@v2.6.1 - name: Run chart-testing (list-changed) id: list-changed run: | changed=$(ct list-changed --config ct.yaml) if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" + echo "changed=true" >> $GITHUB_OUTPUT fi - name: Run chart-testing (lint) run: ct lint --config ct.yaml - name: Create kind cluster - uses: helm/kind-action@v1.2.0 + uses: helm/kind-action@v1.9.0 if: steps.list-changed.outputs.changed == 'true' with: config: buildscripts/kind_config.yaml diff --git a/.github/workflows/release-charts.yml b/.github/workflows/release-charts.yml index 319e05f5..95c9ba40 100644 --- a/.github/workflows/release-charts.yml +++ b/.github/workflows/release-charts.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -22,12 +22,12 @@ jobs: git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - name: Install Helm - uses: azure/setup-helm@v1 + uses: azure/setup-helm@v4 with: - version: v3.4.0 + version: v3.14.3 - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.2.0 + uses: helm/chart-releaser-action@v1.6.0 env: CR_TOKEN: "${{ secrets.CR_TOKEN }}" with: From 3b600a886146d2d78264aee206488a520085817c Mon Sep 17 00:00:00 2001 From: Niladri Halder Date: Sun, 17 Mar 2024 01:25:17 +0530 Subject: [PATCH 2/9] refactor(charts): move CRDs to a subchart Signed-off-by: Niladri Halder --- deploy/helm/charts/Chart.yaml | 8 +- deploy/helm/charts/charts/crds/.helmignore | 23 ++ deploy/helm/charts/charts/crds/Chart.yaml | 4 + .../charts/charts/crds/templates/_helpers.tpl | 17 ++ .../templates/csi-volume-snapshot-class.yaml} | 56 +++-- .../csi-volume-snapshot-content.yaml} | 201 +++++++++++++----- .../crds/templates/csi-volume-snapshot.yaml} | 196 ++++++++++++----- .../crds/templates}/lvmnode.yaml | 7 +- .../crds/templates}/lvmsnapshot.yaml | 7 +- .../crds/templates}/lvmvolume.yaml | 7 +- deploy/helm/charts/charts/crds/values.yaml | 21 ++ deploy/helm/charts/values.yaml | 20 +- 12 files changed, 421 insertions(+), 146 deletions(-) create mode 100644 deploy/helm/charts/charts/crds/.helmignore create mode 100644 deploy/helm/charts/charts/crds/Chart.yaml create mode 100644 deploy/helm/charts/charts/crds/templates/_helpers.tpl rename deploy/helm/charts/{templates/volumesnapshotclasses-crd.yaml => charts/crds/templates/csi-volume-snapshot-class.yaml} (62%) rename deploy/helm/charts/{templates/volumesnapshotcontents-crd.yaml => charts/crds/templates/csi-volume-snapshot-content.yaml} (64%) rename deploy/helm/charts/{templates/volumesnapshots-crd.yaml => charts/crds/templates/csi-volume-snapshot.yaml} (57%) rename deploy/helm/charts/{crds => charts/crds/templates}/lvmnode.yaml (97%) rename deploy/helm/charts/{crds => charts/crds/templates}/lvmsnapshot.yaml (94%) rename deploy/helm/charts/{crds => charts/crds/templates}/lvmvolume.yaml (97%) create mode 100644 deploy/helm/charts/charts/crds/values.yaml diff --git a/deploy/helm/charts/Chart.yaml b/deploy/helm/charts/Chart.yaml index 8d225483..a83e6a13 100644 --- a/deploy/helm/charts/Chart.yaml +++ b/deploy/helm/charts/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 name: lvm-localpv description: CSI Driver for dynamic provisioning of LVM Persistent Local Volumes. -version: 1.4.0 -appVersion: 1.4.0 +version: 1.5.0 +appVersion: 1.5.0 icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/openebs/icon/color/openebs-icon-color.png home: https://openebs.io/ keywords: @@ -14,6 +14,10 @@ keywords: - storage sources: - https://github.com/openebs/lvm-localpv +dependencies: + - name: crds + version: "1.5.0" + condition: crds.enabled maintainers: - name: prateekpandey14 email: prateek.pandey@mayadata.io diff --git a/deploy/helm/charts/charts/crds/.helmignore b/deploy/helm/charts/charts/crds/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/deploy/helm/charts/charts/crds/.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/deploy/helm/charts/charts/crds/Chart.yaml b/deploy/helm/charts/charts/crds/Chart.yaml new file mode 100644 index 00000000..12b2c819 --- /dev/null +++ b/deploy/helm/charts/charts/crds/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v2 +name: crds +version: 1.5.0 +description: A Helm chart that collects CustomResourceDefinitions (CRDs) from lvm-localpv. diff --git a/deploy/helm/charts/charts/crds/templates/_helpers.tpl b/deploy/helm/charts/charts/crds/templates/_helpers.tpl new file mode 100644 index 00000000..d1657f80 --- /dev/null +++ b/deploy/helm/charts/charts/crds/templates/_helpers.tpl @@ -0,0 +1,17 @@ +{{/* + This returns a "1" if the CRD is absent in the cluster + Usage: + {{- if (include "crdIsAbsent" (list )) -}} + # CRD Yaml + {{- end -}} +*/}} +{{- define "crdIsAbsent" -}} + {{- $crdName := index . 0 -}} + {{- $crd := lookup "apiextensions.k8s.io/v1" "CustomResourceDefinition" "" $crdName -}} + {{- $output := "1" -}} + {{- if $crd -}} + {{- $output = "" -}} + {{- end -}} + + {{- $output -}} +{{- end -}} \ No newline at end of file diff --git a/deploy/helm/charts/templates/volumesnapshotclasses-crd.yaml b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-class.yaml similarity index 62% rename from deploy/helm/charts/templates/volumesnapshotclasses-crd.yaml rename to deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-class.yaml index 0a6b30fd..cab4fd52 100644 --- a/deploy/helm/charts/templates/volumesnapshotclasses-crd.yaml +++ b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-class.yaml @@ -1,11 +1,12 @@ -{{- if .Values.crd.volumeSnapshot }} ---- +{{- if and .Values.volumeSnapshots.enabled .Values.volumeSnapshots.snapshotClassesEnabled -}} +{{- $crdName := "volumesnapshotclasses.snapshot.storage.k8s.io" -}} +{{- if (include "crdIsAbsent" (list $crdName)) -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: + api-approved.kubernetes.io: https://github.com/kubernetes-csi/external-snapshotter/pull/814 controller-gen.kubebuilder.io/version: v0.11.3 - api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814" creationTimestamp: null name: volumesnapshotclasses.snapshot.storage.k8s.io spec: @@ -42,8 +43,8 @@ spec: 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' + 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 deletionPolicy: description: deletionPolicy determines whether a VolumeSnapshotContent @@ -63,8 +64,8 @@ spec: 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' + 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 parameters: additionalProperties: @@ -83,42 +84,56 @@ spec: - jsonPath: .driver name: Driver type: string - - description: Determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted. + - description: Determines whether a VolumeSnapshotContent created through the + VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted. jsonPath: .deletionPolicy name: DeletionPolicy type: string - jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1beta1 - # This indicates the v1beta1 version of the custom resource is deprecated. - # API requests to this version receive a warning in the server response. deprecated: true - # This overrides the default warning returned to clients making v1beta1 API requests. - deprecationWarning: "snapshot.storage.k8s.io/v1beta1 VolumeSnapshotClass is deprecated; use snapshot.storage.k8s.io/v1 VolumeSnapshotClass" + deprecationWarning: snapshot.storage.k8s.io/v1beta1 VolumeSnapshotClass is deprecated; + use snapshot.storage.k8s.io/v1 VolumeSnapshotClass + name: v1beta1 schema: openAPIV3Schema: - description: VolumeSnapshotClass specifies parameters that a underlying storage system uses when creating a volume snapshot. A specific VolumeSnapshotClass is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses are non-namespaced + description: VolumeSnapshotClass specifies parameters that a underlying storage + system uses when creating a volume snapshot. A specific VolumeSnapshotClass + is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses + are non-namespaced 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' + 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 deletionPolicy: - description: deletionPolicy determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted. Supported values are "Retain" and "Delete". "Retain" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are deleted. Required. + description: deletionPolicy determines whether a VolumeSnapshotContent + created through the VolumeSnapshotClass should be deleted when its bound + VolumeSnapshot is deleted. Supported values are "Retain" and "Delete". + "Retain" means that the VolumeSnapshotContent and its physical snapshot + on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent + and its physical snapshot on underlying storage system are deleted. + Required. enum: - Delete - Retain type: string driver: - description: driver is the name of the storage driver that handles this VolumeSnapshotClass. Required. + description: driver is the name of the storage driver that handles this + VolumeSnapshotClass. Required. 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' + 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 parameters: additionalProperties: type: string - description: parameters is a key-value map with storage driver specific parameters for creating snapshots. These values are opaque to Kubernetes. + description: parameters is a key-value map with storage driver specific + parameters for creating snapshots. These values are opaque to Kubernetes. type: object required: - deletionPolicy @@ -133,4 +148,5 @@ status: plural: "" conditions: [] storedVersions: [] -{{- end }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/deploy/helm/charts/templates/volumesnapshotcontents-crd.yaml b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-content.yaml similarity index 64% rename from deploy/helm/charts/templates/volumesnapshotcontents-crd.yaml rename to deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-content.yaml index 7c4ec07b..50003db4 100644 --- a/deploy/helm/charts/templates/volumesnapshotcontents-crd.yaml +++ b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-content.yaml @@ -1,11 +1,12 @@ -{{- if .Values.crd.volumeSnapshot }} ---- +{{- if and .Values.volumeSnapshots.enabled .Values.volumeSnapshots.snapshotContentsEnabled -}} +{{- $crdName := "volumesnapshotcontents.snapshot.storage.k8s.io" -}} +{{- if (include "crdIsAbsent" (list $crdName)) -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: + api-approved.kubernetes.io: https://github.com/kubernetes-csi/external-snapshotter/pull/814 controller-gen.kubebuilder.io/version: v0.11.3 - api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814" creationTimestamp: null name: volumesnapshotcontents.snapshot.storage.k8s.io spec: @@ -49,7 +50,8 @@ spec: jsonPath: .spec.volumeSnapshotRef.name name: VolumeSnapshot type: string - - description: Namespace of the VolumeSnapshot object to which this VolumeSnapshotContent object is bound. + - description: Namespace of the VolumeSnapshot object to which this VolumeSnapshotContent + object is bound. jsonPath: .spec.volumeSnapshotRef.namespace name: VolumeSnapshotNamespace type: string @@ -64,13 +66,13 @@ spec: 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' + 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' + 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 spec: description: spec defines properties of a VolumeSnapshotContent created @@ -103,6 +105,11 @@ spec: description: source specifies whether the snapshot is (or should be) dynamically provisioned or already exists, and just requires a Kubernetes object representation. This field is immutable after creation. Required. + oneOf: + - required: + - snapshotHandle + - required: + - volumeHandle properties: snapshotHandle: description: snapshotHandle specifies the CSI "snapshot_id" of @@ -116,9 +123,6 @@ spec: This field is immutable. type: string type: object - oneOf: - - required: [ "snapshotHandle" ] - - required: [ "volumeHandle" ] sourceVolumeMode: description: SourceVolumeMode is the mode of the volume whose snapshot is taken. Can be either “Filesystem” or “Block”. If not specified, @@ -145,16 +149,16 @@ spec: type: string fieldPath: description: 'If referring to a piece of an object instead of - an entire object, this string should contain a valid JSON/Go - field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within - a pod, this would take on a value like: "spec.containers{name}" - (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" - (container with index 2 in this pod). This syntax is chosen - only to have some well-defined way of referencing a part of - an object. TODO: this design is not final and this field is - subject to change in the future.' + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -167,7 +171,7 @@ spec: type: string resourceVersion: description: 'Specific resourceVersion to which this reference - is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' @@ -203,8 +207,8 @@ spec: properties: message: description: 'message is a string detailing the encountered error - during snapshot creation if specified. NOTE: message may be - logged, and it should not contain sensitive information.' + during snapshot creation if specified. NOTE: message may be + logged, and it should not contain sensitive information.' type: string time: description: time is the timestamp when the error was encountered. @@ -252,7 +256,7 @@ spec: served: true storage: true subresources: - status: { } + status: {} - additionalPrinterColumns: - description: Indicates if the snapshot is ready to be used to restore a volume. jsonPath: .status.readyToUse @@ -262,11 +266,14 @@ spec: jsonPath: .status.restoreSize name: RestoreSize type: integer - - description: Determines whether this VolumeSnapshotContent and its physical snapshot on the underlying storage system should be deleted when its bound VolumeSnapshot is deleted. + - description: Determines whether this VolumeSnapshotContent and its physical + snapshot on the underlying storage system should be deleted when its bound + VolumeSnapshot is deleted. jsonPath: .spec.deletionPolicy name: DeletionPolicy type: string - - description: Name of the CSI driver used to create the physical snapshot on the underlying storage system. + - description: Name of the CSI driver used to create the physical snapshot on + the underlying storage system. jsonPath: .spec.driver name: Driver type: string @@ -274,66 +281,112 @@ spec: jsonPath: .spec.volumeSnapshotClassName name: VolumeSnapshotClass type: string - - description: Name of the VolumeSnapshot object to which this VolumeSnapshotContent object is bound. + - description: Name of the VolumeSnapshot object to which this VolumeSnapshotContent + object is bound. jsonPath: .spec.volumeSnapshotRef.name name: VolumeSnapshot type: string - - description: Namespace of the VolumeSnapshot object to which this VolumeSnapshotContent object is bound. + - description: Namespace of the VolumeSnapshot object to which this VolumeSnapshotContent + object is bound. jsonPath: .spec.volumeSnapshotRef.namespace name: VolumeSnapshotNamespace type: string - jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1beta1 - # This indicates the v1beta1 version of the custom resource is deprecated. - # API requests to this version receive a warning in the server response. deprecated: true - # This overrides the default warning returned to clients making v1beta1 API requests. - deprecationWarning: "snapshot.storage.k8s.io/v1beta1 VolumeSnapshotContent is deprecated; use snapshot.storage.k8s.io/v1 VolumeSnapshotContent" + deprecationWarning: snapshot.storage.k8s.io/v1beta1 VolumeSnapshotContent is deprecated; + use snapshot.storage.k8s.io/v1 VolumeSnapshotContent + name: v1beta1 schema: openAPIV3Schema: - description: VolumeSnapshotContent represents the actual "on-disk" snapshot object in the underlying storage system + description: VolumeSnapshotContent represents the actual "on-disk" snapshot + object in the underlying storage system 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' + 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' + 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 spec: - description: spec defines properties of a VolumeSnapshotContent created by the underlying storage system. Required. + description: spec defines properties of a VolumeSnapshotContent created + by the underlying storage system. Required. properties: deletionPolicy: - description: deletionPolicy determines whether this VolumeSnapshotContent and its physical snapshot on the underlying storage system should be deleted when its bound VolumeSnapshot is deleted. Supported values are "Retain" and "Delete". "Retain" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are deleted. For dynamically provisioned snapshots, this field will automatically be filled in by the CSI snapshotter sidecar with the "DeletionPolicy" field defined in the corresponding VolumeSnapshotClass. For pre-existing snapshots, users MUST specify this field when creating the VolumeSnapshotContent object. Required. + description: deletionPolicy determines whether this VolumeSnapshotContent + and its physical snapshot on the underlying storage system should + be deleted when its bound VolumeSnapshot is deleted. Supported values + are "Retain" and "Delete". "Retain" means that the VolumeSnapshotContent + and its physical snapshot on underlying storage system are kept. + "Delete" means that the VolumeSnapshotContent and its physical snapshot + on underlying storage system are deleted. For dynamically provisioned + snapshots, this field will automatically be filled in by the CSI + snapshotter sidecar with the "DeletionPolicy" field defined in the + corresponding VolumeSnapshotClass. For pre-existing snapshots, users + MUST specify this field when creating the VolumeSnapshotContent + object. Required. enum: - Delete - Retain type: string driver: - description: driver is the name of the CSI driver used to create the physical snapshot on the underlying storage system. This MUST be the same as the name returned by the CSI GetPluginName() call for that driver. Required. + description: driver is the name of the CSI driver used to create the + physical snapshot on the underlying storage system. This MUST be + the same as the name returned by the CSI GetPluginName() call for + that driver. Required. type: string source: - description: source specifies whether the snapshot is (or should be) dynamically provisioned or already exists, and just requires a Kubernetes object representation. This field is immutable after creation. Required. + description: source specifies whether the snapshot is (or should be) + dynamically provisioned or already exists, and just requires a Kubernetes + object representation. This field is immutable after creation. Required. properties: snapshotHandle: - description: snapshotHandle specifies the CSI "snapshot_id" of a pre-existing snapshot on the underlying storage system for which a Kubernetes object representation was (or should be) created. This field is immutable. + description: snapshotHandle specifies the CSI "snapshot_id" of + a pre-existing snapshot on the underlying storage system for + which a Kubernetes object representation was (or should be) + created. This field is immutable. type: string volumeHandle: - description: volumeHandle specifies the CSI "volume_id" of the volume from which a snapshot should be dynamically taken from. This field is immutable. + description: volumeHandle specifies the CSI "volume_id" of the + volume from which a snapshot should be dynamically taken from. + This field is immutable. type: string type: object volumeSnapshotClassName: - description: name of the VolumeSnapshotClass from which this snapshot was (or will be) created. Note that after provisioning, the VolumeSnapshotClass may be deleted or recreated with different set of values, and as such, should not be referenced post-snapshot creation. + description: name of the VolumeSnapshotClass from which this snapshot + was (or will be) created. Note that after provisioning, the VolumeSnapshotClass + may be deleted or recreated with different set of values, and as + such, should not be referenced post-snapshot creation. type: string volumeSnapshotRef: - description: volumeSnapshotRef specifies the VolumeSnapshot object to which this VolumeSnapshotContent object is bound. VolumeSnapshot.Spec.VolumeSnapshotContentName field must reference to this VolumeSnapshotContent's name for the bidirectional binding to be valid. For a pre-existing VolumeSnapshotContent object, name and namespace of the VolumeSnapshot object MUST be provided for binding to happen. This field is immutable after creation. Required. + description: volumeSnapshotRef specifies the VolumeSnapshot object + to which this VolumeSnapshotContent object is bound. VolumeSnapshot.Spec.VolumeSnapshotContentName + field must reference to this VolumeSnapshotContent's name for the + bidirectional binding to be valid. For a pre-existing VolumeSnapshotContent + object, name and namespace of the VolumeSnapshot object MUST be + provided for binding to happen. This field is immutable after creation. + Required. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -345,7 +398,8 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' @@ -361,14 +415,27 @@ spec: description: status represents the current information of a snapshot. properties: creationTime: - description: creationTime is the timestamp when the point-in-time snapshot is taken by the underlying storage system. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "creation_time" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "creation_time" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. If not specified, it indicates the creation time is unknown. The format of this field is a Unix nanoseconds time encoded as an int64. On Unix, the command `date +%s%N` returns the current time in nanoseconds since 1970-01-01 00:00:00 UTC. + description: creationTime is the timestamp when the point-in-time + snapshot is taken by the underlying storage system. In dynamic snapshot + creation case, this field will be filled in by the CSI snapshotter + sidecar with the "creation_time" value returned from CSI "CreateSnapshot" + gRPC call. For a pre-existing snapshot, this field will be filled + with the "creation_time" value returned from the CSI "ListSnapshots" + gRPC call if the driver supports it. If not specified, it indicates + the creation time is unknown. The format of this field is a Unix + nanoseconds time encoded as an int64. On Unix, the command `date + +%s%N` returns the current time in nanoseconds since 1970-01-01 + 00:00:00 UTC. format: int64 type: integer error: - description: error is the last observed error during snapshot creation, if any. Upon success after retry, this error field will be cleared. + description: error is the last observed error during snapshot creation, + if any. Upon success after retry, this error field will be cleared. properties: message: - description: 'message is a string detailing the encountered error during snapshot creation if specified. NOTE: message may be logged, and it should not contain sensitive information.' + description: 'message is a string detailing the encountered error + during snapshot creation if specified. NOTE: message may be + logged, and it should not contain sensitive information.' type: string time: description: time is the timestamp when the error was encountered. @@ -376,15 +443,34 @@ spec: type: string type: object readyToUse: - description: readyToUse indicates if a snapshot is ready to be used to restore a volume. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "ready_to_use" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "ready_to_use" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it, otherwise, this field will be set to "True". If not specified, it means the readiness of a snapshot is unknown. + description: readyToUse indicates if a snapshot is ready to be used + to restore a volume. In dynamic snapshot creation case, this field + will be filled in by the CSI snapshotter sidecar with the "ready_to_use" + value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing + snapshot, this field will be filled with the "ready_to_use" value + returned from the CSI "ListSnapshots" gRPC call if the driver supports + it, otherwise, this field will be set to "True". If not specified, + it means the readiness of a snapshot is unknown. type: boolean restoreSize: - description: restoreSize represents the complete size of the snapshot in bytes. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "size_bytes" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "size_bytes" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. When restoring a volume from this snapshot, the size of the volume MUST NOT be smaller than the restoreSize if it is specified, otherwise the restoration will fail. If not specified, it indicates that the size is unknown. + description: restoreSize represents the complete size of the snapshot + in bytes. In dynamic snapshot creation case, this field will be + filled in by the CSI snapshotter sidecar with the "size_bytes" value + returned from CSI "CreateSnapshot" gRPC call. For a pre-existing + snapshot, this field will be filled with the "size_bytes" value + returned from the CSI "ListSnapshots" gRPC call if the driver supports + it. When restoring a volume from this snapshot, the size of the + volume MUST NOT be smaller than the restoreSize if it is specified, + otherwise the restoration will fail. If not specified, it indicates + that the size is unknown. format: int64 minimum: 0 type: integer snapshotHandle: - description: snapshotHandle is the CSI "snapshot_id" of a snapshot on the underlying storage system. If not specified, it indicates that dynamic snapshot creation has either failed or it is still in progress. + description: snapshotHandle is the CSI "snapshot_id" of a snapshot + on the underlying storage system. If not specified, it indicates + that dynamic snapshot creation has either failed or it is still + in progress. type: string type: object required: @@ -393,11 +479,12 @@ spec: served: false storage: false subresources: - status: { } + status: {} status: acceptedNames: kind: "" plural: "" - conditions: [ ] - storedVersions: [ ] -{{- end }} + conditions: [] + storedVersions: [] +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/deploy/helm/charts/templates/volumesnapshots-crd.yaml b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot.yaml similarity index 57% rename from deploy/helm/charts/templates/volumesnapshots-crd.yaml rename to deploy/helm/charts/charts/crds/templates/csi-volume-snapshot.yaml index d262fbd5..ee0920e3 100644 --- a/deploy/helm/charts/templates/volumesnapshots-crd.yaml +++ b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot.yaml @@ -1,11 +1,12 @@ -{{- if .Values.crd.volumeSnapshot }} ---- +{{- if and .Values.volumeSnapshots.enabled .Values.volumeSnapshots.snapshotsEnabled -}} +{{- $crdName := "volumesnapshots.snapshot.storage.k8s.io" -}} +{{- if (include "crdIsAbsent" (list $crdName)) -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: + api-approved.kubernetes.io: https://github.com/kubernetes-csi/external-snapshotter/pull/814 controller-gen.kubebuilder.io/version: v0.11.3 - api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814" creationTimestamp: null name: volumesnapshots.snapshot.storage.k8s.io spec: @@ -67,22 +68,27 @@ spec: 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' + 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' + 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 spec: description: 'spec defines the desired characteristics of a snapshot requested - by a user. More info: https://kubernetes.io/docs/concepts/storage/volume-snapshots#volumesnapshots - Required.' + by a user. More info: https://kubernetes.io/docs/concepts/storage/volume-snapshots#volumesnapshots + Required.' properties: source: description: source specifies where a snapshot will be created from. This field is immutable after creation. Required. + oneOf: + - required: + - persistentVolumeClaimName + - required: + - volumeSnapshotContentName properties: persistentVolumeClaimName: description: persistentVolumeClaimName specifies the name of the @@ -100,21 +106,18 @@ spec: is immutable. type: string type: object - oneOf: - - required: ["persistentVolumeClaimName"] - - required: ["volumeSnapshotContentName"] volumeSnapshotClassName: description: 'VolumeSnapshotClassName is the name of the VolumeSnapshotClass - requested by the VolumeSnapshot. VolumeSnapshotClassName may be - left nil to indicate that the default SnapshotClass should be used. - A given cluster may have multiple default Volume SnapshotClasses: - one default per CSI Driver. If a VolumeSnapshot does not specify - a SnapshotClass, VolumeSnapshotSource will be checked to figure - out what the associated CSI Driver is, and the default VolumeSnapshotClass - associated with that CSI Driver will be used. If more than one VolumeSnapshotClass - exist for a given CSI Driver and more than one have been marked - as default, CreateSnapshot will fail and generate an event. Empty - string is not allowed for this field.' + requested by the VolumeSnapshot. VolumeSnapshotClassName may be + left nil to indicate that the default SnapshotClass should be used. + A given cluster may have multiple default Volume SnapshotClasses: + one default per CSI Driver. If a VolumeSnapshot does not specify + a SnapshotClass, VolumeSnapshotSource will be checked to figure + out what the associated CSI Driver is, and the default VolumeSnapshotClass + associated with that CSI Driver will be used. If more than one VolumeSnapshotClass + exist for a given CSI Driver and more than one have been marked + as default, CreateSnapshot will fail and generate an event. Empty + string is not allowed for this field.' type: string required: - source @@ -127,13 +130,13 @@ spec: properties: boundVolumeSnapshotContentName: description: 'boundVolumeSnapshotContentName is the name of the VolumeSnapshotContent - object to which this VolumeSnapshot object intends to bind to. If - not specified, it indicates that the VolumeSnapshot object has not - been successfully bound to a VolumeSnapshotContent object yet. NOTE: - To avoid possible security issues, consumers must verify binding - between VolumeSnapshot and VolumeSnapshotContent objects is successful - (by validating that both VolumeSnapshot and VolumeSnapshotContent - point at each other) before using this object.' + object to which this VolumeSnapshot object intends to bind to. If + not specified, it indicates that the VolumeSnapshot object has not + been successfully bound to a VolumeSnapshotContent object yet. NOTE: + To avoid possible security issues, consumers must verify binding + between VolumeSnapshot and VolumeSnapshotContent objects is successful + (by validating that both VolumeSnapshot and VolumeSnapshotContent + point at each other) before using this object.' type: string creationTime: description: creationTime is the timestamp when the point-in-time @@ -157,8 +160,8 @@ spec: properties: message: description: 'message is a string detailing the encountered error - during snapshot creation if specified. NOTE: message may be - logged, and it should not contain sensitive information.' + during snapshot creation if specified. NOTE: message may be + logged, and it should not contain sensitive information.' type: string time: description: time is the timestamp when the error was encountered. @@ -176,7 +179,6 @@ spec: it means the readiness of a snapshot is unknown. type: boolean restoreSize: - type: string description: restoreSize represents the minimum size of volume required to create a volume from this snapshot. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with @@ -188,6 +190,7 @@ spec: if it is specified, otherwise the restoration will fail. If not specified, it indicates that the size is unknown. pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + type: string x-kubernetes-int-or-string: true volumeGroupSnapshotName: description: VolumeGroupSnapshotName is the name of the VolumeGroupSnapshot @@ -206,15 +209,18 @@ spec: jsonPath: .status.readyToUse name: ReadyToUse type: boolean - - description: If a new snapshot needs to be created, this contains the name of the source PVC from which this snapshot was (or will be) created. + - description: If a new snapshot needs to be created, this contains the name of + the source PVC from which this snapshot was (or will be) created. jsonPath: .spec.source.persistentVolumeClaimName name: SourcePVC type: string - - description: If a snapshot already exists, this contains the name of the existing VolumeSnapshotContent object representing the existing snapshot. + - description: If a snapshot already exists, this contains the name of the existing + VolumeSnapshotContent object representing the existing snapshot. jsonPath: .spec.source.volumeSnapshotContentName name: SourceSnapshotContent type: string - - description: Represents the minimum size of volume required to rehydrate from this snapshot. + - description: Represents the minimum size of volume required to rehydrate from + this snapshot. jsonPath: .status.restoreSize name: RestoreSize type: string @@ -222,67 +228,122 @@ spec: jsonPath: .spec.volumeSnapshotClassName name: SnapshotClass type: string - - description: Name of the VolumeSnapshotContent object to which the VolumeSnapshot object intends to bind to. Please note that verification of binding actually requires checking both VolumeSnapshot and VolumeSnapshotContent to ensure both are pointing at each other. Binding MUST be verified prior to usage of this object. + - description: Name of the VolumeSnapshotContent object to which the VolumeSnapshot + object intends to bind to. Please note that verification of binding actually + requires checking both VolumeSnapshot and VolumeSnapshotContent to ensure + both are pointing at each other. Binding MUST be verified prior to usage of + this object. jsonPath: .status.boundVolumeSnapshotContentName name: SnapshotContent type: string - - description: Timestamp when the point-in-time snapshot was taken by the underlying storage system. + - description: Timestamp when the point-in-time snapshot was taken by the underlying + storage system. jsonPath: .status.creationTime name: CreationTime type: date - jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1beta1 - # This indicates the v1beta1 version of the custom resource is deprecated. - # API requests to this version receive a warning in the server response. deprecated: true - # This overrides the default warning returned to clients making v1beta1 API requests. - deprecationWarning: "snapshot.storage.k8s.io/v1beta1 VolumeSnapshot is deprecated; use snapshot.storage.k8s.io/v1 VolumeSnapshot" + deprecationWarning: snapshot.storage.k8s.io/v1beta1 VolumeSnapshot is deprecated; + use snapshot.storage.k8s.io/v1 VolumeSnapshot + name: v1beta1 schema: openAPIV3Schema: - description: VolumeSnapshot is a user's request for either creating a point-in-time snapshot of a persistent volume, or binding to a pre-existing snapshot. + description: VolumeSnapshot is a user's request for either creating a point-in-time + snapshot of a persistent volume, or binding to a pre-existing snapshot. 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' + 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' + 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 spec: - description: 'spec defines the desired characteristics of a snapshot requested by a user. More info: https://kubernetes.io/docs/concepts/storage/volume-snapshots#volumesnapshots Required.' + description: 'spec defines the desired characteristics of a snapshot requested + by a user. More info: https://kubernetes.io/docs/concepts/storage/volume-snapshots#volumesnapshots + Required.' properties: source: - description: source specifies where a snapshot will be created from. This field is immutable after creation. Required. + description: source specifies where a snapshot will be created from. + This field is immutable after creation. Required. properties: persistentVolumeClaimName: - description: persistentVolumeClaimName specifies the name of the PersistentVolumeClaim object representing the volume from which a snapshot should be created. This PVC is assumed to be in the same namespace as the VolumeSnapshot object. This field should be set if the snapshot does not exists, and needs to be created. This field is immutable. + description: persistentVolumeClaimName specifies the name of the + PersistentVolumeClaim object representing the volume from which + a snapshot should be created. This PVC is assumed to be in the + same namespace as the VolumeSnapshot object. This field should + be set if the snapshot does not exists, and needs to be created. + This field is immutable. type: string volumeSnapshotContentName: - description: volumeSnapshotContentName specifies the name of a pre-existing VolumeSnapshotContent object representing an existing volume snapshot. This field should be set if the snapshot already exists and only needs a representation in Kubernetes. This field is immutable. + description: volumeSnapshotContentName specifies the name of a + pre-existing VolumeSnapshotContent object representing an existing + volume snapshot. This field should be set if the snapshot already + exists and only needs a representation in Kubernetes. This field + is immutable. type: string type: object volumeSnapshotClassName: - description: 'VolumeSnapshotClassName is the name of the VolumeSnapshotClass requested by the VolumeSnapshot. VolumeSnapshotClassName may be left nil to indicate that the default SnapshotClass should be used. A given cluster may have multiple default Volume SnapshotClasses: one default per CSI Driver. If a VolumeSnapshot does not specify a SnapshotClass, VolumeSnapshotSource will be checked to figure out what the associated CSI Driver is, and the default VolumeSnapshotClass associated with that CSI Driver will be used. If more than one VolumeSnapshotClass exist for a given CSI Driver and more than one have been marked as default, CreateSnapshot will fail and generate an event. Empty string is not allowed for this field.' + description: 'VolumeSnapshotClassName is the name of the VolumeSnapshotClass + requested by the VolumeSnapshot. VolumeSnapshotClassName may be + left nil to indicate that the default SnapshotClass should be used. + A given cluster may have multiple default Volume SnapshotClasses: + one default per CSI Driver. If a VolumeSnapshot does not specify + a SnapshotClass, VolumeSnapshotSource will be checked to figure + out what the associated CSI Driver is, and the default VolumeSnapshotClass + associated with that CSI Driver will be used. If more than one VolumeSnapshotClass + exist for a given CSI Driver and more than one have been marked + as default, CreateSnapshot will fail and generate an event. Empty + string is not allowed for this field.' type: string required: - source type: object status: - description: status represents the current information of a snapshot. Consumers must verify binding between VolumeSnapshot and VolumeSnapshotContent objects is successful (by validating that both VolumeSnapshot and VolumeSnapshotContent point at each other) before using this object. + description: status represents the current information of a snapshot. + Consumers must verify binding between VolumeSnapshot and VolumeSnapshotContent + objects is successful (by validating that both VolumeSnapshot and VolumeSnapshotContent + point at each other) before using this object. properties: boundVolumeSnapshotContentName: - description: 'boundVolumeSnapshotContentName is the name of the VolumeSnapshotContent object to which this VolumeSnapshot object intends to bind to. If not specified, it indicates that the VolumeSnapshot object has not been successfully bound to a VolumeSnapshotContent object yet. NOTE: To avoid possible security issues, consumers must verify binding between VolumeSnapshot and VolumeSnapshotContent objects is successful (by validating that both VolumeSnapshot and VolumeSnapshotContent point at each other) before using this object.' + description: 'boundVolumeSnapshotContentName is the name of the VolumeSnapshotContent + object to which this VolumeSnapshot object intends to bind to. If + not specified, it indicates that the VolumeSnapshot object has not + been successfully bound to a VolumeSnapshotContent object yet. NOTE: + To avoid possible security issues, consumers must verify binding + between VolumeSnapshot and VolumeSnapshotContent objects is successful + (by validating that both VolumeSnapshot and VolumeSnapshotContent + point at each other) before using this object.' type: string creationTime: - description: creationTime is the timestamp when the point-in-time snapshot is taken by the underlying storage system. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "creation_time" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "creation_time" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. If not specified, it may indicate that the creation time of the snapshot is unknown. + description: creationTime is the timestamp when the point-in-time + snapshot is taken by the underlying storage system. In dynamic snapshot + creation case, this field will be filled in by the snapshot controller + with the "creation_time" value returned from CSI "CreateSnapshot" + gRPC call. For a pre-existing snapshot, this field will be filled + with the "creation_time" value returned from the CSI "ListSnapshots" + gRPC call if the driver supports it. If not specified, it may indicate + that the creation time of the snapshot is unknown. format: date-time type: string error: - description: error is the last observed error during snapshot creation, if any. This field could be helpful to upper level controllers(i.e., application controller) to decide whether they should continue on waiting for the snapshot to be created based on the type of error reported. The snapshot controller will keep retrying when an error occurs during the snapshot creation. Upon success, this error field will be cleared. + description: error is the last observed error during snapshot creation, + if any. This field could be helpful to upper level controllers(i.e., + application controller) to decide whether they should continue on + waiting for the snapshot to be created based on the type of error + reported. The snapshot controller will keep retrying when an error + occurs during the snapshot creation. Upon success, this error field + will be cleared. properties: message: - description: 'message is a string detailing the encountered error during snapshot creation if specified. NOTE: message may be logged, and it should not contain sensitive information.' + description: 'message is a string detailing the encountered error + during snapshot creation if specified. NOTE: message may be + logged, and it should not contain sensitive information.' type: string time: description: time is the timestamp when the error was encountered. @@ -290,12 +351,28 @@ spec: type: string type: object readyToUse: - description: readyToUse indicates if the snapshot is ready to be used to restore a volume. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "ready_to_use" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "ready_to_use" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it, otherwise, this field will be set to "True". If not specified, it means the readiness of a snapshot is unknown. + description: readyToUse indicates if the snapshot is ready to be used + to restore a volume. In dynamic snapshot creation case, this field + will be filled in by the snapshot controller with the "ready_to_use" + value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing + snapshot, this field will be filled with the "ready_to_use" value + returned from the CSI "ListSnapshots" gRPC call if the driver supports + it, otherwise, this field will be set to "True". If not specified, + it means the readiness of a snapshot is unknown. type: boolean restoreSize: - type: string - description: restoreSize represents the minimum size of volume required to create a volume from this snapshot. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "size_bytes" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "size_bytes" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. When restoring a volume from this snapshot, the size of the volume MUST NOT be smaller than the restoreSize if it is specified, otherwise the restoration will fail. If not specified, it indicates that the size is unknown. + description: restoreSize represents the minimum size of volume required + to create a volume from this snapshot. In dynamic snapshot creation + case, this field will be filled in by the snapshot controller with + the "size_bytes" value returned from CSI "CreateSnapshot" gRPC call. + For a pre-existing snapshot, this field will be filled with the + "size_bytes" value returned from the CSI "ListSnapshots" gRPC call + if the driver supports it. When restoring a volume from this snapshot, + the size of the volume MUST NOT be smaller than the restoreSize + if it is specified, otherwise the restoration will fail. If not + specified, it indicates that the size is unknown. pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + type: string x-kubernetes-int-or-string: true type: object required: @@ -311,4 +388,5 @@ status: plural: "" conditions: [] storedVersions: [] -{{- end }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/deploy/helm/charts/crds/lvmnode.yaml b/deploy/helm/charts/charts/crds/templates/lvmnode.yaml similarity index 97% rename from deploy/helm/charts/crds/lvmnode.yaml rename to deploy/helm/charts/charts/crds/templates/lvmnode.yaml index cf321392..cd8df2b6 100644 --- a/deploy/helm/charts/crds/lvmnode.yaml +++ b/deploy/helm/charts/charts/crds/templates/lvmnode.yaml @@ -1,5 +1,6 @@ - - +{{- if .Values.lvmNodes.enabled -}} +{{- $crdName := "lvmnodes.local.openebs.io" -}} +{{- if (include "crdIsAbsent" (list $crdName)) -}} ############################################## ########### ############ ########### LVMNode CRD ############ @@ -175,3 +176,5 @@ status: plural: "" conditions: [] storedVersions: [] +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/deploy/helm/charts/crds/lvmsnapshot.yaml b/deploy/helm/charts/charts/crds/templates/lvmsnapshot.yaml similarity index 94% rename from deploy/helm/charts/crds/lvmsnapshot.yaml rename to deploy/helm/charts/charts/crds/templates/lvmsnapshot.yaml index 2dc5164b..13ba42d2 100644 --- a/deploy/helm/charts/crds/lvmsnapshot.yaml +++ b/deploy/helm/charts/charts/crds/templates/lvmsnapshot.yaml @@ -1,5 +1,6 @@ - - +{{- if .Values.lvmSnapshots.enabled -}} +{{- $crdName := "lvmsnapshots.local.openebs.io" -}} +{{- if (include "crdIsAbsent" (list $crdName)) -}} ############################################## ########### ############ ########### LVMSnapshot CRD ############ @@ -83,3 +84,5 @@ status: plural: "" conditions: [] storedVersions: [] +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/deploy/helm/charts/crds/lvmvolume.yaml b/deploy/helm/charts/charts/crds/templates/lvmvolume.yaml similarity index 97% rename from deploy/helm/charts/crds/lvmvolume.yaml rename to deploy/helm/charts/charts/crds/templates/lvmvolume.yaml index 61b78125..55b0bd12 100644 --- a/deploy/helm/charts/crds/lvmvolume.yaml +++ b/deploy/helm/charts/charts/crds/templates/lvmvolume.yaml @@ -1,5 +1,6 @@ - - +{{- if .Values.lvmVolumes.enabled -}} +{{- $crdName := "lvmvolumes.local.openebs.io" -}} +{{- if (include "crdIsAbsent" (list $crdName)) -}} ############################################## ########### ############ ########### LVMVolume CRD ############ @@ -151,3 +152,5 @@ status: plural: "" conditions: [] storedVersions: [] +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/deploy/helm/charts/charts/crds/values.yaml b/deploy/helm/charts/charts/crds/values.yaml new file mode 100644 index 00000000..7f1ab627 --- /dev/null +++ b/deploy/helm/charts/charts/crds/values.yaml @@ -0,0 +1,21 @@ +lvmNodes: + # -- Install ZfsNode CRD + enabled: true + +lvmSnapshots: + # -- Install ZfsSnapshot CRD + enabled: true + +lvmVolumes: + # -- Install ZfsVolume CRD + enabled: true + +volumeSnapshots: + # -- Install Volume Snapshot CRDs + enabled: true + # -- Install volumesnapshots.snapshot.storage.k8s.io CRD + snapshotsEnabled: true + # -- Install volumesnapshotclasses.snapshot.storage.k8s.io CRD + snapshotClassesEnabled: true + # -- Install volumesnapshotcontents.snapshot.storage.k8s.io CRD + snapshotContentsEnabled: true \ No newline at end of file diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index ea2be28d..6ff068fc 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -2,7 +2,7 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. release: - version: "1.4.0" + version: "1.5.0" imagePullSecrets: # - name: "image-pull-secret" @@ -149,7 +149,7 @@ lvmPlugin: repository: openebs/lvm-driver pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: 1.4.0 + tag: 1.5.0 ioLimits: enabled: false containerRuntime: containerd @@ -186,3 +186,19 @@ serviceAccount: analytics: enabled: true + +crds: + # Enable/Disable all CRDs + enabled: true + lvmNodes: + # -- Install ZfsNode CRD + enabled: true + lvmSnapshots: + # -- Install ZfsSnapshot CRD + enabled: true + lvmVolumes: + # -- Install ZfsVolume CRD + enabled: true + volumeSnapshots: + # -- Install Volume Snapshot CRDs + enabled: true From cdd67546c716453e616e1bb1aecc5b22a84bfe76 Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Mon, 11 Dec 2023 13:10:55 +0800 Subject: [PATCH 3/9] remove useless crd.enableInstall variable Signed-off-by: Jeffrey Zhang Signed-off-by: Niladri Halder --- deploy/helm/charts/values.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index 6ff068fc..b2ede64f 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -165,7 +165,6 @@ lvmPlugin: role: openebs-lvm crd: - enableInstall: true # Specify installation of the kubernetes-csi volume snapshot CRDs if your Kubernetes distribution # or another storage operator already manages them. volumeSnapshot: true From 04c0e01ed1b771dad68b5461e33d084a224b360e Mon Sep 17 00:00:00 2001 From: Niladri Halder Date: Mon, 18 Mar 2024 10:45:39 +0530 Subject: [PATCH 4/9] revert(charts): remove stale crd.volumeSnashots option Signed-off-by: Niladri Halder --- deploy/helm/charts/values.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index b2ede64f..c3e4badc 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -164,11 +164,6 @@ lvmPlugin: role: openebs-lvm -crd: - # Specify installation of the kubernetes-csi volume snapshot CRDs if your Kubernetes distribution - # or another storage operator already manages them. - volumeSnapshot: true - serviceAccount: lvmController: # Specifies whether a service account should be created From 1fb79ca46f8de96175a5b7df8913f1d1eed4bf76 Mon Sep 17 00:00:00 2001 From: Abhinandan Purkait Date: Wed, 10 Jan 2024 09:26:22 +0000 Subject: [PATCH 5/9] feat(charts): disable hostNetwork on node plugin Signed-off-by: Abhinandan Purkait Signed-off-by: Niladri Halder --- deploy/helm/charts/templates/lvm-node.yaml | 2 +- deploy/helm/charts/templates/psp.yaml | 2 +- deploy/helm/charts/values.yaml | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy/helm/charts/templates/lvm-node.yaml b/deploy/helm/charts/templates/lvm-node.yaml index 13e6b191..23071ec9 100644 --- a/deploy/helm/charts/templates/lvm-node.yaml +++ b/deploy/helm/charts/templates/lvm-node.yaml @@ -30,7 +30,7 @@ spec: priorityClassName: {{ template "lvmlocalpv.lvmNode.priorityClassName" . }} {{- end }} serviceAccountName: {{ .Values.serviceAccount.lvmNode.name }} - hostNetwork: true + hostNetwork: {{ .Values.lvmNode.hostNetwork }} containers: - name: {{ .Values.lvmNode.driverRegistrar.name }} image: "{{ .Values.lvmNode.driverRegistrar.image.registry }}{{ .Values.lvmNode.driverRegistrar.image.repository }}:{{ .Values.lvmNode.driverRegistrar.image.tag }}" diff --git a/deploy/helm/charts/templates/psp.yaml b/deploy/helm/charts/templates/psp.yaml index 7472d7c6..fbe2c598 100644 --- a/deploy/helm/charts/templates/psp.yaml +++ b/deploy/helm/charts/templates/psp.yaml @@ -10,7 +10,7 @@ spec: allowPrivilegeEscalation: true allowedCapabilities: ['*'] volumes: ['*'] - hostNetwork: true + hostNetwork: {{ .Values.lvmNode.hostNetwork}} hostIPC: true hostPID: true runAsUser: diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index c3e4badc..03fc95bb 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -61,6 +61,8 @@ lvmNode: # Configure the maximum number of queries allowed after # accounting for rolled over qps from previous seconds. burst: 0 + # Disable or enable the use of hostNetwork for the lvm node daemonset. + hostNetwork: false # lvmController contains the configurables for From 46b7061bd1365c719f652a1e49ca8dbfa0a61b90 Mon Sep 17 00:00:00 2001 From: Evgenii Tereshkov Date: Fri, 22 Sep 2023 21:28:08 +0700 Subject: [PATCH 6/9] Change lvm-controller's Kind from StatefulSet to Deployment (#196) Signed-off-by: Evgenii Tereshkov Signed-off-by: Niladri Halder --- changelogs/unreleased/999-evgkrsk | 1 + deploy/helm/charts/README.md | 25 ++++++++++--------- .../helm/charts/templates/lvm-controller.yaml | 7 ++++-- deploy/helm/charts/values.yaml | 6 ++--- 4 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 changelogs/unreleased/999-evgkrsk diff --git a/changelogs/unreleased/999-evgkrsk b/changelogs/unreleased/999-evgkrsk new file mode 100644 index 00000000..a7092cdc --- /dev/null +++ b/changelogs/unreleased/999-evgkrsk @@ -0,0 +1 @@ +Change lvm-controller's Kind from StatefulSet to Deployment (#196) \ No newline at end of file diff --git a/deploy/helm/charts/README.md b/deploy/helm/charts/README.md index 239c8c3d..334c4a2c 100644 --- a/deploy/helm/charts/README.md +++ b/deploy/helm/charts/README.md @@ -47,10 +47,10 @@ $ helm install [RELEASE_NAME] openebs-lvmlocalpv/lvm-localpv --namespace [NAMESP **Note:** If moving from the operator to helm -- Make sure the namespace provided in the helm install command is same as `LVM_NAMESPACE` (by default it is `openebs`) env in the controller statefulset. -- Before installing, clean up the stale statefulset and daemonset from `kube-system` namespace using the below commands +- Make sure the namespace provided in the helm install command is same as `LVM_NAMESPACE` (by default it is `openebs`) env in the controller deployment. +- Before installing, clean up the stale deployment and daemonset from `kube-system` namespace using the below commands ```sh -kubectl delete sts openebs-lvm-controller -n kube-system +kubectl delete deployment openebs-lvm-controller -n kube-system kubectl delete ds openebs-lvm-node -n kube-system ``` @@ -133,15 +133,16 @@ helm install openebs-lvmlocalpv openebs-lvmlocalpv/lvm-localpv --namespace opene | `lvmController.provisioner.image.repository` | Image repository for csi-provisioner | `sig-storage/csi-provisioner` | | `lvmController.provisioner.image.pullPolicy` | Image pull policy for csi-provisioner | `IfNotPresent` | | `lvmController.provisioner.image.tag` | Image tag for csi-provisioner | `v3.5.0` | -| `lvmController.updateStrategy.type` | Update strategy for lvm localpv controller statefulset | `RollingUpdate` | -| `lvmController.annotations` | Annotations for lvm localpv controller statefulset metadata | `""` | -| `lvmController.podAnnotations` | Annotations for lvm localpv controller statefulset's pods metadata | `""` | -| `lvmController.resources` | Resource and request and limit for lvm localpv controller statefulset containers | `""` | -| `lvmController.labels` | Labels for lvm localpv controller statefulset metadata | `""` | -| `lvmController.podLabels` | Appends labels to the lvm localpv controller statefulset pods | `""` | -| `lvmController.nodeSelector` | Nodeselector for lvm localpv controller statefulset pods | `""` | -| `lvmController.tolerations` | lvm localpv controller statefulset's pod toleration values | `""` | -| `lvmController.securityContext` | Seurity context for lvm localpv controller statefulset container | `""` | +| `lvmController.updateStrategy.type` | Update strategy for lvm localpv controller deployment | `RollingUpdate` | +| `lvmController.annotations` | Annotations for lvm localpv controller deployment metadata | `""` | +| `lvmController.podAnnotations` | Annotations for lvm localpv controller deployment's pods metadata | `""` | +| `lvmController.resources` | Resource and request and limit for lvm localpv controller deployment containers | `""` | +| `lvmController.labels` | Labels for lvm localpv controller deployment metadata | `""` | +| `lvmController.podLabels` | Appends labels to the lvm localpv controller deployment pods | `""` | +| `lvmController.nodeSelector` | Nodeselector for lvm localpv controller deployment pods | `""` | +| `lvmController.tolerations` | lvm localpv controller deployment's pod toleration values | `""` | +| `lvmController.topologySpreadConstraints` | lvm localpv controller deployment's pod topologySpreadConstraints values | `""` | +| `lvmController.securityContext` | Security context for lvm localpv controller deployment container | `""` | | `rbac.pspEnabled` | Enable PodSecurityPolicy | `false` | | `serviceAccount.lvmNode.create` | Create a service account for lvmnode or not | `true` | | `serviceAccount.lvmNode.name` | Name for the lvmnode service account | `openebs-lvm-node-sa` | diff --git a/deploy/helm/charts/templates/lvm-controller.yaml b/deploy/helm/charts/templates/lvm-controller.yaml index b5029971..e566119a 100644 --- a/deploy/helm/charts/templates/lvm-controller.yaml +++ b/deploy/helm/charts/templates/lvm-controller.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: name: {{ template "lvmlocalpv.fullname" . }}-controller {{- with .Values.lvmController.annotations }} @@ -11,7 +11,6 @@ spec: selector: matchLabels: {{- include "lvmlocalpv.lvmController.matchLabels" . | nindent 6 }} - serviceName: "{{ .Values.lvmController.serviceName }}" replicas: {{ .Values.lvmController.replicas }} template: metadata: @@ -157,3 +156,7 @@ spec: tolerations: {{ toYaml .Values.lvmController.tolerations | indent 8 }} {{- end }} +{{- if .Values.lvmController.topologySpreadConstraints }} + topologySpreadConstraints: +{{ toYaml .Values.lvmController.topologySpreadConstraints | indent 8 }} +{{- end }} diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index 03fc95bb..a322eafe 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -66,11 +66,10 @@ lvmNode: # lvmController contains the configurables for -# the lvm controller statefulset +# the lvm controller deployment lvmController: componentName: openebs-lvm-controller replicas: 1 - serviceName: openebs-lvm logLevel: 5 resizer: name: "csi-resizer" @@ -128,6 +127,7 @@ lvmController: name: openebs-lvm-controller nodeSelector: {} tolerations: [] + topologySpreadConstraints: [] securityContext: {} priorityClass: create: true @@ -141,7 +141,7 @@ lvmController: burst: 0 # lvmPlugin is the common csi container used by the -# controller statefulset and node daemonset +# controller deployment and node daemonset lvmPlugin: name: "openebs-lvm-plugin" image: From 2462879eb22a33042a374f77157f5eab51885659 Mon Sep 17 00:00:00 2001 From: Evgenii Tereshkov Date: Fri, 22 Sep 2023 21:49:55 +0700 Subject: [PATCH 7/9] Fix PR number in changelogs Signed-off-by: Evgenii Tereshkov Signed-off-by: Niladri Halder --- changelogs/unreleased/{999-evgkrsk => 258-evgkrsk} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelogs/unreleased/{999-evgkrsk => 258-evgkrsk} (100%) diff --git a/changelogs/unreleased/999-evgkrsk b/changelogs/unreleased/258-evgkrsk similarity index 100% rename from changelogs/unreleased/999-evgkrsk rename to changelogs/unreleased/258-evgkrsk From 8cc433278b1ee502a366c52ecbff2c8d8ca58e5f Mon Sep 17 00:00:00 2001 From: Niladri Halder Date: Tue, 19 Mar 2024 16:55:39 +0530 Subject: [PATCH 8/9] refactor(charts): simplify CRD helm chart values Signed-off-by: Niladri Halder --- deploy/helm/charts/Chart.yaml | 1 - deploy/helm/charts/README.md | 3 ++- .../templates/csi-volume-snapshot-class.yaml | 2 +- .../csi-volume-snapshot-content.yaml | 2 +- .../crds/templates/csi-volume-snapshot.yaml | 2 +- .../charts/charts/crds/templates/lvmnode.yaml | 2 +- .../charts/crds/templates/lvmsnapshot.yaml | 2 +- .../charts/crds/templates/lvmvolume.yaml | 2 +- deploy/helm/charts/charts/crds/values.yaml | 25 +++++-------------- deploy/helm/charts/values.yaml | 19 +++++--------- 10 files changed, 20 insertions(+), 40 deletions(-) diff --git a/deploy/helm/charts/Chart.yaml b/deploy/helm/charts/Chart.yaml index a83e6a13..7840d27c 100644 --- a/deploy/helm/charts/Chart.yaml +++ b/deploy/helm/charts/Chart.yaml @@ -17,7 +17,6 @@ sources: dependencies: - name: crds version: "1.5.0" - condition: crds.enabled maintainers: - name: prateekpandey14 email: prateek.pandey@mayadata.io diff --git a/deploy/helm/charts/README.md b/deploy/helm/charts/README.md index 334c4a2c..f2ff2227 100644 --- a/deploy/helm/charts/README.md +++ b/deploy/helm/charts/README.md @@ -96,7 +96,8 @@ helm install openebs-lvmlocalpv openebs-lvmlocalpv/lvm-localpv --namespace opene | Parameter | Description | Default | |-----------------------------------------------------|----------------------------------------------------------------------------------|-----------------------------------------| -| `imagePullSecrets` | Provides image pull secrect | `""` | +| `crds.csi.volumeSnapshots.enabled` | Enable/Disable installation of VolumeSnapshot-related CRDs | `true` | +| `imagePullSecrets` | Provides image pull secret | `""` | | `lvmPlugin.image.registry` | Registry for openebs-lvm-plugin image | `""` | | `lvmPlugin.image.repository` | Image repository for openebs-lvm-plugin | `openebs/lvm-driver` | | `lvmPlugin.image.pullPolicy` | Image pull policy for openebs-lvm-plugin | `IfNotPresent` | diff --git a/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-class.yaml b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-class.yaml index cab4fd52..93258c3d 100644 --- a/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-class.yaml +++ b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-class.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.volumeSnapshots.enabled .Values.volumeSnapshots.snapshotClassesEnabled -}} +{{- if .Values.csi.volumeSnapshots.enabled -}} {{- $crdName := "volumesnapshotclasses.snapshot.storage.k8s.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} apiVersion: apiextensions.k8s.io/v1 diff --git a/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-content.yaml b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-content.yaml index 50003db4..ee98aa67 100644 --- a/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-content.yaml +++ b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-content.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.volumeSnapshots.enabled .Values.volumeSnapshots.snapshotContentsEnabled -}} +{{- if .Values.csi.volumeSnapshots.enabled -}} {{- $crdName := "volumesnapshotcontents.snapshot.storage.k8s.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} apiVersion: apiextensions.k8s.io/v1 diff --git a/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot.yaml b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot.yaml index ee0920e3..1b9c8b69 100644 --- a/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot.yaml +++ b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.volumeSnapshots.enabled .Values.volumeSnapshots.snapshotsEnabled -}} +{{- if .Values.csi.volumeSnapshots.enabled -}} {{- $crdName := "volumesnapshots.snapshot.storage.k8s.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} apiVersion: apiextensions.k8s.io/v1 diff --git a/deploy/helm/charts/charts/crds/templates/lvmnode.yaml b/deploy/helm/charts/charts/crds/templates/lvmnode.yaml index cd8df2b6..ca801e0a 100644 --- a/deploy/helm/charts/charts/crds/templates/lvmnode.yaml +++ b/deploy/helm/charts/charts/crds/templates/lvmnode.yaml @@ -1,4 +1,4 @@ -{{- if .Values.lvmNodes.enabled -}} +{{- if .Values.lvmLocalPv.enabled -}} {{- $crdName := "lvmnodes.local.openebs.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} ############################################## diff --git a/deploy/helm/charts/charts/crds/templates/lvmsnapshot.yaml b/deploy/helm/charts/charts/crds/templates/lvmsnapshot.yaml index 13ba42d2..115e7002 100644 --- a/deploy/helm/charts/charts/crds/templates/lvmsnapshot.yaml +++ b/deploy/helm/charts/charts/crds/templates/lvmsnapshot.yaml @@ -1,4 +1,4 @@ -{{- if .Values.lvmSnapshots.enabled -}} +{{- if .Values.lvmLocalPv.enabled -}} {{- $crdName := "lvmsnapshots.local.openebs.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} ############################################## diff --git a/deploy/helm/charts/charts/crds/templates/lvmvolume.yaml b/deploy/helm/charts/charts/crds/templates/lvmvolume.yaml index 55b0bd12..bdb18cbc 100644 --- a/deploy/helm/charts/charts/crds/templates/lvmvolume.yaml +++ b/deploy/helm/charts/charts/crds/templates/lvmvolume.yaml @@ -1,4 +1,4 @@ -{{- if .Values.lvmVolumes.enabled -}} +{{- if .Values.lvmLocalPv.enabled -}} {{- $crdName := "lvmvolumes.local.openebs.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} ############################################## diff --git a/deploy/helm/charts/charts/crds/values.yaml b/deploy/helm/charts/charts/crds/values.yaml index 7f1ab627..ddfb7cf2 100644 --- a/deploy/helm/charts/charts/crds/values.yaml +++ b/deploy/helm/charts/charts/crds/values.yaml @@ -1,21 +1,8 @@ -lvmNodes: - # -- Install ZfsNode CRD +lvmLocalPv: + # Install lvm-localpv CRDs enabled: true -lvmSnapshots: - # -- Install ZfsSnapshot CRD - enabled: true - -lvmVolumes: - # -- Install ZfsVolume CRD - enabled: true - -volumeSnapshots: - # -- Install Volume Snapshot CRDs - enabled: true - # -- Install volumesnapshots.snapshot.storage.k8s.io CRD - snapshotsEnabled: true - # -- Install volumesnapshotclasses.snapshot.storage.k8s.io CRD - snapshotClassesEnabled: true - # -- Install volumesnapshotcontents.snapshot.storage.k8s.io CRD - snapshotContentsEnabled: true \ No newline at end of file +csi: + volumeSnapshots: + # Install Volume Snapshot CRDs + enabled: true diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index a322eafe..7f6bb54d 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -184,17 +184,10 @@ analytics: enabled: true crds: - # Enable/Disable all CRDs - enabled: true - lvmNodes: - # -- Install ZfsNode CRD - enabled: true - lvmSnapshots: - # -- Install ZfsSnapshot CRD - enabled: true - lvmVolumes: - # -- Install ZfsVolume CRD - enabled: true - volumeSnapshots: - # -- Install Volume Snapshot CRDs + lvmLocalPv: + # Install lvm-localpv CRDs enabled: true + csi: + volumeSnapshots: + # Install Volume Snapshot CRDs + enabled: true From a1d4915820cf37dc950012dd1efb54ce8858c338 Mon Sep 17 00:00:00 2001 From: Niladri Halder Date: Tue, 19 Mar 2024 20:03:50 +0530 Subject: [PATCH 9/9] doc: replace sts for deploy in chart README.md Signed-off-by: Niladri Halder --- upgrade/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upgrade/README.md b/upgrade/README.md index fbc70883..d060aa23 100644 --- a/upgrade/README.md +++ b/upgrade/README.md @@ -3,7 +3,7 @@ Please do not provision/deprovision any volumes during the upgrade, if we can not control it, then we can scale down the openebs-lvm-controller stateful set to zero replica which will pause all the provisioning/deprovisioning request. And once upgrade is done, we can scale up the controller pod and then volume provisioning/deprovisioning will resume on the upgraded system. ``` -$ kubectl edit sts openebs-lvm-controller -n kube-system +$ kubectl edit deploy openebs-lvm-controller -n kube-system ``` And set replicas to zero :