这是我的部署:
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -f ../docker-compose.yml
kompose.version: 1.24.0 (4a2a0458)
creationTimestamp: null
labels:
io.kompose.service: etcd
name: etcd
spec:
replicas: 2
selector:
matchLabels:
io.kompose.service: etcd
strategy: {}
template:
metadata:
annotations:
kompose.cmd: kompose convert -f ../docker-compose.yml
kompose.version: 1.24.0 (4a2a0458)
creationTimestamp: null
labels:
io.kompose.service: etcd
spec:
containers:
- env:
- name: ALLOW_NONE_AUTHENTICATION
value: "yes"
- name: ETCD_ADVERTISE_CLIENT_URLS
value: http://0.0.0.0:2379
- name: ETCD_ENABLE_V2
value: "true"
- name: ETCD_LISTEN_CLIENT_URLS
value: http://0.0.0.0:2379
image: bitnami/etcd:3.5.11
name: etcd
ports:
- containerPort: 2379
volumeMounts:
- mountPath: "/bitnami/etcd"
name: task-pv-storage
restartPolicy: Always
volumes: # Add this section
- name: task-pv-storage
persistentVolumeClaim:
claimName: task-pv-claim
status: {}
这是我遵循的参考:https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/
如何解决?感谢您的关注
我也遇到过同样的情况。我通过给目录授予777权限解决了这个问题
chmod 777 /bitnami/etcd