corneliusweig / ketall

Like `kubectl get all`, but get really all resources
Apache License 2.0
671 stars 28 forks source link

Linux arm64 build #183

Open andyli opened 4 months ago

andyli commented 4 months ago

Would be great if Linux arm64 builds are provided.

Currently, kubectl krew install get-all fails:

Installing plugin: get-all
W0517 03:29:17.788413      16 install.go:164] failed to install plugin "get-all": plugin "get-all" does not offer installation for this platform
failed to install some plugins: [get-all]: plugin "get-all" does not offer installation for this platform
mrballcb commented 1 month ago

If you happen to have a docker container with your infrastructure tools, the best workaround I can come up with is to override the OS and ARCH. In the Dockerfile for our infrastructure toolbox container, I force the OS and ARCH to versions that my MacbookPro can emulate. Not pretty, but it works.

    Add krew "get-all" plugin, override arch/os

diff --git a/Dockerfile b/Dockerfile
index 962326310..dbfb33b9d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -295,6 +295,12 @@ RUN ( set -x; cd "$(mktemp -d)" && \
     ./"${KREW}" install krew )
 RUN export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" && kubectl krew install ${KREW_PLUGINS}

+# Install Krew plugin, overriding ARCH and OS (Emulated on a Mac)
+ARG KREW_PLUGINS_OSARCH="get-all" # list of plugin: "plugin1 plugin2"
+RUN ( set -x;  \
+    export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" && \
+    KREW_OS="linux" KREW_ARCH="amd64" kubectl krew install ${KREW_PLUGINS_OSARCH} )
+
 COPY rootfs/ /
 COPY stacks/ /stacks/
 COPY components/ /components/