Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

Commit

Permalink
RancherVM v0.1.0
Browse files Browse the repository at this point in the history
Images:
rancher/vm:v0.1.0
rancher/vm-frontend:v0.1.0
rancher/vm-novnc:v0.1.0
rancher/vm-tools:v0.1.0
  • Loading branch information
James Oliver committed Aug 24, 2018
1 parent f514d62 commit a36f4ce
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 15 deletions.
13 changes: 8 additions & 5 deletions deploy/ranchervm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,15 @@ spec:
topologyKey: "kubernetes.io/hostname"
containers:
- name: vm-controller
image: rancher/vm
image: rancher/vm:v0.1.0
imagePullPolicy: Always
args:
- -vm
- -bridge-iface=ens33
- -v=3
- -image-novnc=rancher/vm-novnc:v0.1.0
- -image-tools=rancher/vm-tools:v0.1.0
- -image-vm=rancher/vm:v0.1.0
serviceAccountName: ranchervm-service-account
---
apiVersion: apps/v1beta1
Expand All @@ -158,7 +161,7 @@ spec:
hostNetwork: true
containers:
- name: ip-controller
image: rancher/vm
image: rancher/vm:v0.1.0
imagePullPolicy: Always
command: [ "sh", "-c"]
args:
Expand All @@ -169,7 +172,7 @@ spec:
fieldRef:
fieldPath: spec.nodeName
- name: arp-scanner
image: rancher/vm
image: rancher/vm:v0.1.0
imagePullPolicy: Always
command: [ "bash", "-c"]
# This is probably too aggressive for anything bigger than class 3 network
Expand Down Expand Up @@ -209,7 +212,7 @@ spec:
topologyKey: "kubernetes.io/hostname"
containers:
- name: backend
image: rancher/vm
image: rancher/vm:v0.1.0
imagePullPolicy: Always
args:
- -backend
Expand Down Expand Up @@ -251,7 +254,7 @@ spec:
topologyKey: "kubernetes.io/hostname"
containers:
- name: frontend
image: rancher/vm-frontend
image: rancher/vm-frontend:v0.1.0
imagePullPolicy: Always
---
apiVersion: v1
Expand Down
4 changes: 2 additions & 2 deletions image/novnc/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME = rancher/novnc
VERSION = 0.0.1
NAME = rancher/vm-novnc
VERSION = v0.1.0

.PHONY : all clean build

Expand Down
13 changes: 13 additions & 0 deletions image/ubuntu/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## Default credentials:
- Username: `ubuntu`
- Password: `ubuntu`

## How to build

```
curl -LO https://s3-us-west-1.amazonaws.com/ranchervm/iso/ubuntu-16.04.4-server-amd64.iso
qemu-img create -f qcow2 ubuntu-16.04.4-server-amd64.img 50G
qemu-system-x86_64 -enable-kvm -m size=4096 -smp cpus=1 -vnc 0.0.0.0:0 -cdrom ubuntu-16.04.4-server-amd64.iso -drive file=ubuntu-16.04.4-server-amd64.img -netdev bridge,br=br0,id=net0 -device virtio-net-pci,netdev=net0,mac=06:fe:a7:1d:03:c5
# Perform installation - guided w/LVM, add OpenSSH Server
# Reboot, then turn off password SSH, install python and cloud-init, disable swap, clear history
# Pull any Docker images that should be cached now
qemu-img convert -O qcow2 -c ubuntu-16.04.4-server-amd64.img ubuntu-16.04.4-server-amd64.qcow2
```

2 changes: 1 addition & 1 deletion image/vm-tools/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME = rancher/vm-tools
VERSION = 0.0.3
VERSION = v0.1.0
BASE_IMAGE=RancherVM-debootstrap-ubuntu-1604.tgz

.PHONY : all clean build
Expand Down
14 changes: 10 additions & 4 deletions pkg/common/constants.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package common

import (
"flag"
)

const (
HostStateBaseDir = "/var/lib/rancher/vm"

FinalizerDeletion = "deletion.vm.rancher.io"
NamespaceVM = "default"
NameDelimiter = "-"

ImageVM = "rancher/vm"
ImageVMTools = "rancher/vm-tools"
ImageNoVNC = "rancher/novnc"

RancherOUI = "06:fe"

LabelApp = "ranchervm"
Expand All @@ -19,3 +19,9 @@ const (
LabelRoleNoVNC = "novnc"
LabelNodeHostname = "kubernetes.io/hostname"
)

var (
ImageVM = flag.String("image-vm", "rancher/vm:latest", "VM Docker Image")
ImageNoVNC = flag.String("image-novnc", "rancher/vm-novnc:latest", "NoVNC Docker Image")
ImageVMTools = flag.String("image-tools", "rancher/vm-tools:latest", "Tools Docker Image")
)
4 changes: 2 additions & 2 deletions pkg/controller/vm/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (ctrl *VirtualMachineController) makeVMPod(vm *v1alpha1.VirtualMachine, ifa
InitContainers: []corev1.Container{
corev1.Container{
Name: "debootstrap",
Image: common.ImageVMTools,
Image: *common.ImageVMTools,
ImagePullPolicy: corev1.PullAlways,
VolumeMounts: []corev1.VolumeMount{
common.MakeVolumeMount("vm-fs", "/vm-tools", "", false),
Expand Down Expand Up @@ -274,7 +274,7 @@ func makeNovncPod(vm *v1alpha1.VirtualMachine, podName string) *corev1.Pod {
Containers: []corev1.Container{
corev1.Container{
Name: common.LabelRoleNoVNC,
Image: common.ImageNoVNC,
Image: *common.ImageNoVNC,
ImagePullPolicy: corev1.PullAlways,
Command: []string{"novnc"},
Env: []corev1.EnvVar{
Expand Down
2 changes: 1 addition & 1 deletion pkg/qemu/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewMigrationJob(vm *v1alpha1.VirtualMachine, podName, targetURI string) *ba
Containers: []corev1.Container{
corev1.Container{
Name: common.LabelRoleMigrate,
Image: common.ImageVM,
Image: *common.ImageVM,
ImagePullPolicy: corev1.PullAlways,
Command: []string{"sh", "-c"},
Args: []string{fmt.Sprintf("exec /ranchervm -migrate -sock-path /vm/%s_monitor.sock -target-uri %s -v 5", podName, targetURI)},
Expand Down

0 comments on commit a36f4ce

Please sign in to comment.