-
Notifications
You must be signed in to change notification settings - Fork 0
/
load.ps1
33 lines (30 loc) · 916 Bytes
/
load.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<# End to end creation of cluster to port-forwarding service for locust
# on a kind cluster.
#>
# create kind cluster
kubectl get nodes
if (!$?) {
kind create cluster
}
# build the docker image, if there is an issue than exit the scrip
docker build . -t aaronarellano/locust-kind
if (!$?) {
exit
}
docker push aaronarellano/locust-kind
# added for rolling update of docker image
kubectl delete deployment/locust-primary-dep -n locust
# deploy manifests to kind cluster
kubectl apply -k manifests/base
# wait for resources to populate
Start-Sleep -s 5
# validate locust pod is running before port forwarding
Write-Host "Waiting for locust pod to enter running state" -NoNewline
DO {
$podStatus = kubectl get pods -n locust | findstr Running
Write-Host "." -NoNewline
}
WHILE (!$podStatus)
Write-Host ""
# port forward after the service is up
kubectl port-forward svc/locust-kind 8089 -n locust