File tree Expand file tree Collapse file tree 4 files changed +6
-4
lines changed
config/tests/three_data_hall Expand file tree Collapse file tree 4 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 3
3
This example requires that your Kubernetes cluster has nodes which are labeled with ` topology.kubernetes.io/zone ` .
4
4
The example requires at least 3 unique zones, those can be faked for testing, by adding the labels to a node.
5
5
If you want to use cloud provider specific zone label values you can set the ` AZ1 ` , ` AZ2 ` and ` AZ3 ` environment variables.
6
+ You can also set the namespace with the ` NAMESPACE ` environment variable to deploy this setup in a specific namespace.
6
7
7
8
## Create the Three-Data-Hall cluster
8
9
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ DIR="${BASH_SOURCE%/*}"
20
20
AZ1=${AZ1:- " az1" }
21
21
AZ2=${AZ2:- " az2" }
22
22
AZ3=${AZ3:- " az3" }
23
+ NAMESPACE=${NAMESPACE=-" default" }
23
24
24
25
applyFile " ${DIR} /stage_1.yaml" " ${AZ1} " ' ""'
25
26
checkReconciliationLoop test-cluster-${AZ1}
Original file line number Diff line number Diff line change 2
2
3
3
set -eu
4
4
5
- kubectl delete fdb -l cluster-group=test-cluster
5
+ kubectl -n " ${NAMESPACE} " delete fdb -l cluster-group=test-cluster
Original file line number Diff line number Diff line change 1
1
function applyFile() {
2
2
az=${2}
3
3
4
- az=" ${az} " connectionString=" ${3} " envsubst < " ${1} " | kubectl apply -f -
4
+ az=" ${az} " connectionString=" ${3} " envsubst < " ${1} " | kubectl -n " ${NAMESPACE} " apply -f -
5
5
}
6
6
7
7
function checkReconciliation() {
8
8
clusterName=$1
9
9
10
- generationsOutput=$( kubectl get fdb " ${clusterName} " -o jsonpath=' {.metadata.generation} {.status.generations.reconciled}' )
10
+ generationsOutput=$( kubectl -n " ${NAMESPACE} " get fdb " ${clusterName} " -o jsonpath=' {.metadata.generation} {.status.generations.reconciled}' )
11
11
read -ra generations <<< " ${generationsOutput}"
12
12
if [[ (" ${# generations[@]} " -ge 2) && (" ${generations[0]} " == " ${generations[1]} " ) ]]; then
13
13
return 1
@@ -18,7 +18,7 @@ function checkReconciliation() {
18
18
}
19
19
20
20
function getConnectionString() {
21
- kubectl get fdb " ${1} " -o jsonpath=' {.status.connectionString}'
21
+ kubectl -n " ${NAMESPACE} " get fdb " ${1} " -o jsonpath=' {.status.connectionString}'
22
22
}
23
23
24
24
function checkReconciliationLoop() {
You can’t perform that action at this time.
0 commit comments