HostPath Storage for T4K
This section describes installation of Hostpath CSI driver
git clone https://github.com/kubernetes-csi/csi-driver-host-path.gitcd csi-driver-host-path/deploy/kubernetes-1.XX# Change to the latest supported snapshotter version $ SNAPSHOTTER_VERSION=v2.0.1 # Apply VolumeSnapshot CRDs $ kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${SNAPSHOTTER_VERSION}/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml $ kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${SNAPSHOTTER_VERSION}/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml $ kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${SNAPSHOTTER_VERSION}/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml # Create snapshot controller $ kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${SNAPSHOTTER_VERSION}/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml $ kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${SNAPSHOTTER_VERSION}/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml./deploy.shMake sure following pods are running NAME READY STATUS RESTARTS AGE csi-hostpath-attacher-0 1/1 Running 0 28d csi-hostpath-provisioner-0 1/1 Running 1 28d csi-hostpath-resizer-0 1/1 Running 0 28d csi-hostpath-snapshotter-0 1/1 Running 0 28d csi-hostpath-socat-0 1/1 Running 0 28d csi-hostpathplugin-0 3/3 Running 0 28dapiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: csi-hostpath-sc annotations: storageclass.kubernetes.io/is-default-class: "true" provisioner: hostpath.csi.k8s.io reclaimPolicy: Retain volumeBindingMode: Immediate
apiVersion: snapshot.storage.k8s.io/v1alpha1 kind: VolumeSnapshotClass metadata: annotations: snapshot.storage.kubernetes.io/is-default-class: "true" name: default-snapshot-class snapshotter: hostpath.csi.k8s.ioapiVersion: snapshot.storage.k8s.io/v1beta1 kind: VolumeSnapshotClass metadata: name: default-snapshot-class driver: hostpath.csi.k8s.io deletionPolicy: DeleteapiVersion: v1 kind: PersistentVolumeClaim metadata: name: task-pv-claim spec: storageClassName: csi-hostpath-sc accessModes: - ReadWriteOnce resources: requests: storage: 50Mi
apiVersion: snapshot.storage.k8s.io/v1alpha1 kind: VolumeSnapshot metadata: name: new-snapshot-demo namespace: default spec: snapshotClassName: default-snapshot-class source: name: task-pv-claim kind: PersistentVolumeClaimapiVersion: snapshot.storage.k8s.io/v1beta1 kind: VolumeSnapshot metadata: name: new-snapshot spec: volumeSnapshotClassName: default-snapshot-class source: persistentVolumeClaimName: task-pv-claim
Last updated
Was this helpful?