This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "github.com/containerd/containerd" | |
| "github.com/containerd/containerd/images" | |
| "github.com/containerd/containerd/namespaces" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "time" | |
| "github.com/containers/libpod/libpod" | |
| cc "github.com/containers/libpod/pkg/spec" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bufio" | |
| "flag" | |
| "log" | |
| "os" | |
| "strings" | |
| "github.com/moby/buildkit/client/llb" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ virtctl version | |
| Client Version: version.Info{GitVersion:"v0.14.0", GitCommit:"99129b309dae399061d38924744ded0ec0ea72c9", GitTreeState:"clean", BuildDate:"2019-02-04T13:49:57Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"} | |
| Server Version: version.Info{GitVersion:"v0.15.0", GitCommit:"432f91f3a2bdb3c2624377ad327270c9e146d845", GitTreeState:"clean", BuildDate:"2019-03-05T09:55:30Z", GoVersion:"go1.11.4", Compiler:"gc", Platform:"linux/amd64"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ kubectl get all -n kubevirt | |
| NAME READY STATUS RESTARTS AGE | |
| pod/virt-api-7dcc9874d8-5p82r 1/1 Running 0 2d18h | |
| pod/virt-api-7dcc9874d8-xf2t5 1/1 Running 0 2d18h | |
| pod/virt-controller-7c5994776b-gdbds 1/1 Running 0 2d18h | |
| pod/virt-controller-7c5994776b-pj6pm 1/1 Running 0 2d18h | |
| pod/virt-handler-j6rj6 1/1 Running 0 2d18h | |
| NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | |
| service/kubevirt-prometheus-metrics ClusterIP 10.98.59.124 <none> 443/TCP 2d18h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo VBoxManage clonehd --format RAW trac-centos.vdi trac-centos.img | |
| [sudo] password for kunal: | |
| 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% | |
| Clone medium created in format 'RAW'. UUID: be24634a-101b-4156-9e73-09aa37333efd | |
| $ sudo qemu-img convert -f raw trac-centos.img -O qcow2 trac-centos.qcow2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cat Dockerfile | |
| FROM kubevirt/container-disk-v1alpha | |
| ADD trac-centos.qcow2 /disk | |
| $ docker build -t kunalkushwaha/trac-centos:latest . | |
| Sending build context to Docker daemon 2.133GB | |
| Step 1/2 : FROM kubevirt/container-disk-v1alpha | |
| ---> a3d1f6eb33c4 | |
| Step 2/2 : ADD trac-centos.qcow2 /disk | |
| ---> fe85a76da724 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: kubevirt.io/v1alpha3 | |
| kind: VirtualMachineInstance | |
| metadata: | |
| labels: | |
| kubevirt.io/vm: vmi-trac | |
| name: vmi-trac | |
| spec: | |
| terminationGracePeriodSeconds: 30 | |
| domain: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ kubectl apply -f postrgess-vmi.yaml | |
| virtualmachineinstance.kubevirt.io/vmi-trac created | |
| $ kubectl get vmi | |
| NAME AGE PHASE IP NODENAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ virtctl expose virtualmachineinstance vmi-trac --name trac --type NodePort --target-port 22 | |
| Service trac successfully exposed for virtualmachineinstance vmi-trac | |
| $ kubectl get service | |
| NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | |
| kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 3d2h | |
| trac NodePort 10.108.30.13 <none> 80:30322/TCP,22:31358/TCP 2s |