Skip to content

Commit

Permalink
Merge pull request kubernetes#1429 from brendandburns/auth
Browse files Browse the repository at this point in the history
Fix the scripts. (Again)
  • Loading branch information
thockin committed Sep 24, 2014
2 parents e1a07c0 + e21f5f7 commit 9564dac
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,20 +259,25 @@ function kube-up {
kube_key=".kubecfg.key"
ca_cert=".kubernetes.ca.crt"

(umask 077 && gcutil pull "${MASTER_NAME}" /usr/share/nginx/kubecfg.crt "${HOME}/${kube_cert}" && chmod 0600 "${HOME}/${kube_cert}")
(umask 077 && gcutil pull "${MASTER_NAME}" /usr/share/nginx/kubecfg.key "${HOME}/${kube_key}" && chmod 0600 "${HOME}/${kube_key}")
(umask 077 && gcutil pull "${MASTER_NAME}" /usr/share/nginx/ca.crt "${HOME}/${ca_cert}" && chmod 0600 "${HOME}/${ca_cert}")
(umask 077
(umask 077
gcutil ssh "${MASTER_NAME}" sudo cat /usr/share/nginx/kubecfg.crt > "${HOME}/${kube_cert}"
gcutil ssh "${MASTER_NAME}" sudo cat /usr/share/nginx/kubecfg.key > "${HOME}/${kube_key}"
gcutil ssh "${MASTER_NAME}" sudo cat /usr/share/nginx/ca.crt > "${HOME}/${ca_cert}"

cat << EOF > ~/.kubernetes_auth
{
"User": "$user",
"Password": "$passwd",
"CAFile": "$HOME/$ca_crt",
"CertFile": "$HOME/$kube_crt",
"KeyFile": "$HOME/$kube_key",
"CAFile": "$HOME/$ca_cert",
"CertFile": "$HOME/$kube_cert",
"KeyFile": "$HOME/$kube_key"
}
EOF
chmod 0600 ~/.kubernetes_auth)

chmod 0600 ~/.kubernetes_auth
chmod 0600 "${HOME}/${kube_cert}"
chmod 0600 "${HOME}/${kube_key}"
chmod 0600 "${HOME}/${ca_cert}")
}

# Delete a kubernetes cluster
Expand Down

0 comments on commit 9564dac

Please sign in to comment.