Skip to content

Commit

Permalink
feature/aws-iam-authenticator
Browse files Browse the repository at this point in the history
  • Loading branch information
ozbillwang committed May 18, 2020
1 parent 43172ca commit 861f8c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG HELM_VERSION=3.2.1
ARG KUBECTL_VERSION=1.17.5

# https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html
ARG AWS_IAM_AUTH_VERSION=1.16.8
ARG AWS_IAM_AUTH_VERSION_URL

# Install helm (latest release)
# ENV BASE_URL="https://storage.googleapis.com/kubernetes-helm"
Expand All @@ -27,7 +27,7 @@ RUN apk add --update --no-cache curl && \
chmod +x /usr/bin/kubectl

# Install aws-iam-authenticator (latest version)
RUN curl -LO https://amazon-eks.s3.us-west-2.amazonaws.com/${AWS_IAM_AUTH_VERSION}/2020-04-16/bin/linux/amd64/aws-iam-authenticator && \
RUN curl -LO ${AWS_IAM_AUTH_VERSION_URL} && \
mv aws-iam-authenticator /usr/bin/aws-iam-authenticator && \
chmod +x /usr/bin/aws-iam-authenticator

Expand Down
8 changes: 7 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@

build() {

# helm latest
helm=$(curl -s https://github.com/helm/helm/releases/latest)
helm=$(echo $helm\" |grep -oP '(?<=tag\/v)[0-9][^"]*')
echo $helm

# aws-iam-authenticator latest
iam_auth=$(curl -s https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html|grep iam-auth |grep linux|head -1)
iam_auth_url=$(echo ${iam_auth} |grep -oP '(?<=curl -o aws-iam-authenticator )[^<]*'|head -1)
echo ${iam_auth_url}

echo "Found new version, building the image ${image}:${tag}"
docker build --no-cache --build-arg KUBECTL_VERSION=${tag} --build-arg HELM_VERSION=${helm} -t ${image}:${tag} .
docker build --no-cache --build-arg KUBECTL_VERSION=${tag} --build-arg HELM_VERSION=${helm} --build-arg AWS_IAM_AUTH_VERSION_URL="${iam_auth_url}" -t ${image}:${tag} .

# run test
version=$(docker run -ti --rm ${image}:${tag} helm version --client)
Expand Down

0 comments on commit 861f8c2

Please sign in to comment.