2017-02-04 2 views
0

내가 GCE와 K8S에 새로 온 사람과 내가 처음으로 배포를 알아 내려고 노력하고있어,하지만 난 내 볼륨에 오류 얻을 :Google 클라우드,는 Kubernetes 및 볼륨

Failed to attach volume "pv0001" on node "xxxxx" with: GCE persistent disk not found: diskName="pd-disk-1" zone="europe-west1-b" Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "xxx". list of unattached/unmounted volumes=[registrator-claim0]

이가 내 저장 YAML :이 내 배포입니다

apiVersion: v1 
kind: PersistentVolumeClaim 
metadata: 
    creationTimestamp: null 
    name: registrator-claim0 
spec: 
    accessModes: 
    - ReadWriteOnce 
    resources: 
    requests: 
     storage: 100Mi 
status: {} 

:

apiVersion: v1 
kind: PersistentVolume 
metadata: 
    name: pv0001 
spec: 
    capacity: 
    storage: 10Gi 
    accessModes: 
    - ReadWriteOnce 
    gcePersistentDisk: 
    fsType: ext4 
    pdName: pd-disk-1 

이 내 주장이다

apiVersion: extensions/v1beta1 
kind: Deployment 
metadata: 
    creationTimestamp: null 
    name: consul 
spec: 
    replicas: 1 
    strategy: {} 
    template: 
    metadata: 
     creationTimestamp: null 
     labels: 
     service: consul 
    spec: 
     restartPolicy: Always 
     containers: 
     - name: consul 
      image: eu.gcr.io/xxxx/consul 
      ports: 
      - containerPort: 8300 
      protocol: TCP 
      - containerPort: 8400 
      protocol: TCP 
      - containerPort: 8500 
      protocol: TCP 
      - containerPort: 53 
      protocol: UDP 
      env: 
      - name: MY_POD_IP 
       valueFrom: 
       fieldRef: 
        fieldPath: status.podIP 
      args: 
      - -server 
      - -bootstrap 
      - -advertise=$(MY_POD_IP) 

     - name: registrator 
      args: 
      - -internal 
      - -ip=192.168.99.101 
      - consul://localhost:8500 
      image: eu.gcr.io/xxxx/registrator 
      volumeMounts: 
      - mountPath: /tmp/docker.sock 
       name: registrator-claim0 
     volumes: 
     - name: registrator-claim0 
      persistentVolumeClaim: 
      claimName: registrator-claim0 
status: {} 

내가 뭘 잘못하고 있니? K8과 GCE를 파악하는 것은 쉽지 않습니다. 이러한 오류는 정확하게 도움이되지 못합니다. 누군가 나를 도울 수 있기를 바랍니다.

답변

0

는 당신은 PV를 정의하기 전에 실제 스토리지를 만들했습니다, 이것은 STH 등을 수행 할 수 있습니다

# make sure you're in the right zone 
$ gcloud config set compute/europe-west1-b 

# create the disk 
$ gcloud compute disks create --size 10GB pd-disk-1 

일단 당신이 PV와 PVC 많은

+0

들으을 만들 수 있습니다 사용할 수 이잖아 도움을 청합니다! – Tino