From 5e572045bc2a337b2aba7eab77ce08c9e27fb095 Mon Sep 17 00:00:00 2001 From: Serge Logvinov Date: Mon, 18 Sep 2023 21:08:01 +0300 Subject: [PATCH] docs: storage class options Describe proxmox csi options. --- README.md | 8 +++-- docs/benchmark.md | 8 ++++- docs/deploy/debug.yaml | 54 +++++++++++++++++++++++++++++++ docs/options.md | 72 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 docs/deploy/debug.yaml create mode 100644 docs/options.md diff --git a/README.md b/README.md index bde3b21..1335274 100644 --- a/README.md +++ b/README.md @@ -296,9 +296,11 @@ volumeBindingMode: WaitForFirstConsumer ``` Storage parameters: -* storage - proxmox storage ID -* cache - qemu cache param: `directsync`, `none`, `writeback`, `writethrough` see [official documentation](https://pve.proxmox.com/wiki/Performance_Tweaks) -* ssd - true if SSD/NVME disk +* `storage` - proxmox storage ID +* `cache` - qemu cache param: `directsync`, `none`, `writeback`, `writethrough` [Official documentation](https://pve.proxmox.com/wiki/Performance_Tweaks) +* `ssd` - true if SSD/NVME disk + +For more detailed options and a comprehensive understanding, refer to the following link [StorageClass options](docs/options.md) ## In Scope diff --git a/docs/benchmark.md b/docs/benchmark.md index 674d34a..d3f10d2 100644 --- a/docs/benchmark.md +++ b/docs/benchmark.md @@ -266,4 +266,10 @@ Run status group 0 (all jobs): Disk stats (read/write): sdb: ios=26302626/8765212, merge=41/11, ticks=4481802/765988, in_queue=5247795, util=100.00% -``` \ No newline at end of file +``` + +# Resources + +* https://pve.proxmox.com/wiki/Performance_Tweaks +* https://kb.blockbridge.com/technote/proxmox-tuning-low-latency-storage/ +* https://documentation.suse.com/sles/15-SP3/single-html/SLES-virtualization-best-practices/index.html diff --git a/docs/deploy/debug.yaml b/docs/deploy/debug.yaml new file mode 100644 index 0000000..21c003a --- /dev/null +++ b/docs/deploy/debug.yaml @@ -0,0 +1,54 @@ +apiVersion: v1 +kind: Pod +metadata: + name: ubuntu + namespace: kube-system +spec: + hostname: ubuntu + subdomain: default + hostPID: true + hostNetwork: true + containers: + - image: ubuntu + command: + - sleep + - "14d" + name: ubuntu + securityContext: + privileged: true + capabilities: + add: + - SYS_RAWIO + volumeMounts: + - name: dev + mountPath: /dev + - name: sys + mountPath: /sys + - name: root + mountPath: /mnt/root + readOnly: true + - mountPath: /lib/modules + name: lib-modules + readOnly: true + - name: tmp + mountPath: /tmp + tolerations: + - operator: Exists + volumes: + - name: dev + hostPath: + path: /dev + - name: sys + hostPath: + path: /sys + - name: root + hostPath: + path: / + - hostPath: + path: /lib/modules + name: lib-modules + - name: tmp + emptyDir: + medium: Memory + nodeSelector: + kubernetes.io/hostname: kube-11 diff --git a/docs/options.md b/docs/options.md new file mode 100644 index 0000000..b6fd1c0 --- /dev/null +++ b/docs/options.md @@ -0,0 +1,72 @@ +# Storage Class + +A Kubernetes StorageClass is an object that defines the storage "classes" or tiers available for dynamic provisioning of storage volumes in a Kubernetes cluster. It abstracts the underlying storage infrastructure, making it easier for developers and administrators to manage persistent storage for applications running in Kubernetes. + +Deploy examples you can find [here](deploy/). + +```yaml +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: proxmox-data-xfs + +parameters: + # Pre defined options + csi.storage.k8s.io/fstype: xfs|ext4 + ## If you want to encrypt the disk + csi.storage.k8s.io/node-stage-secret-name: "proxmox-csi-secret" + csi.storage.k8s.io/node-stage-secret-namespace: "kube-system" + csi.storage.k8s.io/node-expand-secret-name: "proxmox-csi-secret" + csi.storage.k8s.io/node-expand-secret-namespace: "kube-system" + + # Proxmox csi options + storage: data + cache: directsync|none|writeback|writethrough + ssd: "true|false" + +# This field allows you to specify additional mount options to be applied when the volume is mounted on the node +mountOptions: + # Common for ssd + - noatime + +provisioner: csi.proxmox.sinextra.dev +allowVolumeExpansion: true +reclaimPolicy: Delete|Retain +volumeBindingMode: WaitForFirstConsumer|Immediate +``` + +## Parameters: + +* `node-stage-secret-name`/`node-expand-secret-name`, `node-stage-secret-namespace`/`node-expand-secret-namespace` - Refer to the name and namespace of the Secret object in the Kubernetes API. The secrets key name is `encryption-passphrase`. [Official documentation](https://kubernetes-csi.github.io/docs/secrets-and-credentials-storage-class.html) + +```yaml +apiVersion: v1 +data: + encryption-passphrase: base64-encode +kind: Secret +metadata: + name: proxmox-csi-secret + namespace: kube-system +``` + +* `storage` - proxmox storage ID +* `cache` - qemu cache param: `directsync`, `none`, `writeback`, `writethrough` [Official documentation](https://pve.proxmox.com/wiki/Performance_Tweaks) +* `ssd` - true if SSD/NVME disk + +## AllowVolumeExpansion + +Allow you to resize (expand) the PVC in future. + +## ReclaimPolicy + +It defines what happens to the storage volume when the associated PersistentVolumeClaim (PVC) is deleted. There are three reclaim policies: + +* `Retain`: The storage volume is not deleted when the PVC is released, and it must be manually reclaimed by an administrator. +* `Delete`: The storage volume is deleted when the PVC is released. + +## VolumeBindingMode + +It specifies how volumes should be bound to PVs (Persistent Volumes). There are two modes: + +* `Immediate`: PVs are bound as soon as a PVC is created, even if a suitable storage volume isn't immediately available. This is suitable for scenarios where waiting for storage is not an option. +* `WaitForFirstConsumer`: PVs are bound only when a pod using the PVC is scheduled. This is useful when you want to ensure that storage is provisioned only when it's actually needed.