diff --git a/clr-k8s-examples/README.md b/clr-k8s-examples/README.md index 02a6cc2..4bcb692 100644 --- a/clr-k8s-examples/README.md +++ b/clr-k8s-examples/README.md @@ -80,7 +80,7 @@ runtime class set to "kata" will launch the POD/Deployment with Kata. An example is -`kubectl apply -f tests/test-deploy-kata-qemu.yaml` +`kubectl apply -f tests/deploy-svc-ing/test-deploy-kata-qemu.yaml` ### Running Kata Workloads with Firecracker @@ -89,7 +89,7 @@ with firecracker as the isolation mechanism for Kata. An example is -`kubectl apply -f tests/test-deploy-kata-fc.yaml` +`kubectl apply -f tests/deploy-svc-ing/test-deploy-kata-fc.yaml` ## Making Kata the default runtime diff --git a/clr-k8s-examples/tests/test-autoscale.sh b/clr-k8s-examples/tests/autoscale/test-autoscale.sh similarity index 100% rename from clr-k8s-examples/tests/test-autoscale.sh rename to clr-k8s-examples/tests/autoscale/test-autoscale.sh diff --git a/clr-k8s-examples/tests/cpumanager/test-cpumanager.sh b/clr-k8s-examples/tests/cpumanager/test-cpumanager.sh new file mode 100755 index 0000000..e7adacb --- /dev/null +++ b/clr-k8s-examples/tests/cpumanager/test-cpumanager.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +input="test-cpumanager.yaml.tmpl" + +filename() { + echo "test-cpumanager-$1.yaml" +} + +for runtimeclass in runc kata-qemu kata-fc; do + output=$(filename $runtimeclass) + cp $input $output + sed -i "s/__runtimeclass__/$runtimeclass/g" $output + if [ $runtimeclass == "runc" ]; then continue; fi + + insertline="\ \ runtimeClassName: $runtimeclass" + sed -i "/spec:/a $insertline" $output +done +kubectl apply -f . diff --git a/clr-k8s-examples/tests/cpumanager/test-cpumanager.yaml.tmpl b/clr-k8s-examples/tests/cpumanager/test-cpumanager.yaml.tmpl new file mode 100644 index 0000000..3b85b67 --- /dev/null +++ b/clr-k8s-examples/tests/cpumanager/test-cpumanager.yaml.tmpl @@ -0,0 +1,92 @@ +--- +apiVersion: v1 +kind: Pod +metadata: + name: test-cpumanager-guaranteed-__runtimeclass__ +spec: + restartPolicy: Never + containers: + - name: busy + image: busybox + command: [ "top" ] + resources: + limits: + cpu: 1 + memory: 100Mi +--- +apiVersion: v1 +kind: Pod +metadata: + name: test-cpumanager-burstable-integer-limit-__runtimeclass__ +spec: + restartPolicy: Never + containers: + - name: busy + image: busybox + command: [ "top" ] + resources: + requests: + cpu: 1 + memory: 100Mi + limits: + cpu: 2 + memory: 500Mi +--- +apiVersion: v1 +kind: Pod +metadata: + name: test-cpumanager-burstable-float-limit-__runtimeclass__ +spec: + restartPolicy: Never + containers: + - name: busy + image: busybox + command: [ "top" ] + resources: + requests: + cpu: 500m + memory: 100Mi + limits: + cpu: 1 + memory: 500Mi +--- +apiVersion: v1 +kind: Pod +metadata: + name: test-cpumanager-burstable-integer-__runtimeclass__ +spec: + restartPolicy: Never + containers: + - name: busy + image: busybox + command: [ "top" ] + resources: + requests: + cpu: 1 + memory: 100Mi +--- +apiVersion: v1 +kind: Pod +metadata: + name: test-cpumanager-burstable-float-__runtimeclass__ +spec: + restartPolicy: Never + containers: + - name: busy + image: busybox + command: [ "top" ] + resources: + requests: + cpu: 500m + memory: 100Mi +--- +apiVersion: v1 +kind: Pod +metadata: + name: test-cpumanager-besteffort-__runtimeclass__ +spec: + restartPolicy: Never + containers: + - name: busy + image: busybox + command: [ "top" ] diff --git a/clr-k8s-examples/tests/test-deploy-kata-fc.yaml b/clr-k8s-examples/tests/deploy-svc-ing/test-deploy-kata-fc.yaml similarity index 100% rename from clr-k8s-examples/tests/test-deploy-kata-fc.yaml rename to clr-k8s-examples/tests/deploy-svc-ing/test-deploy-kata-fc.yaml diff --git a/clr-k8s-examples/tests/test-deploy-kata-qemu.yaml b/clr-k8s-examples/tests/deploy-svc-ing/test-deploy-kata-qemu.yaml similarity index 100% rename from clr-k8s-examples/tests/test-deploy-kata-qemu.yaml rename to clr-k8s-examples/tests/deploy-svc-ing/test-deploy-kata-qemu.yaml diff --git a/clr-k8s-examples/tests/test-deploy-runc.yaml b/clr-k8s-examples/tests/deploy-svc-ing/test-deploy-runc.yaml similarity index 100% rename from clr-k8s-examples/tests/test-deploy-runc.yaml rename to clr-k8s-examples/tests/deploy-svc-ing/test-deploy-runc.yaml diff --git a/clr-k8s-examples/tests/test-ingress-kata.yaml b/clr-k8s-examples/tests/deploy-svc-ing/test-ingress-kata.yaml similarity index 100% rename from clr-k8s-examples/tests/test-ingress-kata.yaml rename to clr-k8s-examples/tests/deploy-svc-ing/test-ingress-kata.yaml diff --git a/clr-k8s-examples/tests/test-ingress-runc.yaml b/clr-k8s-examples/tests/deploy-svc-ing/test-ingress-runc.yaml similarity index 100% rename from clr-k8s-examples/tests/test-ingress-runc.yaml rename to clr-k8s-examples/tests/deploy-svc-ing/test-ingress-runc.yaml diff --git a/clr-k8s-examples/test-pvc/wordpress.yaml b/clr-k8s-examples/tests/pvc/wordpress.yaml similarity index 100% rename from clr-k8s-examples/test-pvc/wordpress.yaml rename to clr-k8s-examples/tests/pvc/wordpress.yaml diff --git a/clr-k8s-examples/tests/test-cpumanager-kata.yaml b/clr-k8s-examples/tests/test-cpumanager-kata.yaml deleted file mode 100644 index df514ce..0000000 --- a/clr-k8s-examples/tests/test-cpumanager-kata.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: test-cpumanager-kata -spec: - runtimeClassName: kata - restartPolicy: Never - containers: - - name: taskset - image: busybox - command: [ "taskset", "-p", "1" ] - resources: - limits: - cpu: 1 - memory: 500Mi diff --git a/clr-k8s-examples/tests/test-cpumanager-runc.yaml b/clr-k8s-examples/tests/test-cpumanager-runc.yaml deleted file mode 100644 index 4af0dc7..0000000 --- a/clr-k8s-examples/tests/test-cpumanager-runc.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: test-cpumanager-runc -spec: - restartPolicy: Never - containers: - - name: taskset - image: busybox - command: [ "taskset", "-p", "1" ] - resources: - limits: - cpu: 1 - memory: 100Mi