mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 11:12:03 +00:00
Standardize how we refer to the kubernetes root.
Now use $KUBE_ROOT as the variable pretty much everywhere.
This commit is contained in:
@@ -15,4 +15,5 @@
|
||||
# limitations under the License.
|
||||
|
||||
## Contains configuration values for interacting with the Vagrant cluster in test mode
|
||||
source $(dirname ${BASH_SOURCE})/config-default.sh
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/cluster/vagrant/config-default.sh"
|
||||
|
@@ -53,7 +53,8 @@ while [[ $# > 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
cd $(dirname ${BASH_SOURCE})/../../
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
cd "${KUBE_ROOT}"
|
||||
|
||||
echo All verbose output will be redirected to $logfile, use --logfile option to change.
|
||||
|
||||
|
@@ -16,19 +16,9 @@
|
||||
|
||||
# exit on any error
|
||||
set -e
|
||||
source $(dirname $0)/provision-config.sh
|
||||
|
||||
# # Install Docker on master to run the build. This is a necessary chunk of
|
||||
# # bootstrapping.
|
||||
# yum install -y docker-io
|
||||
# SYSTEMD_LOG_LEVEL=notice systemctl enable docker
|
||||
# systemctl start docker
|
||||
|
||||
# # Build release
|
||||
# echo "Building release"
|
||||
# pushd /vagrant
|
||||
# bash -x ./build/release.sh
|
||||
# popd
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/cluster/vagrant/provision-config.sh"
|
||||
|
||||
function release_not_found() {
|
||||
echo "It looks as if you don't have a compiled version of Kubernetes. If you" >&2
|
||||
@@ -117,10 +107,10 @@ state_output: mixed
|
||||
EOF
|
||||
|
||||
# Configure nginx authorization
|
||||
mkdir -p $KUBE_TEMP
|
||||
mkdir -p "$KUBE_TEMP"
|
||||
mkdir -p /srv/salt/nginx
|
||||
python $(dirname $0)/../../third_party/htpasswd/htpasswd.py -b -c ${KUBE_TEMP}/htpasswd $MASTER_USER $MASTER_PASSWD
|
||||
MASTER_HTPASSWD=$(cat ${KUBE_TEMP}/htpasswd)
|
||||
python "${KUBE_ROOT}/third_party/htpasswd/htpasswd.py" -b -c "${KUBE_TEMP}/htpasswd" "$MASTER_USER" "$MASTER_PASSWD"
|
||||
MASTER_HTPASSWD=$(cat "${KUBE_TEMP}/htpasswd")
|
||||
echo $MASTER_HTPASSWD > /srv/salt/nginx/htpasswd
|
||||
|
||||
# we will run provision to update code each time we test, so we do not want to do salt install each time
|
||||
|
@@ -16,7 +16,8 @@
|
||||
|
||||
# exit on any error
|
||||
set -e
|
||||
source $(dirname $0)/provision-config.sh
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/cluster/vagrant/provision-config.sh"
|
||||
|
||||
MINION_IP=$4
|
||||
|
||||
@@ -30,11 +31,11 @@ fi
|
||||
minion_ip_array=(${MINION_IPS//,/ })
|
||||
for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
|
||||
minion=${MINION_NAMES[$i]}
|
||||
ip=${minion_ip_array[$i]}
|
||||
ip=${minion_ip_array[$i]}
|
||||
if [ ! "$(cat /etc/hosts | grep $minion)" ]; then
|
||||
echo "Adding $minion to hosts file"
|
||||
echo "$ip $minion" >> /etc/hosts
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Let the minion know who its master is
|
||||
@@ -61,4 +62,4 @@ if ! which salt-minion >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
# run the networking setup
|
||||
$(dirname $0)/provision-network.sh $@
|
||||
"${KUBE_ROOT}/cluster/vagrant/provision-network.sh" $@
|
||||
|
@@ -16,7 +16,8 @@
|
||||
|
||||
# exit on any error
|
||||
set -e
|
||||
source $(dirname $0)/provision-config.sh
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/cluster/vagrant/provision-config.sh"
|
||||
|
||||
MINION_IP=$4
|
||||
MINION_ID=$5
|
||||
|
@@ -16,7 +16,8 @@
|
||||
|
||||
# A library of helper functions that each provider hosting Kubernetes must implement to use cluster/kube-*.sh scripts.
|
||||
|
||||
source $(dirname ${BASH_SOURCE})/${KUBE_CONFIG_FILE-"config-default.sh"}
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/cluster/vagrant/${KUBE_CONFIG_FILE-"config-default.sh"}"
|
||||
|
||||
function detect-master () {
|
||||
echo "KUBE_MASTER_IP: ${KUBE_MASTER_IP}"
|
||||
@@ -91,7 +92,7 @@ function kube-up {
|
||||
local count="0"
|
||||
until [[ "$count" == "1" ]]; do
|
||||
local minions
|
||||
minions=$("$(dirname $0)/cluster/kubecfg.sh" -template '{{range.Items}}{{.ID}}:{{end}}' list minions)
|
||||
minions=$("${KUBE_ROOT}/cluster/kubecfg.sh" -template '{{range.Items}}{{.ID}}:{{end}}' list minions)
|
||||
count=$(echo $minions | grep -c "${MINION_NAMES[i]}") || {
|
||||
printf "."
|
||||
sleep 2
|
||||
|
Reference in New Issue
Block a user