|
|
@ -26,9 +26,10 @@ source "${HELM_ROOT}/scripts/docker.sh"
|
|
|
|
|
|
|
|
|
|
|
|
K8S_VERSION=${K8S_VERSION:-1.2.0}
|
|
|
|
K8S_VERSION=${K8S_VERSION:-1.2.0}
|
|
|
|
KUBE_PORT=${KUBE_PORT:-8080}
|
|
|
|
KUBE_PORT=${KUBE_PORT:-8080}
|
|
|
|
KUBE_HOST=${KUBE_HOST:-$DOCKER_HOST_IP}
|
|
|
|
KUBE_MASTER_IP=${KUBE_MASTER_IP:-$DOCKER_HOST_IP}
|
|
|
|
KUBE_HOST=${KUBE_HOST:-localhost}
|
|
|
|
KUBE_MASTER_IP=${KUBE_MASTER_IP:-localhost}
|
|
|
|
KUBECTL="kubectl -s ${KUBE_HOST}:${KUBE_PORT}"
|
|
|
|
KUBECTL="kubectl -s ${KUBE_MASTER_IP}:${KUBE_PORT}"
|
|
|
|
|
|
|
|
KUBE_CONTEXT=${KUBE_CONTEXT:-docker}
|
|
|
|
|
|
|
|
|
|
|
|
require_command() {
|
|
|
|
require_command() {
|
|
|
|
if ! command -v "$1" >/dev/null 2>&1; then
|
|
|
|
if ! command -v "$1" >/dev/null 2>&1; then
|
|
|
@ -150,6 +151,20 @@ spec:
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Generate kubeconfig data for the created cluster.
|
|
|
|
|
|
|
|
create_kubeconfig() {
|
|
|
|
|
|
|
|
local cluster_args=(
|
|
|
|
|
|
|
|
"--server=http://${KUBE_MASTER_IP}:${KUBE_PORT}"
|
|
|
|
|
|
|
|
"--insecure-skip-tls-verify=true"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
kubectl config set-cluster "${KUBE_CONTEXT}" "${cluster_args[@]}"
|
|
|
|
|
|
|
|
kubectl config set-context "${KUBE_CONTEXT}" --cluster="${KUBE_CONTEXT}"
|
|
|
|
|
|
|
|
kubectl config use-context "${KUBE_CONTEXT}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Wrote config for ${KUBE_CONTEXT}"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
main() {
|
|
|
|
main() {
|
|
|
|
verify_prereqs
|
|
|
|
verify_prereqs
|
|
|
|
|
|
|
|
|
|
|
@ -159,8 +174,10 @@ main() {
|
|
|
|
|
|
|
|
|
|
|
|
start_kubernetes
|
|
|
|
start_kubernetes
|
|
|
|
wait_for_kubernetes
|
|
|
|
wait_for_kubernetes
|
|
|
|
|
|
|
|
|
|
|
|
create_kube_system_namespace
|
|
|
|
create_kube_system_namespace
|
|
|
|
create_kube_dns
|
|
|
|
create_kube_dns
|
|
|
|
|
|
|
|
create_kubeconfig
|
|
|
|
|
|
|
|
|
|
|
|
$KUBECTL cluster-info
|
|
|
|
$KUBECTL cluster-info
|
|
|
|
}
|
|
|
|
}
|
|
|
|