apiVersion: v1 kind: PersistentVolume metadata: name: chandao-pv spec: accessModes: - ReadWriteMany capacity: storage: 20Gi persistentVolumeReclaimPolicy: Retain storageClassName: nfs nfs: path: /usr/local/data/chandao/ server: 10.168.12.91,10.168.10.205 volumeMode: Filesystem claimRef: name: chandao-pvc namespace: lstack --------------------------------- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: chandao-pvc namespace: lstack spec: accessModes: - ReadWriteMany storageClassName: "" volumeName: chandao-pv resources: requests: storage: 20Gi ------------------------------- apiVersion: v1 kind: Service metadata: labels: app: chandao name: chandao-client namespace: lstack spec: ports: - name: chandao port: 80 targetPort: 80 nodePort: 31526 - name: chandao-mysql port: 3306 targetPort: 3306 nodePort: 31527 selector: app: chandao type: NodePort ------------------------------- apiVersion: apps/v1 kind: Deployment metadata: name: chandao namespace: lstack labels: app: chandao spec: selector: matchLabels: app: chandao replicas: 1 template: metadata: labels: app: chandao spec: containers: - name: chandao image: easysoft/zentao:18.3 resources: requests: memory: "2Gi" cpu: "2000m" env: - name: MYSQL_ROOT_PASSWORD value: '123456' ports: - name: chandao containerPort: 80 - name: chandao-mysql containerPort: 3306 volumeMounts: - name: chandao mountPath: /www/zentaopms volumes: - name: chandao persistentVolumeClaim: claimName: chandao-pvc