2018-07-26 04:22:00 +00:00
|
|
|
# Copyright 2018 Google LLC
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2018-06-29 23:35:57 +00:00
|
|
|
apiVersion: extensions/v1beta1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: loadgenerator
|
|
|
|
spec:
|
2018-06-30 00:10:28 +00:00
|
|
|
replicas: 1
|
2018-06-29 23:35:57 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: loadgenerator
|
|
|
|
spec:
|
2018-06-30 20:14:20 +00:00
|
|
|
terminationGracePeriodSeconds: 5
|
2018-06-30 00:10:28 +00:00
|
|
|
restartPolicy: Always
|
2018-06-29 23:35:57 +00:00
|
|
|
initContainers:
|
|
|
|
- name: wait-frontend
|
|
|
|
image: alpine:3.6
|
2019-02-18 23:54:01 +00:00
|
|
|
command: ['sh', '-c', 'set -x; apk add --no-cache curl &&
|
2018-07-15 23:34:41 +00:00
|
|
|
until timeout -t 2 curl -f "http://${FRONTEND_ADDR}"; do
|
2018-06-30 00:10:28 +00:00
|
|
|
echo "waiting for http://${FRONTEND_ADDR}";
|
|
|
|
sleep 2;
|
|
|
|
done;']
|
|
|
|
env:
|
|
|
|
- name: FRONTEND_ADDR
|
|
|
|
value: "frontend:80"
|
2018-06-29 23:35:57 +00:00
|
|
|
containers:
|
2018-06-30 00:10:28 +00:00
|
|
|
- name: main
|
2018-12-03 22:19:12 +00:00
|
|
|
image: loadgenerator
|
2018-06-29 23:35:57 +00:00
|
|
|
env:
|
|
|
|
- name: FRONTEND_ADDR
|
2018-06-30 00:10:28 +00:00
|
|
|
value: "frontend:80"
|
|
|
|
- name: USERS
|
2018-07-09 19:57:14 +00:00
|
|
|
value: "10"
|
2018-06-29 23:35:57 +00:00
|
|
|
resources:
|
|
|
|
requests:
|
2018-07-15 18:13:55 +00:00
|
|
|
cpu: 300m
|
|
|
|
memory: 256Mi
|
2018-06-29 23:35:57 +00:00
|
|
|
limits:
|
2018-07-15 18:13:55 +00:00
|
|
|
cpu: 500m
|
|
|
|
memory: 512Mi
|