google cloud platform - How to mount volume for docker container via yaml manifest? -
i try launch container-vm machine following yaml:
version: v1 kind: pod spec: containers: - name: simple-echo image: gcr.io/google_containers/busybox command: ['nc', '-p', '8080', '-l', '-l', '-e', 'echo', 'hello world!'] imagepullpolicy: ports: - containerport: 8080 hostport: 8080 protocol: tcp volumemounts: - name: string mountpath: /home readonly: false restartpolicy: dnspolicy: default volumes: - name: string source: # either emptydir empty directory # emptydir: {} # or hostdir pre-existing directory on host hostdir: path: /home i expect host home directory being accessible container.
however, container fails start:
e0619 05:02:09.477574 2212 http.go:54] failed read url: invalid pod: [spec.volumes[0].source: invalid value '<*>(0xc2080b79e0){hostpath:<nil> emptydir:<nil> gcepersistentdisk:<nil> awselasticblockstore:<nil> gitrepo:<nil> secret:<nil> nfs:<nil> iscsi:<nil> glusterfs:<nil> persistentvolumeclaimvolumesource:<nil> rbd:<nil>}': 1 volume type required spec.containers[0].volumemounts[0].name: not found 'string'] what correct way specify volume container?
try replacing hostdir hostpath mentioned in v1beta3-conversion-tips-from-v1beta12.
try replacing
volumes: - name: string source: # either emptydir empty directory # emptydir: {} # or hostdir pre-existing directory on host hostdir: path: /home with
volumes: - name: string hostpath: path: /home at bottom of configuration.
Comments
Post a Comment