Skip to content

Commit c6e107d

Browse files
author
Joshua Reed
committed
Minor cleanup.
1 parent 66ccfd7 commit c6e107d

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ testbin/*
99
api/*/zz*generated.deepcopy.go
1010

1111
nginx.conf
12+
nginx.conf.bak
1213

1314
pkg/mocks/*
1415
!pkg/mocks/.keep

hack/add_addresses.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

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+
37
while true; do
48
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')
59
if [[ $ADDRESSES != $OLD_ADDRESSES ]]; then
@@ -10,8 +14,8 @@ while true; do
1014
echo $ADDRESS
1115
sed -i.bak '/upstream kubeendpoints/a\'$'\n'$'\t''server '$ADDRESS':6443 max_fails=3 fail_timeout=10s;'$'\n' nginx.conf
1216
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
1519
docker run --name=nginx-container --rm -p 8082:8082 -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf nginx &
1620
fi
1721
OLD_ADDRESSES=$ADDRESSES

hack/nginx.conf

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ http {
4444
stream {
4545
upstream kubeendpoints {
4646

47+
# The following is the format for adding a kubernetes upstream endpoint.
4748
# server <server1 IP>:6443 max_fails=3 fail_timeout=10s;
4849
# server <server2 IP>:6443 max_fails=3 fail_timeout=10s;
4950
}

hack/setup_for_dev.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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

0 commit comments

Comments
 (0)