From c82d70c3602c61c20bce51d6d4b99adf56d6a7d9 Mon Sep 17 00:00:00 2001 From: Madison Bahmer Date: Thu, 24 Aug 2023 11:42:58 -0400 Subject: [PATCH] update to add container support for aws-cli and AWS EKS clusters --- Dockerfile | 4 +++- README.md | 1 + docs/container.md | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 778ae95..8415bcb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,13 @@ LABEL maintainer="woozymasta@gmail.com" # hadolint ignore=DL3018 RUN apk add --update --no-cache \ - bash bind-tools jq yq openssh-client git tar xz gzip bzip2 curl coreutils grep && \ + bash bind-tools jq yq openssh-client git tar xz gzip bzip2 curl coreutils grep python3 py3-pip && \ curl -sLo /usr/bin/kubectl \ "https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl" && \ chmod +x /usr/bin/kubectl +RUN pip3 install awscli + COPY ./kube-dump /kube-dump ENTRYPOINT [ "/kube-dump" ] diff --git a/README.md b/README.md index edf7fe9..3118017 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ Optional dependencies: * `xz` - a lossless data compression file format based on the LZMA algorithm * `gzip` - single-file/stream lossless data compression utility * `bzip2` - compression program that uses the Burrows–Wheeler algorithm +* `aws-cli` - support for access to Amazon EKS clusters ## Commands and flags diff --git a/docs/container.md b/docs/container.md index a595b0f..c3db228 100644 --- a/docs/container.md +++ b/docs/container.md @@ -13,6 +13,14 @@ docker run --tty --interactive --rm \ Kube-dump is set as entrypoint, you only need to pass command and flags to container. +When connecting to AWS EKS, add your credentials as a volume mount for aws-cli to authenticate: +```shell +docker run --tty --interactive --rm \ + --volume $HOME/.kube:/.kube --volume $HOME/.aws:/root/.aws --volume $HOME/dump:/dump \ + woozymasta/kube-dump:latest \ + dump-namespaces -n dev,prod -d /dump --kube-config /.kube/config +``` + For more convenience, you can create an alias for calling kube-dump from a container: ```shell