Hello World KubeVirt VM in StarlingX (r8)
- Removed the "EOF" since the cat<<EOF > command has been removed. - Updated the launch command and the workaround deployment example. Closes-bug: 2009668 Signed-off-by: Elaine Fonaro <elaine.fonaro@windriver.com> Change-Id: I2ab91b8e4735eadb8e6ffc706eee8e7fd7c717cd
This commit is contained in:
parent
3eadca9791
commit
97ee186408
@ -42,55 +42,38 @@ the |VM| via the console:
|
|||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
$ cat <<EOF > vm-cirros-containerdisk.yaml
|
apiVersion: kubevirt.io/v1
|
||||||
apiVersion: kubevirt.io/v1alpha3
|
kind: VirtualMachineInstance
|
||||||
kind: VirtualMachine
|
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
name: vm-cirros
|
||||||
kubevirt.io/vm: vm-cirros
|
|
||||||
name: vm-cirros
|
|
||||||
spec:
|
spec:
|
||||||
running: false template:
|
domain:
|
||||||
metadata:
|
devices:
|
||||||
labels:
|
disks:
|
||||||
kubevirt.io/vm: vm-cirros
|
- name: containerdisk
|
||||||
spec:
|
disk:
|
||||||
running: false
|
bus: virtio
|
||||||
template:
|
- name: cloudinitdisk
|
||||||
metadata:
|
disk:
|
||||||
labels:
|
bus: virtio
|
||||||
kubevirt.io/vm: vm-cirros
|
resources:
|
||||||
spec:
|
requests:
|
||||||
domain:
|
memory: 64M
|
||||||
devices:
|
terminationGracePeriodSeconds: 0
|
||||||
disks:
|
volumes:
|
||||||
- disk:
|
|
||||||
bus: virtio
|
|
||||||
name: containerdisk
|
|
||||||
- disk:
|
|
||||||
bus: virtio
|
|
||||||
name: cloudinitdisk
|
|
||||||
machine:
|
|
||||||
type: ""
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: 64M
|
|
||||||
terminationGracePeriodSeconds: 0
|
|
||||||
volumes:
|
|
||||||
- name: containerdisk
|
- name: containerdisk
|
||||||
containerDisk:
|
containerDisk:
|
||||||
image: kubevirt/cirros-container-disk-demo:latest
|
image: kubevirt/cirros-container-disk-demo:latest
|
||||||
- cloudInitNoCloud:
|
- name: cloudinitdisk
|
||||||
userDataBase64: IyEvYmluL3NoCgplY2hvICdwcmludGVkIGZyb20gY2xvdWQtaW5pdCB1c2VyZGF0YScK
|
cloudInitNoCloud:
|
||||||
name: cloudinitdisk
|
userDataBase64: IyEvYmluL3NoCgplY2hvICdwcmludGVkIGZyb20gY2xvdWQtaW5pdCB1c2VyZGF0YScKWQtaW5pdCB1c2VyZGF0YScK
|
||||||
EOF
|
|
||||||
|
|
||||||
#. Apply the ``yaml`` file to create the |VM| in a stopped state.
|
#. Apply the ``yaml`` file to create the |VM| in a stopped state.
|
||||||
|
|
||||||
|
|
||||||
.. code-block:: none
|
.. code-block:: none
|
||||||
|
|
||||||
$ kubectl apply -f cdi-uploadproxy-nodeport-service.yaml virtualmachine.kubevirt.io/vm-cirros created
|
$ kubectl apply -f vm-cirros-containerdisk.yaml
|
||||||
|
|
||||||
$ kubectl get vm
|
$ kubectl get vm
|
||||||
NAME AGE STATUS READY
|
NAME AGE STATUS READY
|
||||||
@ -105,11 +88,11 @@ the |VM| via the console:
|
|||||||
|
|
||||||
$ virtctl start vm-cirros
|
$ virtctl start vm-cirros
|
||||||
VM vm-cirros was scheduled to start
|
VM vm-cirros was scheduled to start
|
||||||
|
|
||||||
$ kubectl get vm
|
$ kubectl get vm
|
||||||
NAME AGE STATUS READY
|
NAME AGE STATUS READY
|
||||||
vm-cirro 87s Running True
|
vm-cirro 87s Running True
|
||||||
|
|
||||||
$ kubectl get vmi
|
$ kubectl get vmi
|
||||||
NAME AGE PHASE IP NODENAME READY
|
NAME AGE PHASE IP NODENAME READY
|
||||||
vm-cirros 17s Running 172.16.225.72 compute-2 True
|
vm-cirros 17s Running 172.16.225.72 compute-2 True
|
||||||
@ -121,29 +104,29 @@ the |VM| via the console:
|
|||||||
$ virtctl console vm-cirros
|
$ virtctl console vm-cirros
|
||||||
Successfully connected to vm-cirros console. The escape sequence is ^]
|
Successfully connected to vm-cirros console. The escape sequence is ^]
|
||||||
|
|
||||||
# login as 'cirros' user. default password: 'gocubsgo'. Use 'sudo' for root.
|
# login as 'cirros' user. default password: 'gocubsgo'. Use 'sudo' for root.
|
||||||
# vm-cirros login: cirros
|
# vm-cirros login: cirros
|
||||||
Password:
|
Password:
|
||||||
|
|
||||||
$ hostname vm-cirros
|
$ hostname vm-cirros
|
||||||
|
|
||||||
$ ls /
|
$ ls /
|
||||||
bin home lib64 mnt root tmp
|
bin home lib64 mnt root tmp
|
||||||
boot init linuxrc old-root run usr
|
boot init linuxrc old-root run usr
|
||||||
dev initrd.img lost+found opt sbin var
|
dev initrd.img lost+found opt sbin var
|
||||||
etc lib media proc sys vmlinuz
|
etc lib media proc sys vmlinuz
|
||||||
|
|
||||||
$ ip link
|
$ ip link
|
||||||
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
||||||
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether a6:77:37:4c:ee:10 brd ff:ff:ff:ff:ff:ff
|
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether a6:77:37:4c:ee:10 brd ff:ff:ff:ff:ff:ff
|
||||||
|
|
||||||
# List Interfaces
|
# List Interfaces
|
||||||
# Notice how the VM has a single eth0 interface, the default CNI interface.
|
# Notice how the VM has a single eth0 interface, the default CNI interface.
|
||||||
|
|
||||||
$ ip addr
|
$ ip addr
|
||||||
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo
|
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo
|
||||||
valid_lft forever preferred_lft forever inet6 ::1/128 scope host
|
valid_lft forever preferred_lft forever inet6 ::1/128 scope host
|
||||||
|
|
||||||
valid_lft forever preferred_lft forever
|
valid_lft forever preferred_lft forever
|
||||||
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether a6:77:37:4c:ee:10 brd ff:ff:ff:ff:ff:ff
|
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether a6:77:37:4c:ee:10 brd ff:ff:ff:ff:ff:ff
|
||||||
inet 172.16.225.72/32 brd 172.16.255.255 scope global eth0
|
inet 172.16.225.72/32 brd 172.16.255.255 scope global eth0
|
||||||
@ -157,7 +140,7 @@ the |VM| via the console:
|
|||||||
|
|
||||||
$ virtctl expose vmi vm-cirros --port=22 --name vm-cirros-ssh --type=NodePort
|
$ virtctl expose vmi vm-cirros --port=22 --name vm-cirros-ssh --type=NodePort
|
||||||
Service vm-cirros-ssh successfully exposed for vmi vm-cirros
|
Service vm-cirros-ssh successfully exposed for vmi vm-cirros
|
||||||
|
|
||||||
$ kubectl get service
|
$ kubectl get service
|
||||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||||
kuard-nodeport NodePort 10.96.155.165 <none> 80:31118/TCP 92d
|
kuard-nodeport NodePort 10.96.155.165 <none> 80:31118/TCP 92d
|
||||||
@ -176,7 +159,7 @@ the |VM| via the console:
|
|||||||
|
|
||||||
# List Interfaces
|
# List Interfaces
|
||||||
# Notice how the VM has a single eth0 interface, the default CNI interface.
|
# Notice how the VM has a single eth0 interface, the default CNI interface.
|
||||||
|
|
||||||
$ ip addr
|
$ ip addr
|
||||||
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1
|
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1
|
||||||
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
||||||
|
Loading…
x
Reference in New Issue
Block a user