Skip to content

Commit

Permalink
use cirros for cdi
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Oct 11, 2018
1 parent c5ab989 commit 13bd858
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions administrator/kcli/kcli_plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ student[[ "%03.d" | format(node+1) ]]:
- path: /root/kube-flannel-rbac.yml
origin: kube-flannel-rbac.yml
[% endif %]
- path: /root/pvc_fedora.yml
origin: pvc_fedora.yml
- path: /root/pvc_cirros.yml
origin: pvc_cirros.yml
- path: /root/vm1_pvc.yml
origin: vm1_pvc.yml
- path: /root/vm1_registrydisk.yml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "fedora"
name: "cirros"
labels:
app: containerized-data-importer
annotations:
kubevirt.io/storage.import.endpoint: "https://download.fedoraproject.org/pub/fedora/linux/releases/28/Cloud/x86_64/images/Fedora-Cloud-Base-28-1.1.x86_64.qcow2"
cdi.kubevirt.io/storage.import.endpoint: "http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img"
spec:
accessModes:
- ReadWriteOnce
Expand Down
3 changes: 1 addition & 2 deletions administrator/kcli/vm1_pvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
template:
metadata:
creationTimestamp: null
kubevirt.io/domain: vm1
spec:
domain:
cpu:
Expand All @@ -35,7 +34,7 @@ spec:
volumes:
- name: vm1-vol0
persistentVolumeClaim:
claimName: fedora
claimName: cirros
- cloudInitNoCloud:
userData: |
#cloud-config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "fedora"
name: "cirros"
labels:
app: containerized-data-importer
annotations:
cdi.kubevirt.io/storage.import.endpoint: "https://download.fedoraproject.org/pub/fedora/linux/releases/28/Cloud/x86_64/images/Fedora-Cloud-Base-28-1.1.x86_64.qcow2"
cdi.kubevirt.io/storage.import.endpoint: "http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img"
spec:
accessModes:
- ReadWriteOnce
Expand Down
2 changes: 1 addition & 1 deletion administrator/vm1_pvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
volumes:
- name: vm1-vol0
persistentVolumeClaim:
claimName: fedora
claimName: cirros
- cloudInitNoCloud:
userData: |
#cloud-config
Expand Down
6 changes: 3 additions & 3 deletions labs/lab7/lab7.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ As an example, we will import a Fedora28 Cloud Image as a PVC and launch a Virtu

```
oc project myproject
oc create -f pvc_fedora.yml
oc create -f pvc_cirros.yml
```

This will create the PVC with a proper annotation so that CDI controller detects it and launches an importer pod to gather the image specified in the *kubevirt.io/storage.import.endpoint* annotation.
This will create the PVC with a proper annotation so that CDI controller detects it and launches an importer pod to gather the image specified in the *cdi.kubevirt.io/storage.import.endpoint* annotation.

```
oc get pvc fedora -o yaml
oc get pvc cirros -o yaml
oc get pod
IMPORTER_POD=$(oc get pod -l app=containerized-data-importer -o=custom-columns=NAME:.metadata.name --no-headers=true)
oc logs $IMPORTER_POD
Expand Down

0 comments on commit 13bd858

Please sign in to comment.