Mirantis / virtlet

Kubernetes CRI implementation for running VM workloads
Apache License 2.0
739 stars 128 forks source link

Error trying example ubuntu-vm-rbd-block-pv #908

Closed GOVYANSONG closed 4 years ago

GOVYANSONG commented 4 years ago

Created a ceph cluster on k8s with rook-ceph. Followed instructions given at https://github.com/Mirantis/virtlet/blob/master/examples/ubuntu-vm-rbd-block-pv.yaml. After made necessary changes to my environment, the ubuntu container is stuck creation stage. Describe the pod gave following info:

Name: ubuntu-vm-rdb-block-pv Namespace: default Priority: 0 Node: fop-gaoyans3/172.20.100.252 Start Time: Tue, 08 Oct 2019 18:49:26 +0000 Labels: Annotations: VirtletCloudInitUserData: mounts:

Has anyone encountered this issue before and want to share insights?

GOVYANSONG commented 4 years ago

After much struggle, the ubuntu pod was finally created:

Normal SuccessfulMountVolume 28s (x2 over 29s) kubelet, fop-gaoyans3 MapVolume.MapDevice succeeded for volume "ceph-block-pv" globalMapPath "/var/lib/kubelet/plugins/kubernetes.io/rbd/volumeDevices/replicapool-image-tstimg" Normal SuccessfulMountVolume 28s (x2 over 29s) kubelet, fop-gaoyans3 MapVolume.MapDevice succeeded for volume "ceph-block-pv" volumeMapPath "/var/lib/kubelet/pods/64f934bf-e293-4269-8e81-218b71fc8ceb/volumeDevices/kubernetes.io~rbd" Normal Pulling 25s kubelet, fop-gaoyans3 Pulling image "virtlet.cloud/cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img" Normal Pulled 5s kubelet, fop-gaoyans3 Successfully pulled image "virtlet.cloud/cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img" Normal Created 4s kubelet, fop-gaoyans3 Created container ubuntu-vm Normal Started 3s kubelet, fop-gaoyans3 Started container ubuntu-vm

GOVYANSONG commented 4 years ago
  1. Create rook-ceph cluster for test purpose e.g. sample yaml files with word 'test' in the file name

  2. Install rook-ceph-tools

  3. Create a pool

apiVersion: ceph.rook.io/v1 kind: CephBlockPool metadata: name: replicapool namespace: rook-ceph spec: failureDomain: host replicated: size: 1 deviceClass: hdd

  1. Create admin secret

apiVersion: v1 kind: Secret metadata: name: ceph-admin namespace: default data:

Required if provisionVolume is set to true

adminID: YWRtaW4=

to get key for admin: sudo ceph auth get-key client.admin | base64

adminKey: QVFEQm9KdGRwWklOT0JBQXlWUCthZStjSDVlRGJMcTFQazltSUE9PQ== userID: YWRtaW4= userKey: QVFEQm9KdGRwWklOT0JBQXlWUCthZStjSDVlRGJMcTFQazltSUE9PQ==

  1. Create image: rbd create --size 5 replicapool/tstimg

  2. Disable warning about feature mismatch: rbd feature disable replicapool/tstimg object-map fast-diff deep-flatten

  3. Updated version of ubuntu-vm-rbd-block-pv.yaml:

apiVersion: v1 kind: PersistentVolume metadata: name: ceph-block-pv spec: accessModes: