Solved

Kasten K10 Supported with NFS CSI Driver?


Userlevel 2

Does Kasten K10 support the NFS CSI driver?

I tried the following but failed to create a snapshot.

Install External Snapshotter

git clone https://github.com/kubernetes-csi/external-snapshotter.git
cd external-snapshotter
kubectl kustomize client/config/crd | kubectl create -f -
kubectl config set-context $(kubectl config current-context) --namespace kube-system
kubectl -n kube-system kustomize deploy/kubernetes/snapshot-controller | kubectl create -f -
cd .. && rm -rf external-snapshotter

Install NFS CSI Driver

helm repo add nfs-csi https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts
helm repo update
helm install nfs-csi nfs-csi/csi-driver-nfs -n kube-system

Create StorageClass

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: nfs
annotations:
storageclass.kubernetes.io/is-default-class: 'true'
provisioner: nfs.csi.k8s.io
parameters:
server: ...
share: /
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true
mountOptions:
- nfsvers=4.1

Create VolumeSnapshotClass

apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
driver: nfs.csi.k8s.io
metadata:
name: nfs
annotations:
k10.kasten.io/is-snapshot-class: "true"
deletionPolicy: Retain

Perform Pre-flight Checks

curl https://docs.kasten.io/tools/k10_primer.sh | bash
Namespace option not provided, using default namespace
Checking for tools
--> Found kubectl
--> Found helm
Checking if the Kasten Helm repo is present
--> The Kasten Helm repo was found
Checking for required Helm version (>= v3.0.0)
--> No Tiller needed with Helm v3.10.3
K10Primer image
--> Using Image (gcr.io/kasten-images/k10tools:5.5.2) to run test
Checking access to the Kubernetes context netapp
--> Able to access the default Kubernetes namespace
K10 Kanister tools image
--> Using Kanister tools image (ghcr.io/kanisterio/kanister-tools:0.85.0) to run test

Running K10Primer Job in cluster with command-
./k10tools primer
serviceaccount/k10-primer created
clusterrolebinding.rbac.authorization.k8s.io/k10-primer created
job.batch/k10primer created
Pod k10primer-kzqhs is in Pending phase
Pod Ready!

nfs.csi.k8s.io:
Is a CSI Provisioner - OK
Storage Classes:
nfs
Valid Storage Class - OK
Volume Snapshot Classes:
nfs
Has k10.kasten.io/is-snapshot-class annotation set to true - OK
Has deletionPolicy 'Retain' - OK

Validate Generic Volume Snapshot:
Pod created successfully - OK
GVS Backup command executed successfully - OK
Pod deleted successfully - OK

serviceaccount "k10-primer" deleted
clusterrolebinding.rbac.authorization.k8s.io "k10-primer" deleted
job.batch "k10primer" deleted

Install Kasten K10

helm repo add kasten https://charts.kasten.io/
helm repo update
kubectl create namespace kasten-io
helm install k10 kasten/k10 --namespace kasten-io

Test K10

curl -s https://docs.kasten.io/tools/k10_primer.sh | bash /dev/stdin -s nfs
Namespace option not provided, using default namespace
Checking for tools
--> Found kubectl
--> Found helm
Checking if the Kasten Helm repo is present
--> The Kasten Helm repo was found
Checking for required Helm version (>= v3.0.0)
--> No Tiller needed with Helm v3.10.3
K10Primer image
--> Using Image (gcr.io/kasten-images/k10tools:5.5.2) to run test
Checking access to the Kubernetes context netapp
--> Able to access the default Kubernetes namespace
K10 Kanister tools image
--> Using Kanister tools image (ghcr.io/kanisterio/kanister-tools:0.85.0) to run test

Running K10Primer Job in cluster with command-
./k10tools primer storage check csi
serviceaccount/k10-primer created
clusterrolebinding.rbac.authorization.k8s.io/k10-primer created
job.batch/k10primer created
Pod k10primer-dcdl6 is in Pending phase
Pod Ready!

Using "K10_PRIMER_CONFIG_YAML" env var content as config source
Using "K10_PRIMER_CONFIG_YAML" env var content as config source
I0113 09:39:31.147157 10 request.go:601] Waited for 1.047576216s due to client-side throttling, not priority and fairness, request: GET:https://10.100.0.1:443/apis/storage.k8s.io/v1beta1
Creating application
-> Created pod (kubestr-csi-original-podllgk9) and pvc (kubestr-csi-original-pvcwqvgr)
Taking a snapshot
Cleaning up resources
CSI Snapshot Walkthrough:
Using annotated VolumeSnapshotClass (nfs)
Failed to create Snapshot: CSI Driver failed to create snapshot for PVC (kubestr-csi-original-pvcwqvgr) in Namespace (default): Context done while polling: context deadline exceeded - Error
Error: {"message":"Failed to create Snapshot: CSI Driver failed to create snapshot for PVC (kubestr-csi-original-pvcwqvgr) in Namespace (default): Context done while polling: context deadline exceeded","function":"kasten.io/k10/kio/tools/k10primer.(*TestRetVal).Errors","linenumber":180,"file":"kasten.io/k10/kio/tools/k10primer/k10primer.go:180"}

serviceaccount "k10-primer" deleted
clusterrolebinding.rbac.authorization.k8s.io "k10-primer" deleted
job.batch "k10primer" deleted

 

icon

Best answer by jaiganeshjk 13 January 2023, 13:04

View original

6 comments

Userlevel 7
Badge +7

@jaiganeshjk 

Userlevel 7
Badge +22

The Kasten documentation https://docs.kasten.io/latest/install/storage.html?highlight=csi points to csi list here https://kubernetes-csi.github.io/docs/drivers.html and I see nfs there 

so I would imagine it is supported. I don’t see anything on the documentation stating otherwise. Maybe give Kubestr a try also and see what it returns https://kubestr.io/

 

Userlevel 7
Badge +22

The Kasten documentation https://docs.kasten.io/latest/install/storage.html?highlight=csi points to csi list here https://kubernetes-csi.github.io/docs/drivers.html and I see nfs there 

so I would imagine it is supported. I don’t see anything on the documentation stating otherwise. Maybe give Kubestr a try also and see what it returns https://kubestr.io/

 

Mind you now that I look it seems they are using kubestr components in the primer script judging by the logs Created pod (kubestr-csi-original-podllgk9). Are you able to manually create a snapshot with kubectl? https://kubernetes.io/docs/concepts/storage/volume-snapshots/

Userlevel 7
Badge +22

Wait I did find this so it might not be possible:

 

https://github.com/kubernetes-csi/csi-driver-nfs/issues/31

 

The last +1 was 5 days ago as well.

Userlevel 6
Badge +2

@Harish KM Though the NFS is a part of the CSI drivers list, It should be have CSI based snapshot support. 
However, I don’t think generic NFS CSI driver supports volumesnapshots.

https://github.com/kubernetes-csi/csi-driver-nfs/tree/master/deploy/example

 

K10 relies on CSI snapshotting capability which this driver doesn’t seem to have

Userlevel 1

Hi @Harish KM 

Does Kasten K10 work ok for you now ?

I have an internal K8S cluster (build by K3S)

1 default storageclass csi-driver-nfs , I have 1 QNAP NAS device as NFS server
I installed k10 by Helm 3
I can manual backup and export a simple nginx app (small 50MB volume for /var/logs/nginx) to Amazon S3 , restore app to other cluster successfully.

However when I try to manual backup and export my Hashicorp Vault to Amazon S3 , the backup run ok but the export run fail

 

Comment