#!/bin/bash

function wait_for_scaling() {
  sleep 5
  deployed=$(oc get deployment nginx-kata-deployment | tail -n1 | awk '{print $2}')
  while [ ! "$deployed" = "$1/$1" ]; do
    echo "Deployed $deployed - waiting..."
    sleep 1
    deployed=$(oc get deployment nginx-kata-deployment | tail -n1 | awk '{print $2}')
  done
}

cat > nginx_deployment.yaml <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-kata-deployment
#  namespace: default
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
        run: nginx
    spec:
      containers:
      - name: nginx-kata
        image: bitnami/nginx
#      runtimeClassName: kata

EOF

oc apply -f nginx_deployment.yaml

while [ true ]; do
  oc scale deployment nginx-kata-deployment --replicas=10
  wait_for_scaling 10

  oc scale deployment nginx-kata-deployment --replicas=1
  wait_for_scaling 1
done


exit

exit
# On console,  Observe/Metrics
 sum(container_memory_working_set_bytes{pod='prometheus-k8s-0',namespace='openshift-monitoring',container='',}) BY (pod, namespace)
 sum(container_memory_working_set_bytes{pod='prometheus-k8s-1',namespace='openshift-monitoring',container='',}) BY (pod, namespace)

 or
 

Alternatively, you can check that "kata_shim_netdev" metric is not visible anymore after the patch is applied. 
count(group(kata_shim_netdev) by (interface))


