From ece7c52bc35844103b814b9ff4c7aa284597950f Mon Sep 17 00:00:00 2001 From: isaacdong Date: Fri, 10 Aug 2018 16:07:49 +0800 Subject: [PATCH] fix create-kubelet-kubeconfig. 1. keep function signature consistent. implementations of the create-kubelet-kubeconfig function take an apiserver address as the first argument and the destination as the second argument. 2. remove duplicate file name(/kubelet.kubeconfig) in --kubeconfig=${KUBELET_KUBECONFIG}/kubelet.kubeconfig --- cluster/get-kube-local.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cluster/get-kube-local.sh b/cluster/get-kube-local.sh index e1b8ed8b095..7dd409ca78d 100755 --- a/cluster/get-kube-local.sh +++ b/cluster/get-kube-local.sh @@ -55,8 +55,9 @@ function run { } # Creates a kubeconfig file for the kubelet. -# Args: destination file path +# Args: the IP address of the API server (e.g. "http://localhost:8080"), destination file path function create-kubelet-kubeconfig() { + #local api_addr="${1}" local destination="${2}" if [[ -z "${destination}" ]]; then echo "Must provide destination path to create Kubelet kubeconfig file!" @@ -85,7 +86,7 @@ EOF function create_cluster { echo "Creating a local cluster:" echo -e -n "\tStarting kubelet..." - create-kubelet-kubeconfig "${KUBELET_KUBECONFIG}" + create-kubelet-kubeconfig "http://localhost:8080" "${KUBELET_KUBECONFIG}" run "docker run \ --volume=/:/rootfs:ro \ --volume=/sys:/sys:ro \ @@ -103,7 +104,7 @@ function create_cluster { --containerized \ --hostname-override="127.0.0.1" \ --address="0.0.0.0" \ - --kubeconfig=${KUBELET_KUBECONFIG}/kubelet.kubeconfig \ + --kubeconfig=${KUBELET_KUBECONFIG} \ --pod-manifest-path=/etc/kubernetes/manifests \ --allow-privileged=true \ --cluster-dns=10.0.0.10 \