In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use NAS dynamic storage volumes to create stateful applications". In daily operation, I believe many people have doubts about how to use NAS dynamic storage volumes to create stateful applications. I have consulted various materials and sorted out simple and easy operation methods. I hope to help you answer the doubts about "how to use NAS dynamic storage volumes to create stateful applications"! Next, please follow the small series to learn together!
Introduction:
At present, the implementation of dynamically generating NAS storage volume: automatically generating a child file system (subdirectory) on an existing file system, and generating a target storage volume (PV);
The generated PV name is: pvc-${pv-uid}
Image introduction: registry.cn-hangzhou.aliyuncs.com/acs/alicloud-nas-controller:v3.1.0-k8s1.11 Deployment:
Before deployment, create a NAS file system and add mount points. Note: Mount points need to be within the same VPC as the cluster.
In the deployment template, when creating Storageclass, you can define the reclaimPolicy type, which can be Retain or Delete;
Modify NFS_SERVER and server values according to your NAS mount point;
apiVersion: storage.k8s.io/v1kind: StorageClassmetadata: name: alicloud-nasmountOptions:- vers=4.0provisioner: alicloud/nasreclaimPolicy: Retain---kind: DeploymentapiVersion: extensions/v1beta1metadata: name: alicloud-nas-controller namespace: kube-systemspec: replicas: 1 strategy: type: Recreate template: metadata: labels: app: alicloud-nas-controller spec: tolerations: - effect: NoSchedule operator: Exists key: node-role.kubernetes.io/master - effect: NoSchedule operator: Exists key: node.cloudprovider.kubernetes.io/uninitialized nodeSelector: node-role.kubernetes.io/master: "" serviceAccount: admin containers: - name: alicloud-nas-controller image: registry.cn-hangzhou.aliyuncs.com/acs/alicloud-nas-controller:v3.1.0-k8s1.11 volumeMounts: - mountPath: /persistentvolumes name: nfs-client-root env: - name: PROVISIONER_NAME value: alicloud/nas - name: NFS_SERVER value: 0cd8b4a576-mmi32.cn-hangzhou.nas.aliyuncs.com - name: NFS_PATH value: / volumes: - name: nfs-client-root nfs: server: 0cd8b4a576-mmi32.cn-hangzhou.nas.aliyuncs.com path: /test: apiVersion: apps/v1beta1kind: StatefulSetmetadata: name: webspec: serviceName: "nginx" replicas: 2 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:alpine volumeMounts: - mountPath: "/data" name: html volumeClaimTemplates: - metadata: name: html spec: accessModes: - ReadWriteOnce storageClassName: alicloud-nas resources: requests: storage: 2Gi# kubectl get pvNAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGEpvc-945ca15d-e0ab-11e8-9d2f-00163e145c08 2Gi RWO Retain Bound default/html-web-0 alicloud-nas-retain 13mpvc-9a162bb2-e0ab-11e8-9d2f-00163e145c08 2Gi RWO Retain Bound Here, the study on "How to use NAS dynamic storage volumes to create stateful applications" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 218
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.