PertantVolume을 사용하여 Linux 컨테이너의 전체 "/" 디렉터리를 마운트할 수 있습니까?
설치하려고 하는데 실패하네요. 기본적으로 여러 변경 사항을 적용하고 포드 충돌/재시작 시에도 이러한 변경 사항이 지속되기를 원하는 컨테이너가 필요합니다.
ubuntu@kops:/tmp$ cat pod.yaml
kind: Deployment
apiVersion: apps/v1beta2
metadata:
name: task-pod
spec:
replicas: 1
selector:
matchLabels:
app: testing
template:
metadata:
labels:
app: testing
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
volumeMounts:
- mountPath: "/"
name: task-pv
volumes:
- name: task-pv
persistentVolumeClaim:
claimName: task-pvc
실수
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 40s default-scheduler Successfully assigned task-pod-5569b7b85f-8vkwh to ip-172-20-48-22.us-west-2.compute.internal
Normal SuccessfulMountVolume 39s kubelet, ip-172-20-48-22.us-west-2.compute.internal MountVolume.SetUp succeeded for volume "default-token-p4qnh"
Normal SuccessfulMountVolume 23s kubelet, ip-172-20-48-22.us-west-2.compute.internal MountVolume.SetUp succeeded for volume "pvc-c5d5e0d7-4c8a-11e8-8b60-065b35183c1c"
Normal Pulled 9s (x3 over 22s) kubelet, ip-172-20-48-22.us-west-2.compute.internal Container image "nginx:1.7.9" already present on machine
Warning Failed 9s (x3 over 22s) kubelet, ip-172-20-48-22.us-west-2.compute.internal Error: Error response from daemon: invalid bind mount spec "/var/lib/kubelet/pods/7f777534-4c8f-11e8-8b60-065b35183c1c/volumes/kubernetes.io~aws-ebs/pvc-c5d5e0d7-4c8a-11e8-8b60-065b35183c1c:/": invalid volume specification: '/var/lib/kubelet/pods/7f777534-4c8f-11e8-8b60-065b35183c1c/volumes/kubernetes.io~aws-ebs/pvc-c5d5e0d7-4c8a-11e8-8b60-065b35183c1c:/': invalid mount config for type "bind": invalid specification: destination can't be '/'
Warning FailedSync 9s (x3 over 22s) kubelet, ip-172-20-48-22.us-west-2.compute.internal Error syncing pod