#!/bin/sh

for i in $(seq 0 99)
do
        oc new-project serverless-ksvc-ns$i

        oc create -f - <<EOF
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: ksvc0
  namespace: serverless-ksvc-ns$i
spec:
  template:
    metadata:
      annotations:
        # Target 5 in-flight-requests per pod.
        autoscaling.knative.dev/target: "5"
    spec:
      containerConcurrency: 0
      containers:
      - env:
        - name: TARGET
          value: Go Sample v0
        image: gcr.io/knative-samples/autoscale-go:0.1
        name: user-container
        resources:
          requests:
            cpu: 10m
            memory: 10M
EOF
        sleep 10
done

