File tree 4 files changed +17
-2
lines changed
4 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ testbin/*
9
9
api /* /zz * generated.deepcopy.go
10
10
11
11
nginx.conf
12
+ nginx.conf.bak
12
13
13
14
pkg /mocks /*
14
15
! pkg /mocks /.keep
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ # This is a very simple script that can be used to launch a load balancer and add addresses to it.
4
+
5
+ # It does so by querying kubernetes and parsing the output via jq.
6
+
3
7
while true ; do
4
8
ADDRESSES=$( kubectl get machine -o json | jq -r ' .items[] | select(.metadata.labels."cluster.x-k8s.io/control-plane" != null) | .status | select(.addresses!=null) | .addresses[].address' )
5
9
if [[ $ADDRESSES != $OLD_ADDRESSES ]]; then
@@ -10,8 +14,8 @@ while true; do
10
14
echo $ADDRESS
11
15
sed -i.bak ' /upstream kubeendpoints/a\' $' \n ' $' \t ' ' server ' $ADDRESS ' :6443 max_fails=3 fail_timeout=10s;' $' \n ' nginx.conf
12
16
done
13
- docker stop nginx-container || echo
14
- docker rm nginx-container || echo
17
+ docker stop nginx-container & > /dev/null || echo
18
+ docker rm nginx-container & > /dev/null || echo
15
19
docker run --name=nginx-container --rm -p 8082:8082 -v $( pwd) /nginx.conf:/etc/nginx/nginx.conf nginx &
16
20
fi
17
21
OLD_ADDRESSES=$ADDRESSES
Original file line number Diff line number Diff line change 44
44
stream {
45
45
upstream kubeendpoints {
46
46
47
+ # The following is the format for adding a kubernetes upstream endpoint.
47
48
# server <server1 IP>:6443 max_fails=3 fail_timeout=10s;
48
49
# server <server2 IP>:6443 max_fails=3 fail_timeout=10s;
49
50
}
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # Source this file for local dev.
4
+
5
+ export IMG=localhost:5000/cluster-api-provider-cloudstack:latest
6
+ export PROJECT_DIR=` pwd`
7
+ export KUBEBUILDER_ASSETS=$PROJECT_DIR /bin
8
+ export PATH=$PROJECT_DIR /bin:$PATH
9
+ export ACK_GINKGO_DEPRECATIONS=1.16.4
You can’t perform that action at this time.
0 commit comments