2017-02-04 9 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: PersistentVolume 
metadata: 
    name: pv0001 
spec: 
    capacity: 
    storage: 10Gi 
    accessModes: 
    - ReadWriteOnce 
    gcePersistentDisk: 
    fsType: ext4 
    pdName: pd-disk-1 

これは私の請求である:

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

これは私の展開です:

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を理解するのは簡単ではありません。これらのエラーは正確には役に立ちません。誰かが私を助けることを願っています。あなたはPVを定義する前に、実際のストレージを作成するためにきたあなたは、これは次のようにかなっで行うことができます

答えて

0

# 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 

は一度利用可能thatsのあなたはPVとPVC

+0

Thxを大量に作成することができます助けを求めて! – Tino

関連する問題