---
apiVersion: v1
kind: Namespace
metadata:
  name: stress
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  namespace: stress
  name: api
spec:
  replicas: 100
  template:
    metadata:
      labels:
        app: api
        tier: frontend
    spec:
      containers:
      - name: nginx
        image: busybox
        command:
        - /bin/sh
        - "-c"
        - i=0; while true; do echo "GET /users/$i"; sleep 1; i=$((i + 1)); done
      - name: cache
        image: busybox
        command:
        - /bin/sh
        - "-c"
        - i=0; while true; do echo "evict users.$i"; sleep 2; i=$((i + 1)); done
---
kind: Service
apiVersion: v1
metadata:
  namespace: stress
  name: api
spec:
  type: NodePort
  selector:
    app: api
    tier: frontend
  ports:
    - protocol: TCP
      port: 4200
      targetPort: http
