mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
make ./kubectl.sh work with juju provider
This commit is contained in:
parent
5d19597ffa
commit
52112ad985
@ -58,7 +58,7 @@ function kube-down() {
|
|||||||
function detect-master() {
|
function detect-master() {
|
||||||
local kubestatus
|
local kubestatus
|
||||||
# Capturing a newline, and my awk-fu was weak - pipe through tr -d
|
# Capturing a newline, and my awk-fu was weak - pipe through tr -d
|
||||||
kubestatus=$(juju status --format=oneline kubernetes-master | awk '{print $3}' | tr -d "\n")
|
kubestatus=$(juju status --format=oneline kubernetes-master | grep kubernetes-master/0 | awk '{print $3}' | tr -d "\n")
|
||||||
export KUBE_MASTER_IP=${kubestatus}
|
export KUBE_MASTER_IP=${kubestatus}
|
||||||
export KUBE_MASTER=${KUBE_MASTER_IP}
|
export KUBE_MASTER=${KUBE_MASTER_IP}
|
||||||
export KUBERNETES_MASTER=http://${KUBE_MASTER}:8080
|
export KUBERNETES_MASTER=http://${KUBE_MASTER}:8080
|
||||||
|
@ -105,7 +105,7 @@ if [[ "$KUBERNETES_PROVIDER" == "gke" ]]; then
|
|||||||
config=(
|
config=(
|
||||||
"--context=gke_${PROJECT}_${ZONE}_${CLUSTER_NAME}"
|
"--context=gke_${PROJECT}_${ZONE}_${CLUSTER_NAME}"
|
||||||
)
|
)
|
||||||
elif [[ "$KUBERNETES_PROVIDER" == "ubuntu" ]]; then
|
elif [[ "$KUBERNETES_PROVIDER" == "ubuntu" || "$KUBERNETES_PROVIDER" == "juju" ]]; then
|
||||||
detect-master > /dev/null
|
detect-master > /dev/null
|
||||||
config=(
|
config=(
|
||||||
"--server=http://${KUBE_MASTER_IP}:8080"
|
"--server=http://${KUBE_MASTER_IP}:8080"
|
||||||
|
Loading…
Reference in New Issue
Block a user