Skip to content

Instantly share code, notes, and snippets.

@cardil
Last active May 5, 2020 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cardil/da083db01e98f41326fcc3c833b94451 to your computer and use it in GitHub Desktop.
Save cardil/da083db01e98f41326fcc3c833b94451 to your computer and use it in GitHub Desktop.
Test that stress large number of Serverless revisions
#!/bin/bash
set -Eeuo pipefail
readonly START="${START:-1}"
readonly LIMIT="${LIMIT:-1200}"
for NUM in $(seq "${START}" "$LIMIT"); do
oc apply -f - <<EOF
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: greeter
spec:
template:
spec:
containers:
- image: quay.io/rhdevelopers/knative-tutorial-greeter:quarkus
env:
- name: MESSAGE_PREFIX
value: Hey-${NUM}
livenessProbe:
httpGet:
path: /healthz
readinessProbe:
httpGet:
path: /healthz
EOF
oc wait --for=condition=Ready ksvc/greeter
url="$(oc get ksvc greeter -o jsonpath='{.status.url}' | sed 's/http:/https:/g')"
http get "$url"
http get "$url"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment