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:
Elaine Fonaro 2023-03-15 21:57:40 -03:00
parent 3eadca9791
commit 97ee186408

View File

@ -42,55 +42,38 @@ the |VM| via the console:
.. code-block:: yaml
$ cat <<EOF > vm-cirros-containerdisk.yaml
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
apiVersion: kubevirt.io/v1
kind: VirtualMachineInstance
metadata:
labels:
kubevirt.io/vm: vm-cirros
name: vm-cirros
name: vm-cirros
spec:
running: false template:
metadata:
labels:
kubevirt.io/vm: vm-cirros
spec:
running: false
template:
metadata:
labels:
kubevirt.io/vm: vm-cirros
spec:
domain:
devices:
disks:
- disk:
bus: virtio
name: containerdisk
- disk:
bus: virtio
name: cloudinitdisk
machine:
type: ""
resources:
requests:
memory: 64M
terminationGracePeriodSeconds: 0
volumes:
domain:
devices:
disks:
- name: containerdisk
disk:
bus: virtio
- name: cloudinitdisk
disk:
bus: virtio
resources:
requests:
memory: 64M
terminationGracePeriodSeconds: 0
volumes:
- name: containerdisk
containerDisk:
image: kubevirt/cirros-container-disk-demo:latest
- cloudInitNoCloud:
userDataBase64: IyEvYmluL3NoCgplY2hvICdwcmludGVkIGZyb20gY2xvdWQtaW5pdCB1c2VyZGF0YScK
name: cloudinitdisk
EOF
- name: cloudinitdisk
cloudInitNoCloud:
userDataBase64: IyEvYmluL3NoCgplY2hvICdwcmludGVkIGZyb20gY2xvdWQtaW5pdCB1c2VyZGF0YScKWQtaW5pdCB1c2VyZGF0YScK
#. Apply the ``yaml`` file to create the |VM| in a stopped state.
.. 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
NAME AGE STATUS READY
@ -105,11 +88,11 @@ the |VM| via the console:
$ virtctl start vm-cirros
VM vm-cirros was scheduled to start
$ kubectl get vm
NAME AGE STATUS READY
vm-cirro 87s Running True
$ kubectl get vmi
NAME AGE PHASE IP NODENAME READY
vm-cirros 17s Running 172.16.225.72 compute-2 True
@ -121,29 +104,29 @@ the |VM| via the console:
$ virtctl console vm-cirros
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
Password:
$ hostname vm-cirros
$ ls /
bin home lib64 mnt root tmp
boot init linuxrc old-root run usr
bin home lib64 mnt root tmp
boot init linuxrc old-root run usr
dev initrd.img lost+found opt sbin var
etc lib media proc sys vmlinuz
$ 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
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
# Notice how the VM has a single eth0 interface, the default CNI interface.
$ 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
valid_lft forever preferred_lft forever inet6 ::1/128 scope host
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
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
Service vm-cirros-ssh successfully exposed for vmi vm-cirros
$ kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kuard-nodeport NodePort 10.96.155.165 <none> 80:31118/TCP 92d
@ -176,7 +159,7 @@ the |VM| via the console:
# List Interfaces
# Notice how the VM has a single eth0 interface, the default CNI interface.
$ 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