Overview
This document describes how to integrate CFS Turbo with a Tencent Kubernetes Engine (TKE) cluster.
Prerequisites
The operating system of the TKE host node is compatible with the Turbo series.
You have installed a Turbo-based client on all TKE nodes. You are advised to use pshell to operate in batches.
Directions
Using kubectl to connect to a cluster
Creating a Pod for mounting Turbo using YAML files
2. Go to the kubernetes-csi-tencentcloud/deploy/cfsturbo/kubernetes/
directory and upload csi-node-rbac.yaml
, csi-node.yaml
, and csidriver-new.yaml
files to the kubectl management node.
3. Go to the kubernetes-csi-tencentcloud/deploy/cfsturbo/examples/
directory and download the pv.yaml
, pvc.yaml
, and pod.yaml
sample files.
4. Modify the pv.yaml
, pvc.yaml
, and pod.yaml
files based on the PV, PVC, and Pod attributes, such as name and image address.
Below are the sample YAML files:
apiVersion: v1
kind: PersistentVolume
metadata:
name: csi-cfsturbo-pv
spec:
accessModes:
- ReadWriteMany
capacity:
storage: 10Gi
csi:
driver: com.tencent.cloud.csi.cfsturbo
volumeHandle: csi-cfsturbo-pv
volumeAttributes:
proto: lustre
rootdir: /cfs
fsid: d3dcc487
host: 10.0.1.16
path: /
storageClassName: ""
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: csi-cfsturbo-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
volumeName: csi-cfsturbo-pv
storageClassName: ""
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
k8s-app: csi-cfsturbo-pod
name: csi-cfsturbo-pod
spec:
replicas: 1
selector:
matchLabels:
k8s-app: csi-cfsturbo-pod
template:
metadata:
labels:
k8s-app: csi-cfsturbo-pod
spec:
containers:
- image: nginx
name: csi-cfsturbo-pod
volumeMounts:
- mountPath: /csi-cfsturbo
name: csi-cfsturbo
volumes:
- name: csi-cfsturbo
persistentVolumeClaim:
claimName: csi-cfsturbo-pvc
Below is the sample command for mounting:
sudo mount.lustre -o sync,user_xattr 10.0.1.16@tcp0:/d3dcc487/cfs /path/to/mount
Below are key parameters:
proto:lustre: Keep this parameter unchanged.
roodir:/cfs: Keep this parameter unchanged.
fsid:d3dcc487: Here, fsid
is not the CFSID
, and you need to enter the information in the mount directory.
host:10.0.1.16: IP of the mount point.
path: You can adjust it based on the target subdirectory. To directly mount the root directory, enter "/".
5. Run the following commands in sequence in the directory where the script is uploaded:
Configure RBAC and CSI plugins.
kubectl apply -f csi-node-rbac.yaml && kubectl apply -f csidriver-new.yaml && kubectl apply -f csi-node.yaml
Create PV, PVC, and Pod:
kubectl create -f pv.yaml && kubectl create -f pvc.yaml && kubectl create -f pod.yaml
6. Run the following command to view the Pod status:
kubectl get pod -n default -o wide
If the message below is displayed, the Pod is created successfully. If the value of STATUS
is ContainerCreating
, the creation failed. You can view the failure reason based on the events in the TKE console.
Was this page helpful?