This will create an OpenShift cluster with one manster and one node via Vagrant:
make cluster-up
make cluster-openshift
The deployment can take pretty long. Also you will not see much output from the openshift installer while it is running. To see what is going on in the installer run
vagrant ssh master -c "tailf /ansible.log"
Once the deployment is done, you can directly talk to the master via ./oc.sh
:
$ ./oc.sh get nodes
NAME STATUS ROLES AGE VERSION
master Ready master 3h v1.9.1+a0ce1bc657
node Ready <none> 3h v1.9.1+a0ce1bc657
Note: Right now we only support having a single master.
To deploy storage
run
make cluster-storage
Once it is done, you can see the storage deployed:
$ ./oc.sh get pods -n kube-system
NAME READY STATUS RESTARTS AGE
ceph-demo-0 7/7 Running 2 52m
To test the installation, start a pod which requests storage from that provisioner:
$ ./oc.sh create -f examples/storage-pod.yaml
$ /oc.sh get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
demo-pvc Bound pvc-2d1a98e1-12ef-11e8-a1c4-525400cc240d 1Gi RWO standalone-cinder 24m
$ ./oc.sh get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pvc-2d1a98e1-12ef-11e8-a1c4-525400cc240d 1Gi RWO Delete Bound default/demo-pvc standalone-cinder 24m
To deploy KubeVirt
run
make cluster-kubevirt
Once it is done, you can see all KubeVirt pods deployed:
$ ./oc.sh get pods -n kube-system
NAME READY STATUS RESTARTS AGE
virt-controller-66d948c84-kmfxs 0/1 Running 0 17m
virt-controller-66d948c84-mmmnx 1/1 Running 0 17m
virt-handler-64sjz 1/1 Running 0 17m
virt-handler-ps8ds 1/1 Running 0 17m
To test the installation, start a vm with alpine:
$ ./oc.sh create -f examples/vm.yaml
$ sleep 300 # We need to pull a lot when the first vm starts on a node
$ ./oc.sh get vms -o yaml | grep phase
phase: Running
To connect to a VM:
./oc.sh console demo-vm # Serial console
./oc.sh vnc demo-vm # VNC
To import and run a cirros vm:
$ ./oc.sh create -f examples/import-cirros.yaml
$ sleep 120 # The cirros disk image downloads into a PVC
$ ./oc.sh get pod disk-importer # Repeat until pod is Completed
$ ./oc.sh create -f examples/vm-cirros-clone.yaml
$ ./oc.sh get vms -o yaml | grep phase
phase: Running
To configure KubeVirt provider
run
make cluster-miq
Once it is done, you can see that service account was created
./oc.sh get sa
NAME SECRETS AGE
builder 2 20m
default 3 19m
deployer 2 20m
miq 2 19s
registry 3 14m
router 2 14m
and offlinevms custom resource was created
./oc.sh get offlinevms
No resources found.
In order to configure provider in ManageIQ
there are two tokens needed by running
./oc.sh sa get-token -n management-infra management-admin
./oc.sh sa get-token -n default miq
First create an inventory:
[nodes]
node1 ansible_host=192.168.200.4 ansible_user=root
node2 ansible_host=192.168.200.3 ansible_user=root
[master]
master ansible_host=192.168.200.2 ansible_user=root
Save it in myinventory
. Then run
ansible-playbook -i myinventory openshift.yaml
ansible-playbook -i myinventory storage.yaml
ansible-playbook -i myinventory kubevirt.yaml
``