Verified Commit ee34e03c authored by Xueshan Feng's avatar Xueshan Feng
Browse files

update to make it work with heptio auth until kubectl can merge its kubeconfig.

parent 062896d2
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -4,8 +4,6 @@
# Configure kubeconfig for EKS
###############################################################################

exit 0

# Prerequsite: AWS EKS model, AWS kubectl binary installed in $HOME/bin

THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@@ -17,6 +15,7 @@ source env.sh > /dev/null 2>&1 || true # Optional
set -u # Must set these vars
export CLUSTER_NAME=${CLUSTER_NAME}
export AWS_PROFILE=${AWS_PROFILE}
export KUBECONFIG=${HOME}/.kube/${CLUSTER_NAME}
debug_scripts=false

# fail on error or undeclared vars
@@ -24,9 +23,9 @@ trap_errors

set +u

if ! aws eks describe-cluster --cluster-name=${CLUSTER_NAME} &> /dev/null ; then
  abort 1 "Error checking cluster ${CLUSTER_NAME}."
fi
kubectx aws

exit 0

# Cleanup previous kubeconfig entries
kubectl config unset users.aws
+2 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ endif

.PHONY: kube-sec
kube-sec: vault-login config-kube destroy-kube-sec ## create kubernetes secret from ${TEMPLATES}/secret.yml
	if [ -a ${KUBE_SEC_DEF_FILE} ]; then \
	@if [ -a ${KUBE_SEC_DEF_FILE} ]; then \
		cat ${KUBE_SEC_DEF_FILE} | envsubst | ${SCRIPTS_DIR}/vault2kube.sh | kubectl create -f - ; \
	fi