-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathweb-amd64-vm.yaml
More file actions
74 lines (74 loc) · 2.09 KB
/
web-amd64-vm.yaml
File metadata and controls
74 lines (74 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: web-amd64
namespace: default
labels:
app: web-amd64
arch: amd64
spec:
running: true
template:
metadata:
labels:
kubevirt.io/domain: web-amd64
app: web-amd64
arch: amd64
spec:
nodeSelector:
kubernetes.io/hostname: compute-1.ocp6.test.mainz
domain:
cpu:
sockets: 1
cores: 2
threads: 1
resources:
requests:
memory: 2Gi
devices:
disks:
- name: containerdisk
disk:
bus: virtio
- name: cloudinitdisk
disk:
bus: virtio
interfaces:
- name: default
masquerade: {}
ports:
- name: http
port: 80
networks:
- name: default
pod: {}
volumes:
- name: containerdisk
containerDisk:
image: quay.io/containerdisks/fedora:latest
imagePullPolicy: IfNotPresent
- name: cloudinitdisk
cloudInitNoCloud:
userData: |
#cloud-config
hostname: web-amd64
users:
- name: fedora
lock_passwd: false
passwd: "$6$rounds=4096$7b5gG6Y6$8kYx0zjH7s2v3aEDWQ3eQWf0uW1oK8g6yC6b7g8h9iJkLmNoPq" # password 'fedora' (not critical for demo)
write_files:
- path: /usr/share/nginx/html/index.html
permissions: '0644'
owner: root:root
content: |
<!doctype html>
<html><head><title>Web on x86</title></head>
<body>
<h1>Greeting from an x86_64 machine</h1>
<p>Hostname: {{ ds.meta_data.hostname }}</p>
<p>Arch (from uname): $(uname -m)</p>
</body></html>
runcmd:
- [ sh, -c, 'dnf -y install nginx' ]
- [ sh, -c, 'systemctl disable --now firewalld || true' ]
- [ sh, -c, 'systemctl enable --now nginx' ]