Skip to content

Commit d2a4135

Browse files
authored
Merge pull request vitessio#2727 from thompsonja/k8s
Only add --server to kubectl commands when KUBERNETES_API_SERVER is s…
2 parents 67f9d8c + b19c681 commit d2a4135

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

examples/kubernetes/env.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66
# use cases just need KUBECTL=kubectl, we'll make that the default.
77
KUBECTL=${KUBECTL:-kubectl}
88

9-
# Kubernetes api address for $KUBECTL
10-
# The default value is 127.0.0.1:8080
11-
# When the Kubernetes api server is not local, We can easily access the api by edit KUBERNETES_API_SERVER's value
12-
KUBERNETES_API_SERVER=${KUBERNETES_API_SERVER:-'127.0.0.1:8080'}
9+
# Kubernetes API address for $KUBECTL. When the Kubernetes API server is not
10+
# local, We can easily access the API by editing KUBERNETES_API_SERVER's value
11+
KUBERNETES_API_SERVER=${KUBERNETES_API_SERVER:-""}
1312

1413
# Kubernetes namespace for Vitess and components.
1514
VITESS_NAME=${VITESS_NAME:-'default'}
1615

1716
# Kubernetes options config
18-
KUBECTL_OPTIONS="--namespace=$VITESS_NAME --server=$KUBERNETES_API_SERVER"
17+
KUBECTL_OPTIONS="--namespace=$VITESS_NAME"
18+
if [[ -n "$KUBERNETES_API_SERVER" ]]; then
19+
KUBECTL_OPTIONS+=" --server=$KUBERNETES_API_SERVER"
20+
fi
1921

2022
# CELLS should be a comma separated list of cells
2123
# the first cell listed will become local to vtctld.

0 commit comments

Comments
 (0)