}
# Initializes kubeconfig file
-function kube_config_dir() {
+function save_kubeconfig() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
K8S_MANIFEST_DIR="/etc/kubernetes/manifests"
[ ! -d $K8S_MANIFEST_DIR ] && FATAL_TRACK k8scluster "Kubernetes folder $K8S_MANIFEST_DIR was not found"
- mkdir -p $HOME/.kube
- sudo cp /etc/kubernetes/admin.conf $HOME/.kube/config
- sudo chown $(id -u):$(id -g) $HOME/.kube/config
+ KUBEDIR="${HOME}/.kube"
+ KUBEFILE="$KUBEDIR/config"
+ mkdir -p "${KUBEDIR}"
+ KUBEADM_KUBECONFIG="/etc/kubernetes/admin.conf"
+ sudo cp "${KUBEADM_KUBECONFIG}" "${KUBEFILE}"
+ sudo chown $(id -u):$(id -g) "${KUBEFILE}"
+ echo
+ echo "Credentials saved at ${KUBEFILE}"
+ echo
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
# main
-while getopts ":D:d:i:-: " o; do
+OSM_CLUSTER_WORK_DIR="/etc/osm"
+OSM_DEVOPS="/usr/share/osm-devops"
+DEBUG_INSTALL=""
+
+while getopts ":D:d:-: " o; do
case "${o}" in
- i)
- DEFAULT_IP="${OPTARG}"
- ;;
d)
OSM_CLUSTER_WORK_DIR="${OPTARG}"
;;
check_and_track_kube_install
init_kubeadm $OSM_CLUSTER_WORK_DIR/kubeadm-config.yaml
-kube_config_dir
+save_kubeconfig
check_and_track_init_k8s
deploy_cni_provider