From cfc612a6214d743bd369cd285b166a523e5d0b78 Mon Sep 17 00:00:00 2001 From: Vincent De Smet Date: Mon, 20 Feb 2017 17:22:24 +0800 Subject: [PATCH] Add support for TLS Verification --- update.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) mode change 100644 => 100755 update.sh diff --git a/update.sh b/update.sh old mode 100644 new mode 100755 index 8471f4f..d735c88 --- a/update.sh +++ b/update.sh @@ -6,14 +6,20 @@ fi if [ ! -z ${PLUGIN_KUBERNETES_TOKEN} ]; then KUBERNETES_TOKEN=$PLUGIN_KUBERNETES_TOKEN + kubectl config set-credentials default --token=${KUBERNETES_TOKEN} fi if [ ! -z ${PLUGIN_KUBERNETES_SERVER} ]; then KUBERNETES_SERVER=$PLUGIN_KUBERNETES_SERVER fi -kubectl config set-credentials default --token=${KUBERNETES_TOKEN} -kubectl config set-cluster default --server=${KUBERNETES_SERVER} --insecure-skip-tls-verify=true +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 +fi + kubectl config set-context default --cluster=default --user=default kubectl config use-context default