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