From 6073d870a11018ce55251d42ce1e9d7c68b246c9 Mon Sep 17 00:00:00 2001 From: Piotr Skamruk Date: Thu, 15 Nov 2018 17:25:57 +0100 Subject: [PATCH] Simplify examples --- examples/cirros-vm-raw-device.yaml | 12 +++--------- examples/cirros-vm-volume-mount.yaml | 12 +++--------- .../cirros-vm-with-additional-annotations.yaml | 14 ++++---------- examples/cirros-vm.yaml | 14 ++++---------- examples/fedora-vm-with-testuser.yaml | 12 +++--------- examples/fedora-vm.yaml | 12 +++--------- examples/ubuntu-vm-with-libvirt-cpusetting.yaml | 12 +++--------- examples/ubuntu-vm-with-nested-virtualization.yaml | 12 +++--------- examples/ubuntu-vm-with-testuser.yaml | 12 +++--------- examples/ubuntu-vm-with-volume.yaml | 12 +++--------- examples/ubuntu-vm.yaml | 12 +++--------- 11 files changed, 35 insertions(+), 101 deletions(-) diff --git a/examples/cirros-vm-raw-device.yaml b/examples/cirros-vm-raw-device.yaml index 327e160a6..14f9f1464 100644 --- a/examples/cirros-vm-raw-device.yaml +++ b/examples/cirros-vm-raw-device.yaml @@ -5,15 +5,9 @@ metadata: annotations: kubernetes.io/target-runtime: virtlet.cloud spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: extraRuntime - operator: In - values: - - virtlet + nodeSelector: + extraRuntime: virtlet + containers: - name: cirros-vm imagePullPolicy: IfNotPresent diff --git a/examples/cirros-vm-volume-mount.yaml b/examples/cirros-vm-volume-mount.yaml index 62f56f5b7..10703c4bd 100644 --- a/examples/cirros-vm-volume-mount.yaml +++ b/examples/cirros-vm-volume-mount.yaml @@ -13,15 +13,9 @@ metadata: # volumes into this VM VirtletCloudInitUserDataScript: "@virtlet-mount-script@" spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: extraRuntime - operator: In - values: - - virtlet + nodeSelector: + extraRuntime: virtlet + containers: - name: cirros-vm image: virtlet.cloud/cirros diff --git a/examples/cirros-vm-with-additional-annotations.yaml b/examples/cirros-vm-with-additional-annotations.yaml index fad41b0c7..3018e1f18 100644 --- a/examples/cirros-vm-with-additional-annotations.yaml +++ b/examples/cirros-vm-with-additional-annotations.yaml @@ -22,19 +22,13 @@ metadata: #!/bin/sh echo "Hi there" spec: - # This nodeAffinity specification tells Kubernetes to run this + # This nodeSelector specification tells Kubernetes to run this # pod only on the nodes that have extraRuntime=virtlet label. # This label is used by Virtlet DaemonSet to select nodes # that must have Virtlet runtime - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: extraRuntime - operator: In - values: - - virtlet + nodeSelector: + extraRuntime: virtlet + containers: - name: cirros-vm # This specifies the image to use. diff --git a/examples/cirros-vm.yaml b/examples/cirros-vm.yaml index 334142bb3..b9dfe5ed3 100644 --- a/examples/cirros-vm.yaml +++ b/examples/cirros-vm.yaml @@ -13,19 +13,13 @@ metadata: # set root volume size VirtletRootVolumeSize: 1Gi spec: - # This nodeAffinity specification tells Kubernetes to run this + # This nodeSelector specification tells Kubernetes to run this # pod only on the nodes that have extraRuntime=virtlet label. # This label is used by Virtlet DaemonSet to select nodes # that must have Virtlet runtime - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: extraRuntime - operator: In - values: - - virtlet + nodeSelector: + extraRuntime: virtlet + containers: - name: cirros-vm # This specifies the image to use. diff --git a/examples/fedora-vm-with-testuser.yaml b/examples/fedora-vm-with-testuser.yaml index 0eceaf6c9..ea4e82459 100644 --- a/examples/fedora-vm-with-testuser.yaml +++ b/examples/fedora-vm-with-testuser.yaml @@ -21,15 +21,9 @@ metadata: VirtletSSHKeys: | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: extraRuntime - operator: In - values: - - virtlet + nodeSelector: + extraRuntime: 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. diff --git a/examples/fedora-vm.yaml b/examples/fedora-vm.yaml index 51aba93a9..5d63ef40f 100644 --- a/examples/fedora-vm.yaml +++ b/examples/fedora-vm.yaml @@ -7,15 +7,9 @@ metadata: VirtletSSHKeys: | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: extraRuntime - operator: In - values: - - virtlet + nodeSelector: + extraRuntime: 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. diff --git a/examples/ubuntu-vm-with-libvirt-cpusetting.yaml b/examples/ubuntu-vm-with-libvirt-cpusetting.yaml index 11264a532..5d0025419 100644 --- a/examples/ubuntu-vm-with-libvirt-cpusetting.yaml +++ b/examples/ubuntu-vm-with-libvirt-cpusetting.yaml @@ -21,15 +21,9 @@ metadata: - name: avx policy: disable spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: extraRuntime - operator: In - values: - - virtlet + nodeSelector: + extraRuntime: 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. diff --git a/examples/ubuntu-vm-with-nested-virtualization.yaml b/examples/ubuntu-vm-with-nested-virtualization.yaml index 0881b6def..8049e0626 100644 --- a/examples/ubuntu-vm-with-nested-virtualization.yaml +++ b/examples/ubuntu-vm-with-nested-virtualization.yaml @@ -10,15 +10,9 @@ metadata: # Set VirtletCPUModel to host-model to enable nested virtualization VirtletCPUModel: host-model spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: extraRuntime - operator: In - values: - - virtlet + nodeSelector: + extraRuntime: 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. diff --git a/examples/ubuntu-vm-with-testuser.yaml b/examples/ubuntu-vm-with-testuser.yaml index 2fc60ad77..4cc2f7716 100644 --- a/examples/ubuntu-vm-with-testuser.yaml +++ b/examples/ubuntu-vm-with-testuser.yaml @@ -23,15 +23,9 @@ metadata: VirtletSSHKeys: | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: extraRuntime - operator: In - values: - - virtlet + nodeSelector: + extraRuntime: 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. diff --git a/examples/ubuntu-vm-with-volume.yaml b/examples/ubuntu-vm-with-volume.yaml index 7ac3429af..431fa0a04 100644 --- a/examples/ubuntu-vm-with-volume.yaml +++ b/examples/ubuntu-vm-with-volume.yaml @@ -9,15 +9,9 @@ metadata: VirtletSSHKeys: | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: extraRuntime - operator: In - values: - - virtlet + nodeSelector: + extraRuntime: 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. diff --git a/examples/ubuntu-vm.yaml b/examples/ubuntu-vm.yaml index 3f4500306..af2c28d7a 100644 --- a/examples/ubuntu-vm.yaml +++ b/examples/ubuntu-vm.yaml @@ -9,15 +9,9 @@ metadata: # set root volume size VirtletRootVolumeSize: 4Gi spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: extraRuntime - operator: In - values: - - virtlet + nodeSelector: + extraRuntime: 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.