Add support for TLS Verification

This commit is contained in:
Vincent De Smet 2017-02-20 17:22:24 +08:00
parent 0378bbb9d9
commit cfc612a621
1 changed files with 8 additions and 2 deletions

8
update.sh Normal file → Executable file
View File

@ -6,14 +6,20 @@ fi
if [ ! -z ${PLUGIN_KUBERNETES_TOKEN} ]; then if [ ! -z ${PLUGIN_KUBERNETES_TOKEN} ]; then
KUBERNETES_TOKEN=$PLUGIN_KUBERNETES_TOKEN KUBERNETES_TOKEN=$PLUGIN_KUBERNETES_TOKEN
kubectl config set-credentials default --token=${KUBERNETES_TOKEN}
fi fi
if [ ! -z ${PLUGIN_KUBERNETES_SERVER} ]; then if [ ! -z ${PLUGIN_KUBERNETES_SERVER} ]; then
KUBERNETES_SERVER=$PLUGIN_KUBERNETES_SERVER KUBERNETES_SERVER=$PLUGIN_KUBERNETES_SERVER
fi fi
kubectl config set-credentials default --token=${KUBERNETES_TOKEN} if [ ! -z ${PLUGIN_KUBERNETES_CERT} ]; then
echo ${PLUGIN_KUBERNETES_CERT} > ca.crt
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --certificate-authority=ca.crt
else
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --insecure-skip-tls-verify=true kubectl config set-cluster default --server=${KUBERNETES_SERVER} --insecure-skip-tls-verify=true
fi
kubectl config set-context default --cluster=default --user=default kubectl config set-context default --cluster=default --user=default
kubectl config use-context default kubectl config use-context default