Commit ece7c52b authored by isaacdong's avatar isaacdong

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
parent 28b2b212
......@@ -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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment