#!/bin/sh

NS=test-ksvcs-stable
oc new-project "$NS"

N=${1:-1000}

for i in $(seq 1 $N)
do
  oc create -f - <<EOF
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: ksvc$i
  namespace: $NS
spec:
  template:
    spec:
      containerConcurrency: 0
      containers:
      - env:
        - name: TARGET
          value: Go Sample v0
        image: gcr.io/knative-samples/helloworld-go
        name: user-container
        resources:
          requests:
            cpu: 10m
            memory: 10M
EOF
  echo "$i" | grep "0\$" && sleep 10
done

