-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add an example for VirtletLibvirtCPUSetting
Signed-off-by: yanxuean <[email protected]>
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# This example is ubuntu-vm.yaml one extended with cpu setting by libvirt domain definition | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: ubuntu-vm-with-nested-virtualization | ||
annotations: | ||
kubernetes.io/target-runtime: virtlet.cloud | ||
VirtletSSHKeys: | | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost | ||
# Set VirtletCPUModel to host-model to enable nested virtualization | ||
VirtletCPUModel: host-model | ||
# Set VirtletLibvirtCPUSetting to directly use cpu definition of libvirt | ||
# for "mode": host-model, host-passthrough,custom | ||
# for "model": Westmere, SandyBridge, etc. see file: /usr/local/share/libvirt/cpu_map.xml | ||
# The VirtletLibvirtCPUSetting take precedence over VirtletCPUModel. | ||
VirtletLibvirtCPUSetting: | | ||
mode: custom | ||
model: | ||
value: Westmere | ||
features: | ||
- name: avx | ||
policy: disable | ||
spec: | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: extraRuntime | ||
operator: In | ||
values: | ||
- virtlet | ||
# This is the number of seconds Virtlet gives the VM to shut down cleanly. | ||
# The default value of 30 seconds is ok for containers but probably too | ||
# low for VM, so overriding it here is strongly advised. | ||
terminationGracePeriodSeconds: 120 | ||
containers: | ||
- name: ubuntu-vm | ||
image: virtlet.cloud/cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img | ||
imagePullPolicy: IfNotPresent | ||
# tty and stdin required for `kubectl attach -t` to work | ||
tty: true | ||
stdin: true |