6-14 4 views
CSI插件的安装与检测参照:https://help.aliyun.com/document_detail/204011.html?spm=a2c4g.11186623.6.579.15eb5dd20oLQ6z
确认是否已安装CSI插件
> kubectl get pod -n kube-system | grep csi-plugin
1 2 3 4 5 |
csi-plugin-44h5r 4/4 Running 0 56d csi-plugin-7xwbq 4/4 Running 0 56d csi-plugin-dvbt7 4/4 Running 0 7d12h csi-plugin-lvqfc 4/4 Running 0 7d12h csi-plugin-pqxbn 4/4 Running 0 56d |
确认已部署CSI-Provisioner组件
> kubectl get pod -n kube-system | grep csi-provisioner
1 2 |
csi-provisioner-5d558f8cbc-lrkzt 8/8 Running 0 56d csi-provisioner-5d558f8cbc-pxg4t 8/8 Running 1 56d |
创建PV
整个过程可参见官方文档:https://help.aliyun.com/document_detail/204013.html?spm=a2c4g.11186623.6.580.39a45b70JLrSdb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
apiVersion: v1 kind: PersistentVolume metadata: name: pv-nas-itnotebooks-logs labels: pvname: pv-nas-itnotebooks-logs namespace: itnotebooks spec: capacity: storage: 500Gi accessModes: - ReadWriteMany csi: driver: nasplugin.csi.alibabacloud.com volumeHandle: pv-nas-itnotebooks-logs volumeAttributes: server: "0e5b24xxxxxxxx.cn-hangzhou.nas.aliyuncs.com" path: "/itnotebooks/logs" mountOptions: - nolock,tcp,noresvport - vers=3 |
创建PVC
整个过程可参见官方文档:https://help.aliyun.com/document_detail/204013.html?spm=a2c4g.11186623.6.580.39a45b70JLrSdb
1 2 3 4 5 6 7 8 9 10 11 12 13 |
apiVersion: v1 metadata: name: pv-nas-itnotebooks-logs namespace: itnotebooks spec: accessModes: - ReadWriteMany resources: requests: storage: 500Gi selector: matchLabels: pvname: pv-nas-itnotebooks-logs |
Deployment挂载PVC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: null labels: app: eagle-service name: eagle-service namespace: itnotebooks spec: replicas: 2 selector: matchLabels: app: eagle-service strategy: {} template: metadata: creationTimestamp: null labels: app: eagle-service spec: volumes: - name: pv-nas-itnotebooks-logs persistentVolumeClaim: claimName: pv-nas-itnotebooks-logs containers: - image: registry-vpc.cn-hangzhou.aliyuncs.com/itnotebooks/eagle-service:3b2d44a-1626164768 name: eagle-service imagePullPolicy: Always ports: - containerPort: 8080 protocol: TCP - containerPort: 20880 protocol: TCP env: - name: STARTING_ARGS value: "-Dnacos.config.server-addr=10.23.101.13:8848 -Dnacos.config.namespace=itnotebooks" resources: {} securityContext: capabilities: {} privileged: true volumeMounts: - name: pv-nas-itnotebooks-logs mountPath: /var/apps/logs |
如果想赏钱,可以用微信扫描下面的二维码,一来能刺激我写博客的欲望,二来好维护云主机的费用; 另外再次标注博客原地址 itnotebooks.com 感谢!
