From 41f0c2ea7bbe20dc5e70089598d5a85ce9ae12d3 Mon Sep 17 00:00:00 2001 From: Mario Valderrama Date: Wed, 22 May 2024 18:37:00 +0200 Subject: [PATCH] Provide helm chart for CSI driver --- .../.helmignore | 25 ++ .../Chart.yaml | 17 + .../README.md | 210 +++++++++ .../README.md.gotmpl | 70 +++ ....storage.k8s.io_volumesnapshotclasses.yaml | 134 ++++++ ...storage.k8s.io_volumesnapshotcontents.yaml | 401 ++++++++++++++++++ ...apshot.storage.k8s.io_volumesnapshots.yaml | 312 ++++++++++++++ .../templates/NOTES.txt | 1 + .../templates/_helpers.tpl | 110 +++++ .../templates/csidriver.yaml | 10 + .../templates/daemonset.yaml | 152 +++++++ .../templates/deployment.yaml | 190 +++++++++ .../templates/podmonitor.yaml | 28 ++ .../templates/rbac/clusterrole.yaml | 60 +++ .../templates/rbac/clusterrolebinding.yaml | 15 + .../templates/rbac/role.yaml | 13 + .../templates/rbac/rolebinding.yaml | 17 + .../templates/serviceaccount.yaml | 14 + .../templates/storageclass.yaml | 54 +++ .../templates/volumesnapshotclass.yaml | 16 + .../values.yaml | 316 ++++++++++++++ 21 files changed, 2165 insertions(+) create mode 100644 charts/ionoscloud-blockstorage-csi-driver/.helmignore create mode 100644 charts/ionoscloud-blockstorage-csi-driver/Chart.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/README.md create mode 100644 charts/ionoscloud-blockstorage-csi-driver/README.md.gotmpl create mode 100644 charts/ionoscloud-blockstorage-csi-driver/crds/snapshot.storage.k8s.io_volumesnapshotclasses.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/crds/snapshot.storage.k8s.io_volumesnapshotcontents.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/crds/snapshot.storage.k8s.io_volumesnapshots.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/NOTES.txt create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/_helpers.tpl create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/csidriver.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/daemonset.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/deployment.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/podmonitor.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/rbac/clusterrole.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/rbac/clusterrolebinding.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/rbac/role.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/rbac/rolebinding.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/serviceaccount.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/storageclass.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/templates/volumesnapshotclass.yaml create mode 100644 charts/ionoscloud-blockstorage-csi-driver/values.yaml diff --git a/charts/ionoscloud-blockstorage-csi-driver/.helmignore b/charts/ionoscloud-blockstorage-csi-driver/.helmignore new file mode 100644 index 0000000..350cdd8 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/.helmignore @@ -0,0 +1,25 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ +# Helm-docs template +*.gotmpl diff --git a/charts/ionoscloud-blockstorage-csi-driver/Chart.yaml b/charts/ionoscloud-blockstorage-csi-driver/Chart.yaml new file mode 100644 index 0000000..06ba267 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/Chart.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: v2 +name: ionoscloud-blockstorage-csi-driver +description: IONOS Cloud Container Storage Interface (CSI) driver. +type: application +keywords: + - csi + - ionos-cloud +version: 0.1.0 +appVersion: "1.6.0" +kubeVersion: ">=1.20.0-0" +home: https://github.com/ionos-cloud/ionoscloud-blockstorage-csi-driver +sources: + - https://github.com/ionos-cloud/ionoscloud-blockstorage-csi-driver +maintainers: + - name: avorima + url: https://github.com/avorima diff --git a/charts/ionoscloud-blockstorage-csi-driver/README.md b/charts/ionoscloud-blockstorage-csi-driver/README.md new file mode 100644 index 0000000..98d5652 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/README.md @@ -0,0 +1,210 @@ +# ionoscloud-blockstorage-csi-driver + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.6.0](https://img.shields.io/badge/AppVersion-1.6.0-informational?style=flat-square) + +IONOS Cloud Container Storage Interface (CSI) driver. + +**Homepage:** + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| avorima | | | + +## Source Code + +* + +The [Container Storage Interface][csi-spec] (CSI) driver plugin communicates with the [IONOS Cloud API][cloud-api] to manage storages. +The visibility and permissions it has depend on the authentication token it is given. + +Check out [this page][token-docs] to learn more about managing tokens. + +## Prerequisites + +* Kubernetes 1.20+ +* Helm 3+ + +Before installing create a secret that contains your IONOS Cloud authentication token: + +```console +kubectl -n kube-system create secret generic csi-secret --from-literal token= +``` + +The key **must** be named `token`. + +The CSI node server expects the file `/etc/ie-csi/cfg.json` to exist on every VM. +The file must contain the datacenter ID of the VM in the following format: + +```json +{"datacenter-id": ""} +``` + +## Installation + +Provide the secret name during installation: + +```console +helm install -n kube-system ionoscloud-csi-driver oci://ghcr.io/ionos-cloud/helm-charts/ionoscloud-csi-driver --set tokenSecretName=csi-secret +``` + +> [!IMPORTANT] +> Be aware that tokens have a limited liftime. The CSI controller deployment needs to restarted every time the token is updated. + +### Multi-tenancy setup + +The default settings of CSI driver helm chart are meant to be used in a single-tenancy manner. +Should you need to install multiple CSI drivers using tokens from the same users or contracts, e.g. if you manage more than 1 cluster, +you need to set the `clusterName` value on installation. + +```console +helm install -n kube-system ionoscloud-csi-driver oci://ghcr.io/ionos-cloud/helm-charts/ionoscloud-csi-driver \ + --set tokenSecretName=csi-secret --set clusterName=production +helm install -n kube-system ionoscloud-csi-driver oci://ghcr.io/ionos-cloud/helm-charts/ionoscloud-csi-driver \ + --set tokenSecretName=csi-secret --set clusterName=staging +``` + +> [!WARNING] +> The `clusterName` must not be changed after storage has already been provisioned. + +## Values + +### Attacher + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| attacher.extraArgs | object | `{"timeout":"270s"}` | Additional command-line arguments | +| attacher.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | +| attacher.image.repository | string | `"registry.k8s.io/sig-storage/csi-attacher"` | Image repository | +| attacher.image.tag | string | `"v4.5.1"` | Image tag | +| attacher.resources | object | `{"limits":{"memory":"100Mi"},"requests":{"cpu":"10m","memory":"25Mi"}}` | Resource requests and limits | + +### Daemonset + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| daemonset.affinity | object | `{}` | Affinity for Daemonset pods. | +| daemonset.imagePullSecrets | list | `[]` | List of image pull secret names for Daemonset pods. | +| daemonset.nodeSelector | object | `{}` | Node selector for Daemonset pods. | +| daemonset.podAnnotations | object | `{}` | Additional annotations for Daemonset pods. | +| daemonset.podLabels | object | `{}` | Additional labels for Daemonset pods. | +| daemonset.podSecurityContext | object | `{}` | Security context for Daemonset pods. | +| daemonset.tolerations | list | `[]` | Tolerations for Daemonset pods. | + +### Deployment + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| deployment.affinity | object | `{}` | Affinity for Deployment pods. | +| deployment.imagePullSecrets | list | `[]` | List of image pull secret names for Deployment pods. | +| deployment.nodeSelector | object | `{}` | Node selector for Deployment pods. | +| deployment.podAnnotations | object | `{}` | Additional annotations for Deployment pods. | +| deployment.podLabels | object | `{}` | Additional labels for Deployment pods. | +| deployment.podSecurityContext | object | `{}` | Security context for Deployment pods. | +| deployment.replicaCount | int | `1` | Number of Deployment pods. Setting this higher than 1 will enable leader election. | +| deployment.securityContext | object | `{"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true}` | Security context for Deployment containers. | +| deployment.tolerations | list | `[]` | Tolerations for Deployemnt pods. | + +### Controller server + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| driver.controller.extraArgs | object | `{}` | Additional command-line arguments | +| driver.controller.extraEnv | list | `[]` | Additional environment variables | +| driver.controller.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | +| driver.controller.image.repository | string | `"ghcr.io/ionos-cloud/ionoscloud-blockstorage-csi-driver"` | Image repository | +| driver.controller.image.tag | string | Defaults to appVersion | Image tag | +| driver.controller.resources | object | `{"limits":{"memory":"100Mi"},"requests":{"cpu":"10m","memory":"25Mi"}}` | Resource requests and limits | + +### Node server + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| driver.node.extraArgs | object | `{}` | Additional command-line arguments | +| driver.node.extraEnv | list | `[]` | Additional environment variables | +| driver.node.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | +| driver.node.image.repository | string | `"ghcr.io/ionos-cloud/ionoscloud-blockstorage-csi-driver"` | Image repository | +| driver.node.image.tag | string | Defaults to appVersion | Image tag | +| driver.node.resources | object | `{"limits":{"memory":"50Mi"},"requests":{"cpu":"10m","memory":"25Mi"}}` | Resource requests and limits | + +### Monitoring + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| monitoring.additionalLabels | object | `{}` | Additional labels for the PodMonitor. | +| monitoring.enabled | bool | `false` | If true, render Prometheus PodMonitor resource. | +| monitoring.nameOverride | string | `""` | Speciy name override for the PodMonitor. | +| monitoring.namespace | string | Release namespace | Specify namespace override for the PodMonitor. | +| monitoring.scrapeInterval | string | `"30s"` | Metrics scrape interval as duration string. | + +### Provisioner + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| provisioner.extraArgs | object | `{"timeout":"930s"}` | Additional command-line arguments | +| provisioner.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | +| provisioner.image.repository | string | `"registry.k8s.io/sig-storage/csi-provisioner"` | Image repository | +| provisioner.image.tag | string | `"v3.6.4"` | Image tag | +| provisioner.resources | object | `{"limits":{"memory":"100Mi"},"requests":{"cpu":"10m","memory":"25Mi"}}` | Resource requests and limits | + +### Node driver registrar + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| registrar.extraArgs | object | `{}` | Additional command-line arguments | +| registrar.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | +| registrar.image.repository | string | `"registry.k8s.io/sig-storage/csi-node-driver-registrar"` | Image repository | +| registrar.image.tag | string | `"v2.10.1"` | Image tag | +| registrar.resources | object | `{"limits":{"memory":"30Mi"},"requests":{"cpu":"10m","memory":"15Mi"}}` | Resource requests and limits | + +### Resizer + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| resizer.extraArgs | object | `{"timeout":"150s"}` | Additional command-line arguments | +| resizer.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | +| resizer.image.repository | string | `"registry.k8s.io/sig-storage/csi-resizer"` | Image repository | +| resizer.image.tag | string | `"v1.10.1"` | Image tag | +| resizer.resources | object | `{"limits":{"memory":"100Mi"},"requests":{"cpu":"10m","memory":"25Mi"}}` | Resource requests and limits | + +### Snapshot controller + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| snapshotController.extraArgs | object | `{}` | Additional command-line arguments | +| snapshotController.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | +| snapshotController.image.repository | string | `"registry.k8s.io/sig-storage/snapshot-controller"` | Image repository | +| snapshotController.image.tag | string | `"v6.3.4"` | Image tag | +| snapshotController.resources | object | `{"limits":{"memory":"100Mi"},"requests":{"cpu":"10m","memory":"25Mi"}}` | Resource requests and limits | + +### Snapshotter + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| snapshotter.extraArgs | object | `{"timeout":"300s"}` | Additional command-line arguments | +| snapshotter.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | +| snapshotter.image.repository | string | `"registry.k8s.io/sig-storage/csi-snapshotter"` | Image repository | +| snapshotter.image.tag | string | `"v6.3.4"` | Image tag | +| snapshotter.resources | object | `{"limits":{"memory":"100Mi"},"requests":{"cpu":"10m","memory":"25Mi"}}` | Resource requests and limits | + +### Other Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| className | string | `"ionos-cloud"` | Name of VolumeSnapshotClass. Also used as prefix for StorageClasses. | +| clusterName | string | `"k8s"` | Name used to identify managed storage resources. | +| driverName | string | `"cloud.ionos.com"` | Name of the driver in the storage class. | +| fullnameOverride | string | `""` | Specify a custom fullname override. This only influences Kubernetes resource names, not properties. | +| nameOverride | string | `""` | Specify a custom name override. This only influences Kubernetes resource names, not properties. | +| registry | string | Omit if empty | Specify a custom registry name that will be used as prefix for all images. Useful when pulling images from a registry mirror. | +| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | +| serviceAccount.automount | bool | `true` | Automatically mount a ServiceAccount's API credentials? | +| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | +| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | +| tokenSecretName | string | `""` | Name of the secret that contains the token used for cloud API authentication. Must contain the key "token". | + +[cloud-api]: https://api.ionos.com/docs/cloud/v6/ +[token-docs]: https://docs.ionos.com/cloud/getting-started/basic-tutorials/manage-authentication-tokens +[csi-spec]: https://github.com/container-storage-interface/spec +[block-storage-docs]: https://cloud.ionos.com/storage/block-storage diff --git a/charts/ionoscloud-blockstorage-csi-driver/README.md.gotmpl b/charts/ionoscloud-blockstorage-csi-driver/README.md.gotmpl new file mode 100644 index 0000000..9b4d38f --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/README.md.gotmpl @@ -0,0 +1,70 @@ +{{ template "chart.header" . }} + +{{ template "chart.badgesSection" . }} + +{{ template "chart.description" . }} + +{{ template "chart.homepageLine" . }} + +{{ template "chart.maintainersSection" . }} + +{{ template "chart.sourcesSection" . }} + +The [Container Storage Interface][csi-spec] (CSI) driver plugin communicates with the [IONOS Cloud API][cloud-api] to manage storages. +The visibility and permissions it has depend on the authentication token it is given. + +Check out [this page][token-docs] to learn more about managing tokens. + +## Prerequisites + +* Kubernetes 1.20+ +* Helm 3+ + +Before installing create a secret that contains your IONOS Cloud authentication token: + +```console +kubectl -n kube-system create secret generic csi-secret --from-literal token= +``` + +The key **must** be named `token`. + +The CSI node server expects the file `/etc/ie-csi/cfg.json` to exist on every VM. +The file must contain the datacenter ID of the VM in the following format: + +```json +{"datacenter-id": ""} +``` + +## Installation + +Provide the secret name during installation: + +```console +helm install -n kube-system ionoscloud-csi-driver oci://ghcr.io/ionos-cloud/helm-charts/ionoscloud-csi-driver --set tokenSecretName=csi-secret +``` + +> [!IMPORTANT] +> Be aware that tokens have a limited liftime. The CSI controller deployment needs to restarted every time the token is updated. + +### Multi-tenancy setup + +The default settings of CSI driver helm chart are meant to be used in a single-tenancy manner. +Should you need to install multiple CSI drivers using tokens from the same users or contracts, e.g. if you manage more than 1 cluster, +you need to set the `clusterName` value on installation. + +```console +helm install -n kube-system ionoscloud-csi-driver oci://ghcr.io/ionos-cloud/helm-charts/ionoscloud-csi-driver \ + --set tokenSecretName=csi-secret --set clusterName=production +helm install -n kube-system ionoscloud-csi-driver oci://ghcr.io/ionos-cloud/helm-charts/ionoscloud-csi-driver \ + --set tokenSecretName=csi-secret --set clusterName=staging +``` + +> [!WARNING] +> The `clusterName` must not be changed after storage has already been provisioned. + +{{ template "chart.valuesSection" . }} + +[cloud-api]: https://api.ionos.com/docs/cloud/v6/ +[token-docs]: https://docs.ionos.com/cloud/getting-started/basic-tutorials/manage-authentication-tokens +[csi-spec]: https://github.com/container-storage-interface/spec +[block-storage-docs]: https://cloud.ionos.com/storage/block-storage diff --git a/charts/ionoscloud-blockstorage-csi-driver/crds/snapshot.storage.k8s.io_volumesnapshotclasses.yaml b/charts/ionoscloud-blockstorage-csi-driver/crds/snapshot.storage.k8s.io_volumesnapshotclasses.yaml new file mode 100644 index 0000000..56a8e14 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/crds/snapshot.storage.k8s.io_volumesnapshotclasses.yaml @@ -0,0 +1,134 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + 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: + group: snapshot.storage.k8s.io + names: + kind: VolumeSnapshotClass + listKind: VolumeSnapshotClassList + plural: volumesnapshotclasses + shortNames: + - vsclass + - vsclasses + singular: volumesnapshotclass + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .driver + name: Driver + type: string + - 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: v1 + 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 + 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 + 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. + enum: + - Delete + - Retain + type: string + driver: + 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' + 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. + type: object + required: + - deletionPolicy + - driver + type: object + served: true + storage: true + subresources: {} + - additionalPrinterColumns: + - jsonPath: .driver + name: Driver + type: string + - 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" + 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 + 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 + 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. + enum: + - Delete + - Retain + type: string + driver: + 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' + 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. + type: object + required: + - deletionPolicy + - driver + type: object + served: false + storage: false + subresources: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/charts/ionoscloud-blockstorage-csi-driver/crds/snapshot.storage.k8s.io_volumesnapshotcontents.yaml b/charts/ionoscloud-blockstorage-csi-driver/crds/snapshot.storage.k8s.io_volumesnapshotcontents.yaml new file mode 100644 index 0000000..d6181ed --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/crds/snapshot.storage.k8s.io_volumesnapshotcontents.yaml @@ -0,0 +1,401 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + 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: + group: snapshot.storage.k8s.io + names: + kind: VolumeSnapshotContent + listKind: VolumeSnapshotContentList + plural: volumesnapshotcontents + shortNames: + - vsc + - vscs + singular: volumesnapshotcontent + scope: Cluster + versions: + - additionalPrinterColumns: + - description: Indicates if the snapshot is ready to be used to restore a volume. + jsonPath: .status.readyToUse + name: ReadyToUse + type: boolean + - description: Represents the complete size of the snapshot in bytes + 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. + jsonPath: .spec.deletionPolicy + name: DeletionPolicy + type: string + - description: Name of the CSI driver used to create the physical snapshot on + the underlying storage system. + jsonPath: .spec.driver + name: Driver + type: string + - description: Name of the VolumeSnapshotClass to which this snapshot belongs. + jsonPath: .spec.volumeSnapshotClassName + name: VolumeSnapshotClass + type: string + - 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. + jsonPath: .spec.volumeSnapshotRef.namespace + name: VolumeSnapshotNamespace + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1 + schema: + openAPIV3Schema: + 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' + 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 + spec: + 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. + 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. + 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. + 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. + 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. + 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, + it indicates the source volume's mode is unknown. This field is + immutable. This field is an alpha field. + type: string + 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. + 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. + 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.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + 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' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + x-kubernetes-map-type: atomic + required: + - deletionPolicy + - driver + - source + - volumeSnapshotRef + type: object + status: + 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. + 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. + 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.' + type: string + time: + description: time is the timestamp when the error was encountered. + format: date-time + 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. + 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. + 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. + type: string + volumeGroupSnapshotContentName: + description: VolumeGroupSnapshotContentName is the name of the VolumeGroupSnapshotContent + of which this VolumeSnapshotContent is a part of. + type: string + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} + - additionalPrinterColumns: + - description: Indicates if the snapshot is ready to be used to restore a volume. + jsonPath: .status.readyToUse + name: ReadyToUse + type: boolean + - description: Represents the complete size of the snapshot in bytes + 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. + jsonPath: .spec.deletionPolicy + name: DeletionPolicy + type: string + - description: Name of the CSI driver used to create the physical snapshot on the underlying storage system. + jsonPath: .spec.driver + name: Driver + type: string + - description: Name of the VolumeSnapshotClass to which this snapshot belongs. + jsonPath: .spec.volumeSnapshotClassName + name: VolumeSnapshotClass + type: string + - 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. + 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" + schema: + openAPIV3Schema: + 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' + 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 + spec: + 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. + 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. + 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. + 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. + 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. + 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. + 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. + 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.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + 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' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + required: + - deletionPolicy + - driver + - source + - volumeSnapshotRef + type: object + status: + 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. + 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. + 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.' + type: string + time: + description: time is the timestamp when the error was encountered. + format: date-time + 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. + 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. + 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. + type: string + type: object + required: + - spec + type: object + served: false + storage: false + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/charts/ionoscloud-blockstorage-csi-driver/crds/snapshot.storage.k8s.io_volumesnapshots.yaml b/charts/ionoscloud-blockstorage-csi-driver/crds/snapshot.storage.k8s.io_volumesnapshots.yaml new file mode 100644 index 0000000..3e7f996 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/crds/snapshot.storage.k8s.io_volumesnapshots.yaml @@ -0,0 +1,312 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + 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: + group: snapshot.storage.k8s.io + names: + kind: VolumeSnapshot + listKind: VolumeSnapshotList + plural: volumesnapshots + shortNames: + - vs + singular: volumesnapshot + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: Indicates if the snapshot is ready to be used to restore a volume. + 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. + 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. + jsonPath: .spec.source.volumeSnapshotContentName + name: SourceSnapshotContent + type: string + - description: Represents the minimum size of volume required to rehydrate from + this snapshot. + jsonPath: .status.restoreSize + name: RestoreSize + type: string + - description: The name of the VolumeSnapshotClass requested by the VolumeSnapshot. + 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. + jsonPath: .status.boundVolumeSnapshotContentName + name: SnapshotContent + type: string + - 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: v1 + 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. + 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 + 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.' + properties: + source: + 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. + 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. + 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.' + 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. + 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.' + 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. + 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. + 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.' + type: string + time: + description: time is the timestamp when the error was encountered. + format: date-time + 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. + 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. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + volumeGroupSnapshotName: + description: VolumeGroupSnapshotName is the name of the VolumeGroupSnapshot + of which this VolumeSnapshot is a part of. + type: string + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} + - additionalPrinterColumns: + - description: Indicates if the snapshot is ready to be used to restore a volume. + 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. + 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. + jsonPath: .spec.source.volumeSnapshotContentName + name: SourceSnapshotContent + type: string + - description: Represents the minimum size of volume required to rehydrate from this snapshot. + jsonPath: .status.restoreSize + name: RestoreSize + type: string + - description: The name of the VolumeSnapshotClass requested by the VolumeSnapshot. + 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. + jsonPath: .status.boundVolumeSnapshotContentName + name: SnapshotContent + type: string + - 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" + 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. + 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 + 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.' + properties: + source: + 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. + 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. + 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.' + 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. + 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.' + 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. + 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. + 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.' + type: string + time: + description: time is the timestamp when the error was encountered. + format: date-time + 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. + 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. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + required: + - spec + type: object + served: false + storage: false + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/NOTES.txt b/charts/ionoscloud-blockstorage-csi-driver/templates/NOTES.txt new file mode 100644 index 0000000..fca8dc9 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/NOTES.txt @@ -0,0 +1 @@ +echo "Installed IONOS Cloud block storage CSI driver" diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/_helpers.tpl b/charts/ionoscloud-blockstorage-csi-driver/templates/_helpers.tpl new file mode 100644 index 0000000..befed72 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/_helpers.tpl @@ -0,0 +1,110 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "csi-driver.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "csi-driver.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "csi-driver.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "csi-driver.labels" -}} +helm.sh/chart: {{ include "csi-driver.chart" . }} +{{ include "csi-driver.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "csi-driver.selectorLabels" -}} +app.kubernetes.io/name: {{ include "csi-driver.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Controller component labels +*/}} +{{- define "csi-driver.controllerComponentLabels" -}} +component: controller +{{- end }} + +{{/* +Node component labels +*/}} +{{- define "csi-driver.nodeComponentLabels" -}} +component: node +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "csi-driver.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "csi-driver.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Render container args from extraArgs. +*/}} +{{- define "csi-driver.extraArgs" -}} +{{- range $key, $value := .extraArgs }} +{{- if not (kindIs "invalid" $value) }} +- --{{ $key | mustRegexFind "^[^_]+" }}={{ $value }} +{{- else }} +- --{{ $key | mustRegexFind "^[^_]+" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Render default storage class annotation. +*/}} +{{- define "csi-driver.storageClassAnnotation" -}} +{{- $root := index . 0 }} +{{- $name := index . 1 }} +{{- $defaultValue := index . 2 }} +{{- if $root.Release.IsInstall }} +storageclass.kubernetes.io/is-default-class: "{{ $defaultValue }}" +{{- else }} +{{- $annotations := ((lookup "storage.k8s.io/v1" "StorageClass" "" $name).metadata).annotations }} +storageclass.kubernetes.io/is-default-class: {{ get $annotations "storageclass.kubernetes.io/is-default-class" | quote }} +{{- end }} +{{- end }} + +{{- define "image.registry" -}} +{{- if .Values.registry -}} +{{ .Values.registry }}/ +{{- end -}} +{{- end -}} diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/csidriver.yaml b/charts/ionoscloud-blockstorage-csi-driver/templates/csidriver.yaml new file mode 100644 index 0000000..41e4ef1 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/csidriver.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: storage.k8s.io/v1 +kind: CSIDriver +metadata: + name: {{ .Values.driverName }} + labels: + {{- include "csi-driver.labels" . | nindent 4 }} +spec: + attachRequired: true + podInfoOnMount: true diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/daemonset.yaml b/charts/ionoscloud-blockstorage-csi-driver/templates/daemonset.yaml new file mode 100644 index 0000000..70e2cd8 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/daemonset.yaml @@ -0,0 +1,152 @@ +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: {{ include "csi-driver.fullname" . }} + labels: + {{- include "csi-driver.labels" . | nindent 4 }} +spec: + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 50% + selector: + matchLabels: + {{- include "csi-driver.selectorLabels" . | nindent 6 }} + {{- include "csi-driver.nodeComponentLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.daemonset.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "csi-driver.labels" . | nindent 8 }} + {{- include "csi-driver.nodeComponentLabels" . | nindent 8 }} + {{- with .Values.daemonset.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.daemonset.imagePullSecrets }} + imagePullSecrets: + {{- range . }} + - name: {{ . }} + {{- end }} + {{- end }} + automountServiceAccountToken: false + priorityClassName: system-node-critical + containers: + - name: driver + securityContext: + privileged: true + capabilities: + add: ["SYS_ADMIN"] + allowPrivilegeEscalation: true + image: "{{ include "image.registry" . }}{{ .Values.driver.node.image.repository }}:{{ .Values.driver.node.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.driver.node.image.pullPolicy }} + args: + - --endpoint=unix:///csi/csi.sock + - --driver-mode=NodeServer + - --driver-name={{ .Values.driverName }} + - --cluster-id={{ .Values.clusterName }} + - --metrics-endpoint=0.0.0.0:8080 + {{- include "csi-driver.extraArgs" .Values.driver.node | indent 12 }} + env: + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + {{- range $key, $value := .Values.driver.node.extraEnv }} + - name: {{ $key }} + value: "{{ $value }}" + {{- end }} + ports: + - name: driver-http + containerPort: 8080 + resources: + {{- toYaml .Values.driver.node.resources | nindent 12 }} + volumeMounts: + - mountPath: /csi + name: socket-dir + - name: fs-mountpoint-dir + mountPath: /var/lib/kubelet/pods + mountPropagation: "Bidirectional" + - name: block-mountpoint-dir + mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi + mountPropagation: "Bidirectional" + - name: device-dir + mountPath: /dev + - name: udev-data-dir + mountPath: /run/udev/data + - name: etc-dir + mountPath: /etc + - name: node-driver-registrar + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: ["ALL"] + privileged: false + readOnlyRootFilesystem: true + image: "{{ include "image.registry" . }}{{ .Values.registrar.image.repository }}:{{ .Values.registrar.image.tag }}" + imagePullPolicy: IfNotPresent + args: + - --csi-address=/csi/csi.sock + - --kubelet-registration-path=/var/lib/csi/{{ .Chart.Name }}/csi.sock + {{- include "csi-driver.extraArgs" .Values.registar | indent 12 }} + lifecycle: + preStop: + exec: + command: ["/bin/sh", "-c", "rm -f /var/lib/csi/csi-driver/csi.sock"] + env: + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + resources: + {{- toYaml .Values.registrar.resources | nindent 12 }} + volumeMounts: + - name: socket-dir + mountPath: /csi + - name: registration-dir + mountPath: /registration/ + volumes: + - name: registration-dir + hostPath: + path: /var/lib/kubelet/plugins_registry/ + type: DirectoryOrCreate + - name: socket-dir + hostPath: + path: /var/lib/csi/{{ .Chart.Name }} + type: DirectoryOrCreate + - name: block-mountpoint-dir + hostPath: + path: /var/lib/kubelet/plugins/kubernetes.io/csi + type: DirectoryOrCreate + - name: fs-mountpoint-dir + hostPath: + path: /var/lib/kubelet/pods + type: Directory + - name: device-dir + hostPath: + path: /dev + type: Directory + - name: udev-data-dir + hostPath: + path: /run/udev/data + type: Directory + - name: etc-dir + hostPath: + path: /etc/ + type: Directory + {{- with .Values.daemonset.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.daemonset.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.daemonset.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/deployment.yaml b/charts/ionoscloud-blockstorage-csi-driver/templates/deployment.yaml new file mode 100644 index 0000000..8834389 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/deployment.yaml @@ -0,0 +1,190 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "csi-driver.fullname" . }}-controller + labels: + {{- include "csi-driver.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.deployment.replicaCount }} + selector: + matchLabels: + {{- include "csi-driver.selectorLabels" . | nindent 6 }} + {{- include "csi-driver.controllerComponentLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.deployment.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "csi-driver.labels" . | nindent 8 }} + {{- include "csi-driver.controllerComponentLabels" . | nindent 8 }} + {{- with .Values.deployment.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.deployment.imagePullSecrets }} + imagePullSecrets: + {{- range . }} + - name: {{ . }} + {{- end }} + {{- end }} + serviceAccountName: {{ include "csi-driver.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.deployment.podSecurityContext | nindent 8 }} + containers: + - name: driver + securityContext: + {{- toYaml .Values.deployment.securityContext | nindent 12 }} + image: "{{ include "image.registry" . }}{{ .Values.driver.controller.image.repository }}:{{ .Values.driver.controller.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.driver.controller.image.pullPolicy }} + args: + - --endpoint=unix:///csi/csi.sock + - --driver-mode=ControllerServer + - --driver-name={{ .Values.driverName }} + - --cluster-id={{ .Values.clusterName }} + - --metrics-endpoint=0.0.0.0:8080 + {{- include "csi-driver.extraArgs" .Values.driver.controller | indent 12 }} + env: + - name: IONOS_TOKEN + valueFrom: + secretKeyRef: + key: token + name: {{ .Values.tokenSecretName | required "tokenSecretName is required" }} + {{- range $key, $value := .Values.driver.controller.extraEnv }} + - name: {{ $key }} + value: "{{ $value }}" + {{- end }} + ports: + - name: driver-http + containerPort: 8080 + resources: + {{- toYaml .Values.driver.controller.resources | nindent 12 }} + volumeMounts: + - name: socket-dir + mountPath: /csi + - name: override-autmount + mountPath: /var/run/secrets/kubernetes.io/serviceaccount + {{- with .Values.driver.controller.volumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + - name: provisioner + securityContext: + {{- toYaml .Values.deployment.securityContext | nindent 12 }} + image: "{{ include "image.registry" . }}{{ .Values.provisioner.image.repository }}:{{ .Values.provisioner.image.tag }}" + imagePullPolicy: {{ .Values.provisioner.image.pullPolicy }} + args: + - --csi-address=/csi/csi.sock + - --feature-gates=Topology=true,HonorPVReclaimPolicy=true + - --strict-topology=false + - --immediate-topology=false + - --default-fstype=ext4 + {{- if gt (int .Values.deployment.replicaCount) 1 }} + - --leader-election + - --leader-election-namespace={{ .Release.Namespace }} + {{- end }} + {{- include "csi-driver.extraArgs" .Values.provisioner | indent 12 }} + env: + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + resources: + {{- toYaml .Values.provisioner.resources | nindent 12 }} + volumeMounts: + - name: socket-dir + mountPath: /csi + - name: attacher + securityContext: + {{- toYaml .Values.deployment.securityContext | nindent 12 }} + image: "{{ include "image.registry" . }}{{ .Values.attacher.image.repository }}:{{ .Values.attacher.image.tag }}" + imagePullPolicy: {{ .Values.attacher.image.pullPolicy }} + args: + - --csi-address=/csi/csi.sock + - --default-fstype=ext4 + {{- if gt (int .Values.deployment.replicaCount) 1 }} + - --leader-election + - --leader-election-namespace={{ .Release.Namespace }} + {{- end }} + {{- include "csi-driver.extraArgs" .Values.attacher | indent 12 }} + env: + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + resources: + {{- toYaml .Values.attacher.resources | nindent 12 }} + volumeMounts: + - name: socket-dir + mountPath: /csi + - name: resizer + securityContext: + {{- toYaml .Values.deployment.securityContext | nindent 12 }} + image: "{{ include "image.registry" . }}{{ .Values.resizer.image.repository }}:{{ .Values.resizer.image.tag }}" + imagePullPolicy: {{ .Values.resizer.image.pullPolicy }} + args: + - --csi-address=/csi/csi.sock + {{- if gt (int .Values.deployment.replicaCount) 1 }} + - --leader-election + - --leader-election-namespace={{ .Release.Namespace }} + {{- end }} + {{- include "csi-driver.extraArgs" .Values.resizer | indent 12 }} + resources: + {{- toYaml .Values.resizer.resources | nindent 12 }} + volumeMounts: + - name: socket-dir + mountPath: /csi + - name: snapshotter + securityContext: + {{- toYaml .Values.deployment.securityContext | nindent 12 }} + image: "{{ include "image.registry" . }}{{ .Values.snapshotter.image.repository }}:{{ .Values.snapshotter.image.tag }}" + imagePullPolicy: {{ .Values.snapshotter.image.pullPolicy }} + args: + - --csi-address=/csi/csi.sock + {{- if gt (int .Values.deployment.replicaCount) 1 }} + - --leader-election + - --leader-election-namespace={{ .Release.Namespace }} + {{- end }} + {{- include "csi-driver.extraArgs" .Values.snapshotter | indent 12 }} + resources: + {{- toYaml .Values.snapshotter.resources | nindent 12 }} + volumeMounts: + - name: socket-dir + mountPath: /csi + - name: snapshot-controller + securityContext: + {{- toYaml .Values.deployment.securityContext | nindent 12 }} + image: "{{ include "image.registry" . }}{{ .Values.snapshotController.image.repository }}:{{ .Values.snapshotController.image.tag }}" + imagePullPolicy: {{ .Values.snapshotController.image.pullPolicy }} + args: + {{- if gt (int .Values.deployment.replicaCount) 1 }} + - --leader-election + - --leader-election-namespace={{ .Release.Namespace }} + {{- end }} + {{- include "csi-driver.extraArgs" .Values.snapshotController | indent 12 }} + resources: + {{- toYaml .Values.snapshotController.resources | nindent 12 }} + volumes: + - name: socket-dir + emptyDir: {} + - name: override-autmount + emptyDir: {} + - name: auth-token + secret: + secretName: {{ .Values.tokenSecretName | required "tokenSecretName is required" }} + {{- with .Values.deployment.volumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.deployment.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.deployment.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.deployment.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/podmonitor.yaml b/charts/ionoscloud-blockstorage-csi-driver/templates/podmonitor.yaml new file mode 100644 index 0000000..c29c84d --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/podmonitor.yaml @@ -0,0 +1,28 @@ +{{- if .Values.monitoring.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + {{- if .Values.monitoring.nameOverride }} + name: {{ .Values.monitoring.nameOverride }} + {{- else }} + name: {{ include "csi-driver.fullname" . }} + {{- end }} + {{- if .Values.monitoring.namespace }} + namespace: {{ .Values.monitoring.namespace }} + {{- end }} + labels: + {{- include "csi-driver.labels" . | nindent 4 }} + {{- with .Values.monitoring.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + podMetricsEndpoints: + - port: driver-http + interval: {{ .Values.monitoring.scrapeInterval }} + namespaceSelector: + matchNames: + - {{ .Values.monitoring.namespace | default .Release.Namespace }} + selector: + matchLabels: + {{- include "csi-driver.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/rbac/clusterrole.yaml b/charts/ionoscloud-blockstorage-csi-driver/templates/rbac/clusterrole.yaml new file mode 100644 index 0000000..e5a5684 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/rbac/clusterrole.yaml @@ -0,0 +1,60 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "csi-driver.fullname" . }} + labels: + {{- include "csi-driver.labels" . | nindent 4 }} +rules: + - apiGroups: [""] + resources: ["events"] + verbs: ["get", "list", "watch", "create", "update", "patch"] + # provisioner + - apiGroups: [""] + resources: ["secrets"] + verbs: ["get", "list"] + - apiGroups: [""] + resources: ["persistentvolumes"] + verbs: ["get", "list", "watch", "create", "delete", "update", "patch"] + - apiGroups: [""] + resources: ["persistentvolumeclaims"] + verbs: ["get", "list", "watch", "update"] + - apiGroups: [""] + resources: ["persistentvolumeclaims/status"] + verbs: ["patch"] + - apiGroups: ["storage.k8s.io"] + resources: ["storageclasses"] + verbs: ["get", "list", "watch"] + # attacher + - apiGroups: [""] + resources: ["nodes"] + verbs: ["get", "list", "watch"] + - apiGroups: ["storage.k8s.io"] + resources: ["csinodes"] + verbs: ["get", "list", "watch"] + - apiGroups: ["storage.k8s.io"] + resources: ["volumeattachments"] + verbs: ["get", "list", "watch", "update", "patch"] + - apiGroups: ["storage.k8s.io"] + resources: ["volumeattachments/status"] + verbs: ["patch"] + # resizer + - apiGroups: [""] + resources: ["pods"] + verbs: ["get", "list", "watch"] + # snapshotter + - apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshotclasses"] + verbs: ["get", "list", "watch"] + - apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshotcontents"] + verbs: ["create", "get", "list", "watch", "update", "delete", "patch"] + - apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshotcontents/status"] + verbs: ["update", "patch"] + - apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshots"] + verbs: ["get", "list", "watch", "update", "patch"] + - apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshots/status"] + verbs: ["update", "patch"] diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/rbac/clusterrolebinding.yaml b/charts/ionoscloud-blockstorage-csi-driver/templates/rbac/clusterrolebinding.yaml new file mode 100644 index 0000000..303ecd2 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/rbac/clusterrolebinding.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "csi-driver.fullname" . }} + labels: + {{- include "csi-driver.labels" . | nindent 4 }} +subjects: + - kind: ServiceAccount + name: {{ include "csi-driver.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "csi-driver.fullname" . }} diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/rbac/role.yaml b/charts/ionoscloud-blockstorage-csi-driver/templates/rbac/role.yaml new file mode 100644 index 0000000..e2fe218 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/rbac/role.yaml @@ -0,0 +1,13 @@ +{{- if gt (int .Values.replicaCount) 1 }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "csi-driver.fullname" . }} + labels: + {{- include "csi-driver.labels" . | nindent 4 }} +rules: + - apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["get", "watch", "list", "delete", "update", "create"] +{{- end }} diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/rbac/rolebinding.yaml b/charts/ionoscloud-blockstorage-csi-driver/templates/rbac/rolebinding.yaml new file mode 100644 index 0000000..f91f56e --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/rbac/rolebinding.yaml @@ -0,0 +1,17 @@ +{{- if gt (int .Values.replicaCount) 1 }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "csi-driver.fullname" . }} + labels: + {{- include "csi-driver.labels" . | nindent 4 }} +subjects: + - kind: ServiceAccount + name: {{ include "csi-driver.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "csi-driver.fullname" . }} +{{- end }} diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/serviceaccount.yaml b/charts/ionoscloud-blockstorage-csi-driver/templates/serviceaccount.yaml new file mode 100644 index 0000000..3e7ef1d --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/serviceaccount.yaml @@ -0,0 +1,14 @@ +{{- if .Values.serviceAccount.create -}} +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "csi-driver.serviceAccountName" . }} + labels: + {{- include "csi-driver.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/storageclass.yaml b/charts/ionoscloud-blockstorage-csi-driver/templates/storageclass.yaml new file mode 100644 index 0000000..b544377 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/storageclass.yaml @@ -0,0 +1,54 @@ +--- +{{- $name := printf "%s-hdd" .Values.className }} +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: {{ $name }} + labels: + {{- include "csi-driver.labels" . | nindent 4 }} + annotations: + {{- include "csi-driver.storageClassAnnotation" (list . $name "true") | indent 4 }} +parameters: + type: HDD +{{- if or (.Release.IsInstall) (((lookup "storage.k8s.io/v1" "StorageClass" "" $name).parameters).fstype) }} + fstype: ext4 +{{- end }} +provisioner: {{ .Values.driverName }} +volumeBindingMode: WaitForFirstConsumer +allowVolumeExpansion: true +--- +{{- $name := printf "%s-ssd-standard" .Values.className }} +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: {{ $name }} + labels: + {{- include "csi-driver.labels" . | nindent 4 }} + annotations: + {{- include "csi-driver.storageClassAnnotation" (list . $name "false") | indent 4 }} +provisioner: {{ .Values.driverName }} +parameters: + type: SSD Standard +{{- if or (.Release.IsInstall) (((lookup "storage.k8s.io/v1" "StorageClass" "" $name).parameters).fstype) }} + fstype: ext4 +{{- end }} +volumeBindingMode: WaitForFirstConsumer +allowVolumeExpansion: true +--- +{{- $name := printf "%s-ssd-premium" .Values.className }} +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: {{ $name }} + labels: + {{- include "csi-driver.labels" . | nindent 4 }} + annotations: + {{- include "csi-driver.storageClassAnnotation" (list . $name "false") | indent 4 }} +provisioner: {{ .Values.driverName }} +parameters: + type: SSD Premium +{{- if or (.Release.IsInstall) (((lookup "storage.k8s.io/v1" "StorageClass" "" $name).parameters).fstype) }} + fstype: ext4 +{{- end }} +volumeBindingMode: WaitForFirstConsumer +allowVolumeExpansion: true diff --git a/charts/ionoscloud-blockstorage-csi-driver/templates/volumesnapshotclass.yaml b/charts/ionoscloud-blockstorage-csi-driver/templates/volumesnapshotclass.yaml new file mode 100644 index 0000000..a9ed5b2 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/templates/volumesnapshotclass.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: snapshot.storage.k8s.io/v1 +kind: VolumeSnapshotClass +metadata: + name: {{ .Values.className }} + annotations: + {{- if .Release.IsInstall }} + snapshot.storage.kubernetes.io/is-default-class: "true" + {{- else }} + {{- $annotations := ((lookup "snapshot.storage.k8s.io/v1" "VolumeSnapshotClass" "" .Values.className).metadata).annotations }} + snapshot.storage.kubernetes.io/is-default-class: {{ get $annotations "snapshot.storage.kubernetes.io/is-default-class" | quote }} + {{- end }} + labels: + {{- include "csi-driver.labels" . | nindent 4 }} +driver: {{ .Values.driverName }} +deletionPolicy: Delete diff --git a/charts/ionoscloud-blockstorage-csi-driver/values.yaml b/charts/ionoscloud-blockstorage-csi-driver/values.yaml new file mode 100644 index 0000000..5508881 --- /dev/null +++ b/charts/ionoscloud-blockstorage-csi-driver/values.yaml @@ -0,0 +1,316 @@ +# Default values for ionoscloud-blockstorage-csi-driver. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# -- Name of the driver in the storage class. +driverName: cloud.ionos.com +# -- Name used to identify managed storage resources. +clusterName: k8s +# -- Name of the secret that contains the token used for cloud API authentication. Must contain the key "token". +tokenSecretName: "" +# -- Name of VolumeSnapshotClass. Also used as prefix for StorageClasses. +className: ionos-cloud + +# -- Specify a custom name override. This only influences Kubernetes resource names, not properties. +nameOverride: "" +# -- Specify a custom fullname override. This only influences Kubernetes resource names, not properties. +fullnameOverride: "" + +# -- (string) Specify a custom registry name that will be used as prefix for all images. +# Useful when pulling images from a registry mirror. +# @default -- Omit if empty +registry: + +serviceAccount: + # -- Specifies whether a service account should be created + create: true + # -- Automatically mount a ServiceAccount's API credentials? + automount: 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: "" + +driver: + controller: + # -- Additional command-line arguments + # @section -- Controller server + extraArgs: {} + # -- Additional environment variables + # @section -- Controller server + extraEnv: [] + image: + # -- Image repository + # @section -- Controller server + repository: ghcr.io/ionos-cloud/ionoscloud-blockstorage-csi-driver + # -- Image tag + # @section -- Controller server + # @default -- Defaults to appVersion + tag: + # -- Image pull policy + # @section -- Controller server + pullPolicy: IfNotPresent + # -- Resource requests and limits + # @section -- Controller server + resources: + requests: + cpu: 10m + memory: 25Mi + limits: + memory: 100Mi + # Additional volumeMounts for the controller server + # @ignored + volumeMounts: [] + # - name: foo + # mountPath: "/etc/foo" + # readOnly: true + + node: + # -- Additional command-line arguments + # @section -- Node server + extraArgs: {} + # -- Additional environment variables + # @section -- Node server + extraEnv: [] + image: + # -- Image repository + # @section -- Node server + repository: ghcr.io/ionos-cloud/ionoscloud-blockstorage-csi-driver + # -- Image tag + # @section -- Node server + # @default -- Defaults to appVersion + tag: + # -- Image pull policy + # @section -- Node server + pullPolicy: IfNotPresent + # -- Resource requests and limits + # @section -- Node server + resources: + requests: + cpu: 10m + memory: 25Mi + limits: + memory: 50Mi + +provisioner: + # -- Additional command-line arguments + # @section -- Provisioner + extraArgs: + timeout: 930s + image: + # -- Image repository + # @section -- Provisioner + repository: registry.k8s.io/sig-storage/csi-provisioner + # -- Image tag + # @section -- Provisioner + tag: v3.6.4 + # -- Image pull policy + # @section -- Provisioner + pullPolicy: IfNotPresent + # -- Resource requests and limits + # @section -- Provisioner + resources: + requests: + cpu: 10m + memory: 25Mi + limits: + memory: 100Mi + +attacher: + # -- Additional command-line arguments + # @section -- Attacher + extraArgs: + timeout: 270s + image: + # -- Image repository + # @section -- Attacher + repository: registry.k8s.io/sig-storage/csi-attacher + # -- Image tag + # @section -- Attacher + tag: v4.5.1 + # -- Image pull policy + # @section -- Attacher + pullPolicy: IfNotPresent + # -- Resource requests and limits + # @section -- Attacher + resources: + requests: + cpu: 10m + memory: 25Mi + limits: + memory: 100Mi + +resizer: + # -- Additional command-line arguments + # @section -- Resizer + extraArgs: + timeout: 150s + image: + # -- Image repository + # @section -- Resizer + repository: registry.k8s.io/sig-storage/csi-resizer + # -- Image tag + # @section -- Resizer + tag: v1.10.1 + # -- Image pull policy + # @section -- Resizer + pullPolicy: IfNotPresent + # -- Resource requests and limits + # @section -- Resizer + resources: + requests: + cpu: 10m + memory: 25Mi + limits: + memory: 100Mi + +snapshotter: + # -- Additional command-line arguments + # @section -- Snapshotter + extraArgs: + timeout: 300s + image: + # -- Image repository + # @section -- Snapshotter + repository: registry.k8s.io/sig-storage/csi-snapshotter + # -- Image tag + # @section -- Snapshotter + tag: v6.3.4 + # -- Image pull policy + # @section -- Snapshotter + pullPolicy: IfNotPresent + # -- Resource requests and limits + # @section -- Snapshotter + resources: + requests: + cpu: 10m + memory: 25Mi + limits: + memory: 100Mi + +snapshotController: + # -- Additional command-line arguments + # @section -- Snapshot controller + extraArgs: {} + image: + # -- Image repository + # @section -- Snapshot controller + repository: registry.k8s.io/sig-storage/snapshot-controller + # -- Image tag + # @section -- Snapshot controller + tag: v6.3.4 + # -- Image pull policy + # @section -- Snapshot controller + pullPolicy: IfNotPresent + # -- Resource requests and limits + # @section -- Snapshot controller + resources: + requests: + cpu: 10m + memory: 25Mi + limits: + memory: 100Mi + +registrar: + # -- Additional command-line arguments + # @section -- Node driver registrar + extraArgs: {} + image: + # -- Image repository + # @section -- Node driver registrar + repository: registry.k8s.io/sig-storage/csi-node-driver-registrar + # -- Image tag + # @section -- Node driver registrar + tag: v2.10.1 + # -- Image pull policy + # @section -- Node driver registrar + pullPolicy: IfNotPresent + # -- Resource requests and limits + # @section -- Node driver registrar + resources: + requests: + cpu: 10m + memory: 15Mi + limits: + memory: 30Mi + +deployment: + # -- Number of Deployment pods. Setting this higher than 1 will enable leader election. + # @section -- Deployment + replicaCount: 1 + # -- List of image pull secret names for Deployment pods. + # @section -- Deployment + imagePullSecrets: [] + # -- Additional annotations for Deployment pods. + # @section -- Deployment + podAnnotations: {} + # -- Additional labels for Deployment pods. + # @section -- Deployment + podLabels: {} + # -- Security context for Deployment pods. + # @section -- Deployment + podSecurityContext: {} + # -- Security context for Deployment containers. + # @section -- Deployment + securityContext: + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + # -- Node selector for Deployment pods. + # @section -- Deployment + nodeSelector: {} + # -- Tolerations for Deployemnt pods. + # @section -- Deployment + tolerations: [] + # -- Affinity for Deployment pods. + # @section -- Deployment + affinity: {} + # -- Additional volumes on the output Deployment definition. + # @ignored + volumes: [] + # - name: foo + # secret: + # secretName: mysecret + # optional: false + +daemonset: + # -- List of image pull secret names for Daemonset pods. + # @section -- Daemonset + imagePullSecrets: [] + # -- Additional annotations for Daemonset pods. + # @section -- Daemonset + podAnnotations: {} + # -- Additional labels for Daemonset pods. + # @section -- Daemonset + podLabels: {} + # -- Security context for Daemonset pods. + # @section -- Daemonset + podSecurityContext: {} + # -- Node selector for Daemonset pods. + # @section -- Daemonset + nodeSelector: {} + # -- Tolerations for Daemonset pods. + # @section -- Daemonset + tolerations: [] + # -- Affinity for Daemonset pods. + # @section -- Daemonset + affinity: {} + +monitoring: + # -- If true, render Prometheus PodMonitor resource. + # @section -- Monitoring + enabled: false + # -- Speciy name override for the PodMonitor. + # @section -- Monitoring + nameOverride: "" + # -- Specify namespace override for the PodMonitor. + # @section -- Monitoring + # @default -- Release namespace + namespace: "" + # -- Additional labels for the PodMonitor. + # @section -- Monitoring + additionalLabels: {} + # -- Metrics scrape interval as duration string. + # @section -- Monitoring + scrapeInterval: 30s