Created
October 30, 2018 22:57
-
-
Save tanzeeb/af52fa40a01acb114708b37512798057 to your computer and use it in GitHub Desktop.
Autoscale Test #2155
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
echo "Running tests" | |
echo "Changes in helloworld-go" | |
pushd docs/serving/samples/helloworld-go | |
git --no-pager diff . | |
popd | |
echo "Changes in serving" | |
pushd serving | |
git --no-pager diff . | |
popd | |
echo "Deleting helloworld-go service" | |
pushd docs/serving/samples/helloworld-go | |
ko delete -f service.yaml --ignore-not-found | |
popd | |
sleep 10 | |
echo "Deploying serving" | |
pushd serving | |
ko apply -f config/ | |
popd | |
sleep 10 | |
echo "Deploying helloworld-go service" | |
pushd docs/serving/samples/helloworld-go | |
ko apply -f service.yaml | |
popd | |
IP=$(kubectl get svc knative-ingressgateway -n istio-system --no-headers | awk '{print $4}') | |
echo "Waiting..." | |
sleep 120 | |
echo "Curling helloworld-go" | |
curl -H 'Host: helloworld-go.default.example.com' http://$IP -isfv | |
echo "Trying again after container expires..." | |
sleep 180 | |
echo "Curling helloworld-go to restart the container" | |
curl -H 'Host: helloworld-go.default.example.com' http://$IP -isfv -m 5 || true | |
echo "Curling helloworld-go after container has started" | |
sleep 120 | |
curl -H 'Host: helloworld-go.default.example.com' http://$IP -isfv | |
echo "Success!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: serving.knative.dev/v1alpha1 | |
kind: Service | |
metadata: | |
name: helloworld-go | |
namespace: default | |
spec: | |
runLatest: | |
configuration: | |
revisionTemplate: | |
spec: | |
container: | |
image: github.com/knative/docs/serving/samples/helloworld-go | |
env: | |
- name: TARGET | |
value: "Go Sample v1" | |
readinessProbe: | |
httpGet: | |
path: / | |
initialDelaySeconds: 90 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
watch -n 1 kubectl describe podautoscaler helloworld-go | |
watch -n 1 eval "kubectl get pod \$(kubectl get pods | grep helloworld-go | cut -f1 -d' ') -o=json | jq .status.conditions" | |
watch -n 1 kubectl get deployment helloworld-go-00001-deployment | |
watch -n 1 kubectl get endpoints helloworld-go-00001-service | |
watch -n 1 eval "kubectl get route helloworld-go -o=json | jq .status.conditions" | |
watch -n 1 kubectl describe revision helloworld-go-00001 | |
watch -n 1 kubectl describe configuration helloworld-go | |
watch -n 1 kubectl describe ksvc helloworld-go |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment