我指定:
这是部署:
apiVersion: apps/v1beta1
kind: Deployment
...
volumeMounts:
- name: volumepath
mountPath: /data
ports:
- containerPort: 9200
name: http
protocol: TCP
volumes:
- name: volumepath
persistentVolumeClaim:
claimName: pv-delay-bind
这是持久卷:
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-delay-bind
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 10Gi
hostPath:
path: /data/
type: DirectoryOrCreate
storageClassName: default1a