Skip to content

Commit

Permalink
docs: storage class options
Browse files Browse the repository at this point in the history
Describe proxmox csi options.
  • Loading branch information
sergelogvinov committed Sep 18, 2023
1 parent 26c1928 commit 5e57204
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion docs/benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -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%
```
```

# 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
54 changes: 54 additions & 0 deletions docs/deploy/debug.yaml
Original file line number Diff line number Diff line change
@@ -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
72 changes: 72 additions & 0 deletions docs/options.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 5e57204

Please sign in to comment.