Add e2e script for Virtlet VM provisioning
[icn.git] / cmd / bpa-operator / deploy / virtlet-deployment-sample.yaml
1 apiVersion: apps/v1
2 kind: Deployment
3 metadata:
4   name: virtlet-deployment
5   labels:
6     app: virtlet
7 spec:
8   replicas: 1
9   selector:
10     matchLabels:
11       app: virtlet
12   template:
13     metadata:
14       labels:
15         app: virtlet
16       annotations:
17         VirtletLibvirtCPUSetting: |
18           mode: host-passthrough
19         # This tells CRI Proxy that this pod belongs to Virtlet runtime
20         kubernetes.io/target-runtime: virtlet.cloud
21         VirtletCloudInitUserData: |
22           ssh_pwauth: True
23           disable_root: false
24           chpasswd: {expire: False}
25           manage_resolv_conf: True
26           resolv_conf:
27             nameservers: ['8.8.8.8', '8.8.4.4']
28           users:
29           - name: root
30             gecos: User
31             primary-group: root
32             groups: users
33             lock_passwd: false
34             shell: /bin/bash
35             sudo: ALL=(ALL) NOPASSWD:ALL
36             ssh_authorized_keys:
37               $ssh_key
38           runcmd:
39             - sed -i -e 's/^#DNS=.*/DNS=8.8.8.8/g' /etc/systemd/resolved.conf
40             - systemctl daemon-reload
41             - systemctl restart systemd-resolved
42         v1.multus-cni.io/default-network: '[
43             { "name": "flannel-vm",
44               "mac": "c2:b4:57:49:47:f1" }]'
45         VirtletRootVolumeSize: 8Gi
46         VirtletVCPUCount: "2"
47     spec:
48       affinity:
49         nodeAffinity:
50           requiredDuringSchedulingIgnoredDuringExecution:
51             nodeSelectorTerms:
52             - matchExpressions:
53               - key: extraRuntime
54                 operator: In
55                 values:
56                 - virtlet
57       containers:
58       - name: virtlet-deployment
59         # This specifies the image to use.
60         # virtlet.cloud/ prefix is used by CRI proxy, the remaining part
61         # of the image name is prepended with https:// and used to download the image
62         image: virtlet.cloud/ubuntu/18.04
63         imagePullPolicy: IfNotPresent
64         # tty and stdin required for "kubectl attach -t" to work
65         tty: true
66         stdin: true
67         resources:
68           requests:
69             cpu: 2
70             memory: 8Gi
71           limits:
72             # This memory limit is applied to the libvirt domain definition
73             cpu: 2
74             memory: 8Gi