microservices-demo/kubernetes-manifests/loadgenerator.yaml
Ahmet Alp Balkan b57cbd2c2c k8s: add termination period to loadgen to some svc
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-06-30 13:14:20 -07:00

39 lines
946 B
YAML

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: loadgenerator
spec:
replicas: 1
template:
metadata:
labels:
app: loadgenerator
spec:
terminationGracePeriodSeconds: 5
restartPolicy: Always
initContainers:
- name: wait-frontend
image: alpine:3.6
command: ['sh', '-c', 'set -x; apk add --no-cache curl;
until curl -f "http://${FRONTEND_ADDR}"; do
echo "waiting for http://${FRONTEND_ADDR}";
sleep 2;
done;']
env:
- name: FRONTEND_ADDR
value: "frontend:80"
containers:
- name: main
image: loadgenerator
env:
- name: FRONTEND_ADDR
value: "frontend:80"
- name: USERS
value: "1"
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi