local static provisioner
Less than 1 minute
local static provisioner
prepare
- k8s is ready
- argocd is ready and logged in
installation
- prepare
local-static-provisioner.yaml
apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: local-static-provisioner spec: syncPolicy: syncOptions: - CreateNamespace=true project: default source: repoURL: https://kubernetes-sigs.github.io/sig-storage-local-static-provisioner chart: local-static-provisioner targetRevision: 2.0.0 helm: releaseName: local-static-provisioner values: | rbac: create: true serviceAccount: create: true setPVOwnerRef: true mountDevVolume: false image: registry.k8s.io/sig-storage/local-volume-provisioner:v2.6.0 classes: - name: local-disks hostDir: /data/local-static-provisioner volumeMode: Filesystem fsType: ext4 namePattern: '*' blockCleanerCommand: - /scripts/shred.sh - 2 storageClass: isDefaultClass: true serviceMonitor: enabled: false destination: server: https://kubernetes.default.svc namespace: provisioner
- apply to k8s
kubectl -n argocd apply -f local-static-provisioner.yaml
- sync by argocd
argocd app sync argocd/local-static-provisioner
- configure local volumes is required for not support dynamic provisioning
- with
mount --bind
to mount the directoriesHOSTNAME=$(hostname) for index in $(seq 1 3) do sudo mkdir -p /data/virtual-disks/$HOSTNAME-volume-$index sudo mkdir -p /data/local-static-provisioner/$HOSTNAME-volume-$index sudo mount --bind /data/virtual-disks/$HOSTNAME-volume-$index /data/local-static-provisioner/$HOSTNAME-volume-$index done
- with devices directly
HOSTNAME=$(hostname) sudo mount /dev/sdb1 /data/local-static-provisioner/$HOSTNAME-volume-dev-sdb1
- with
- check storage class
kubectl get sc
- check pv status
kubectl get pv
references
- https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner
- https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner/blob/master/helm/README.md