Skip to content

Commit

Permalink
using configmap to store python executable, so that we don't need to …
Browse files Browse the repository at this point in the history
…rebuild dockerimage if we change the tasks
  • Loading branch information
irvifa committed Apr 4, 2018
1 parent 80fceb6 commit f6a97fc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ fi
sed -i "s/\$targetHost/http:\/\/${PROJECT_ID}.appspot.com/g;s/\$projectId/${PROJECT_ID}/g" kubernetes-config/locust-master-deployment.yaml
sed -i "s/\$targetHost/http:\/\/${PROJECT_ID}.appspot.com/g;s/\$projectId/${PROJECT_ID}/g" kubernetes-config/locust-worker-deployment.yaml

kubectl create configmap locust-tasks-configuration --from-file=tasks.py
kubectl apply -f kubernetes-config
2 changes: 1 addition & 1 deletion docker-image/locust-tasks/run.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


LOCUST="/usr/local/bin/locust"
LOCUS_OPTS="-f /locust-tasks/tasks.py --host=$TARGET_HOST"
LOCUS_OPTS="-f /locust-tasks/script/tasks.py --host=$TARGET_HOST"
LOCUST_MODE=${LOCUST_MODE:-standalone}

if [[ "$LOCUST_MODE" = "master" ]]; then
Expand Down
9 changes: 8 additions & 1 deletion kubernetes-config/locust-master-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,11 @@ spec:
protocol: TCP
- name: loc-master-p2
containerPort: 5558
protocol: TCP
protocol: TCP
volumeMounts:
- name: locust-tasks-configuration
mountPath: /locust-tasks/script
volumes:
- name: locust-tasks-configuration
configMap:
name: locust-tasks-configuration
9 changes: 8 additions & 1 deletion kubernetes-config/locust-worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,11 @@ spec:
- name: LOCUST_MASTER
value: locust-master
- name: TARGET_HOST
value: $targetHost
value: $targetHost
volumeMounts:
- name: locust-tasks-configuration
mountPath: /locust-tasks/script
volumes:
- name: locust-tasks-configuration
configMap:
name: locust-tasks-configuration

0 comments on commit f6a97fc

Please sign in to comment.