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

Commit a36f4ce

Browse files
author
James Oliver
committed
RancherVM v0.1.0
Images: rancher/vm:v0.1.0 rancher/vm-frontend:v0.1.0 rancher/vm-novnc:v0.1.0 rancher/vm-tools:v0.1.0
1 parent f514d62 commit a36f4ce

File tree

7 files changed

+37
-15
lines changed

7 files changed

+37
-15
lines changed

deploy/ranchervm.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,15 @@ spec:
126126
topologyKey: "kubernetes.io/hostname"
127127
containers:
128128
- name: vm-controller
129-
image: rancher/vm
129+
image: rancher/vm:v0.1.0
130130
imagePullPolicy: Always
131131
args:
132132
- -vm
133133
- -bridge-iface=ens33
134134
- -v=3
135+
- -image-novnc=rancher/vm-novnc:v0.1.0
136+
- -image-tools=rancher/vm-tools:v0.1.0
137+
- -image-vm=rancher/vm:v0.1.0
135138
serviceAccountName: ranchervm-service-account
136139
---
137140
apiVersion: apps/v1beta1
@@ -158,7 +161,7 @@ spec:
158161
hostNetwork: true
159162
containers:
160163
- name: ip-controller
161-
image: rancher/vm
164+
image: rancher/vm:v0.1.0
162165
imagePullPolicy: Always
163166
command: [ "sh", "-c"]
164167
args:
@@ -169,7 +172,7 @@ spec:
169172
fieldRef:
170173
fieldPath: spec.nodeName
171174
- name: arp-scanner
172-
image: rancher/vm
175+
image: rancher/vm:v0.1.0
173176
imagePullPolicy: Always
174177
command: [ "bash", "-c"]
175178
# This is probably too aggressive for anything bigger than class 3 network
@@ -209,7 +212,7 @@ spec:
209212
topologyKey: "kubernetes.io/hostname"
210213
containers:
211214
- name: backend
212-
image: rancher/vm
215+
image: rancher/vm:v0.1.0
213216
imagePullPolicy: Always
214217
args:
215218
- -backend
@@ -251,7 +254,7 @@ spec:
251254
topologyKey: "kubernetes.io/hostname"
252255
containers:
253256
- name: frontend
254-
image: rancher/vm-frontend
257+
image: rancher/vm-frontend:v0.1.0
255258
imagePullPolicy: Always
256259
---
257260
apiVersion: v1

image/novnc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
NAME = rancher/novnc
2-
VERSION = 0.0.1
1+
NAME = rancher/vm-novnc
2+
VERSION = v0.1.0
33

44
.PHONY : all clean build
55

image/ubuntu/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
## Default credentials:
22
- Username: `ubuntu`
33
- Password: `ubuntu`
4+
5+
## How to build
6+
7+
```
8+
curl -LO https://s3-us-west-1.amazonaws.com/ranchervm/iso/ubuntu-16.04.4-server-amd64.iso
9+
qemu-img create -f qcow2 ubuntu-16.04.4-server-amd64.img 50G
10+
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
11+
# Perform installation - guided w/LVM, add OpenSSH Server
12+
# Reboot, then turn off password SSH, install python and cloud-init, disable swap, clear history
13+
# Pull any Docker images that should be cached now
14+
qemu-img convert -O qcow2 -c ubuntu-16.04.4-server-amd64.img ubuntu-16.04.4-server-amd64.qcow2
15+
```
16+

image/vm-tools/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = rancher/vm-tools
2-
VERSION = 0.0.3
2+
VERSION = v0.1.0
33
BASE_IMAGE=RancherVM-debootstrap-ubuntu-1604.tgz
44

55
.PHONY : all clean build

pkg/common/constants.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package common
22

3+
import (
4+
"flag"
5+
)
6+
37
const (
48
HostStateBaseDir = "/var/lib/rancher/vm"
59

610
FinalizerDeletion = "deletion.vm.rancher.io"
711
NamespaceVM = "default"
812
NameDelimiter = "-"
913

10-
ImageVM = "rancher/vm"
11-
ImageVMTools = "rancher/vm-tools"
12-
ImageNoVNC = "rancher/novnc"
13-
1414
RancherOUI = "06:fe"
1515

1616
LabelApp = "ranchervm"
@@ -19,3 +19,9 @@ const (
1919
LabelRoleNoVNC = "novnc"
2020
LabelNodeHostname = "kubernetes.io/hostname"
2121
)
22+
23+
var (
24+
ImageVM = flag.String("image-vm", "rancher/vm:latest", "VM Docker Image")
25+
ImageNoVNC = flag.String("image-novnc", "rancher/vm-novnc:latest", "NoVNC Docker Image")
26+
ImageVMTools = flag.String("image-tools", "rancher/vm-tools:latest", "Tools Docker Image")
27+
)

pkg/controller/vm/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func (ctrl *VirtualMachineController) makeVMPod(vm *v1alpha1.VirtualMachine, ifa
155155
InitContainers: []corev1.Container{
156156
corev1.Container{
157157
Name: "debootstrap",
158-
Image: common.ImageVMTools,
158+
Image: *common.ImageVMTools,
159159
ImagePullPolicy: corev1.PullAlways,
160160
VolumeMounts: []corev1.VolumeMount{
161161
common.MakeVolumeMount("vm-fs", "/vm-tools", "", false),
@@ -274,7 +274,7 @@ func makeNovncPod(vm *v1alpha1.VirtualMachine, podName string) *corev1.Pod {
274274
Containers: []corev1.Container{
275275
corev1.Container{
276276
Name: common.LabelRoleNoVNC,
277-
Image: common.ImageNoVNC,
277+
Image: *common.ImageNoVNC,
278278
ImagePullPolicy: corev1.PullAlways,
279279
Command: []string{"novnc"},
280280
Env: []corev1.EnvVar{

pkg/qemu/job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func NewMigrationJob(vm *v1alpha1.VirtualMachine, podName, targetURI string) *ba
3333
Containers: []corev1.Container{
3434
corev1.Container{
3535
Name: common.LabelRoleMigrate,
36-
Image: common.ImageVM,
36+
Image: *common.ImageVM,
3737
ImagePullPolicy: corev1.PullAlways,
3838
Command: []string{"sh", "-c"},
3939
Args: []string{fmt.Sprintf("exec /ranchervm -migrate -sock-path /vm/%s_monitor.sock -target-uri %s -v 5", podName, targetURI)},

0 commit comments

Comments
 (0)