I have problem with persistent storage in Kubernetes. Without persistent storage I can run success. However when add persistent storage I get stuck at creating container.
This is file deployment:
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: persistent-storage
restartPolicy: Always
volumes: # Add this section
- name: persistent-storage
persistentVolumeClaim:
claimName: efs-claim
status: {}
This is result when I run without persistent storage.
This is the reference I follow: https://aws.amazon.com/blogs/storage/persistent-storage-for-kubernetes/
and the config
Thank for your attention