summaryrefslogtreecommitdiffhomepage
path: root/test/shim/runtimeclass-install.sh
blob: 28abbcd00ef03ce69dd380f5832d12d34af34a18 (plain)
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
#!/bin/bash

# A sample script to test installing a RuntimeClass

set -ex

{ # Step 1: Install a RuntimeClass
cat <<EOF | kubectl apply -f -
apiVersion: node.k8s.io/v1beta1
kind: RuntimeClass
metadata:
  name: gvisor
handler: runsc
EOF
}

{ # Step 2: Create a pod
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: nginx-gvisor
spec:
  runtimeClassName: gvisor
  containers:
  - name: nginx
    image: nginx
EOF
}

{ # Step 3: Get the pod
kubectl get pod nginx-gvisor -o wide
}