🎨 Add kubecolor, flux CLI, argocd CLI

Also:
- update versions across the board
- build httping against upstream repo
This commit is contained in:
Jérôme Petazzoni
2024-06-21 18:53:20 +02:00
parent 0e7b4a4830
commit a4d8fcb1df
3 changed files with 42 additions and 14 deletions

View File

@@ -7,6 +7,11 @@ ENV BUILDARCH=$BUILDARCH \
TARGETARCH=$TARGETARCH
COPY helper-* /bin/
# https://github.com/argoproj/argo-cd/releases/latest
FROM builder AS argocd
RUN helper-curl bin argocd \
https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-@GOARCH
# https://github.com/docker/compose/releases
FROM builder AS compose
ARG COMPOSE_VERSION=2.17.2
@@ -18,6 +23,12 @@ FROM builder AS crane
RUN go install github.com/google/go-containerregistry/cmd/crane@latest
RUN cp $(find bin -name crane) /usr/local/bin
# https://github.com/fluxcd/flux2/releases
FROM builder AS flux
ARG FLUX_VERSION=2.3.0
RUN helper-curl tar flux \
https://github.com/fluxcd/flux2/releases/download/v$FLUX_VERSION/flux_${FLUX_VERSION}_linux_@GOARCH.tar.gz
# https://github.com/helm/helm/releases
FROM builder AS helm
ARG HELM_VERSION=3.11.2
@@ -28,10 +39,11 @@ RUN helper-curl tar "--strip-components=1 linux-@GOARCH/helm" \
# (The source is small enough, so I don't know if cross-compilation
# would be worth the effort.)
FROM alpine AS httping
RUN apk add build-base gettext git musl-libintl ncurses-dev
RUN git clone https://salsa.debian.org/debian/httping
RUN apk add build-base cmake gettext git musl-libintl ncurses-dev
RUN git clone https://github.com/folkertvanheusden/httping
WORKDIR httping
RUN sed -i s/60/0/ utils.c
RUN cmake .
RUN make install BINDIR=/usr/local/bin
# https://github.com/simeji/jid/releases
@@ -50,33 +62,39 @@ FROM builder AS kompose
RUN helper-curl bin kompose \
https://github.com/kubernetes/kompose/releases/latest/download/kompose-linux-@GOARCH
# https://github.com/kubecolor/kubecolor/releases
FROM builder AS kubecolor
ARG KUBECOLOR_VERSION=0.3.2
RUN helper-curl tar kubecolor \
https://github.com/kubecolor/kubecolor/releases/download/v${KUBECOLOR_VERSION}/kubecolor_${KUBECOLOR_VERSION}_linux_@GOARCH.tar.gz
# https://github.com/kubernetes/kubernetes/releases
FROM builder AS kubectl
ARG KUBECTL_VERSION=1.26.3
ARG KUBECTL_VERSION=1.30.2
RUN helper-curl bin kubectl \
https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/@GOARCH/kubectl
# https://github.com/stackrox/kube-linter/releases
FROM builder AS kube-linter
ARG KUBELINTER_VERSION=v0.6.1
ARG KUBELINTER_VERSION=v0.6.8
RUN go install golang.stackrox.io/kube-linter/cmd/kube-linter@$KUBELINTER_VERSION
RUN cp $(find bin -name kube-linter) /usr/local/bin
# https://github.com/doitintl/kube-no-trouble/releases
FROM builder AS kubent
ARG KUBENT_VERSION=0.7.0
ARG KUBENT_VERSION=0.7.2
RUN helper-curl tar kubent \
https://github.com/doitintl/kube-no-trouble/releases/download/${KUBENT_VERSION}/kubent-${KUBENT_VERSION}-linux-@GOARCH.tar.gz
# https://github.com/bitnami-labs/sealed-secrets/releases
FROM builder AS kubeseal
ARG KUBESEAL_VERSION=0.20.2
ARG KUBESEAL_VERSION=0.27.0
RUN helper-curl tar kubeseal \
https://github.com/bitnami-labs/sealed-secrets/releases/download/v$KUBESEAL_VERSION/kubeseal-$KUBESEAL_VERSION-linux-@GOARCH.tar.gz
# https://github.com/kubernetes-sigs/kustomize/releases
FROM builder AS kustomize
ARG KUSTOMIZE_VERSION=5.0.1
ARG KUSTOMIZE_VERSION=5.4.2
RUN helper-curl tar kustomize \
https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v$KUSTOMIZE_VERSION/kustomize_v${KUSTOMIZE_VERSION}_linux_@GOARCH.tar.gz
@@ -92,7 +110,7 @@ RUN helper-curl tar popeye \
# https://github.com/regclient/regclient/releases
FROM builder AS regctl
ARG REGCLIENT_VERSION=0.4.7
ARG REGCLIENT_VERSION=0.6.1
RUN helper-curl bin regctl \
https://github.com/regclient/regclient/releases/download/v$REGCLIENT_VERSION/regctl-linux-@GOARCH
@@ -112,31 +130,31 @@ RUN helper-curl bin skaffold \
# https://github.com/stern/stern/releases
FROM builder AS stern
ARG STERN_VERSION=1.24.0
ARG STERN_VERSION=1.30.0
RUN helper-curl tar stern \
https://github.com/stern/stern/releases/download/v${STERN_VERSION}/stern_${STERN_VERSION}_linux_@GOARCH.tar.gz
# https://github.com/tilt-dev/tilt/releases
FROM builder AS tilt
ARG TILT_VERSION=0.32.0
ARG TILT_VERSION=0.33.17
RUN helper-curl tar tilt \
https://github.com/tilt-dev/tilt/releases/download/v${TILT_VERSION}/tilt.${TILT_VERSION}.linux-alpine.@WTFARCH.tar.gz
# https://github.com/vmware-tanzu/velero/releases
FROM builder AS velero
ARG VELERO_VERSION=1.11.0
ARG VELERO_VERSION=1.14.0
RUN helper-curl tar "--strip-components=1 velero-v${VELERO_VERSION}-linux-@GOARCH/velero" \
https://github.com/vmware-tanzu/velero/releases/download/v${VELERO_VERSION}/velero-v${VELERO_VERSION}-linux-@GOARCH.tar.gz
# https://github.com/carvel-dev/ytt/releases
FROM builder AS ytt
ARG YTT_VERSION=0.45.0
ARG YTT_VERSION=0.49.1
RUN helper-curl bin ytt \
https://github.com/carvel-dev/ytt/releases/download/v${YTT_VERSION}/ytt-linux-@GOARCH
# https://github.com/carvel-dev/kapp/releases
FROM builder AS kapp
ARG YTT_VERSION=0.55.0
ARG YTT_VERSION=0.62.1
RUN helper-curl bin kapp \
https://github.com/carvel-dev/kapp/releases/download/v${YTT_VERSION}/kapp-linux-@GOARCH
@@ -144,14 +162,17 @@ FROM alpine AS shpod
ENV COMPLETIONS=/usr/share/bash-completion/completions
RUN apk add --no-cache apache2-utils bash bash-completion curl docker-cli file gettext git iputils jq libintl ncurses openssh openssl screen sudo tmux tree vim yq
COPY --from=argocd /usr/local/bin/argocd /usr/local/bin
COPY --from=compose /usr/local/bin/docker-compose /usr/local/bin
COPY --from=crane /usr/local/bin/crane /usr/local/bin
COPY --from=flux /usr/local/bin/flux /usr/local/bin
COPY --from=helm /usr/local/bin/helm /usr/local/bin
COPY --from=httping /usr/local/bin/httping /usr/local/bin
COPY --from=jid /usr/local/bin/jid /usr/local/bin
COPY --from=k9s /usr/local/bin/k9s /usr/local/bin
COPY --from=kapp /usr/local/bin/kapp /usr/local/bin
COPY --from=kubectl /usr/local/bin/kubectl /usr/local/bin
COPY --from=kubecolor /usr/local/bin/kubecolor /usr/local/bin
COPY --from=kube-linter /usr/local/bin/kube-linter /usr/local/bin
COPY --from=kubent /usr/local/bin/kubent /usr/local/bin
COPY --from=kubeseal /usr/local/bin/kubeseal /usr/local/bin
@@ -167,7 +188,9 @@ COPY --from=velero /usr/local/bin/velero /usr/local/bin
COPY --from=ytt /usr/local/bin/ytt /usr/local/bin
RUN set -e ; for BIN in \
argocd \
crane \
flux \
helm \
kapp \
kubectl \
@@ -222,10 +245,12 @@ COPY setup-tailhist.sh /usr/local/bin
# Generate a list of all installed versions.
RUN ( \
ab -V | head -n1 ;\
argocd version --client | head -n1 ;\
bash --version | head -n1 ;\
curl --version | head -n1 ;\
docker version --format="Docker {{.Client.Version}}" ;\
envsubst --version | head -n1 ;\
flux --version ;\
git --version ;\
jq --version ;\
ssh -V ;\
@@ -238,6 +263,7 @@ RUN ( \
jid --version ;\
echo "k9s $(k9s version | grep Version)" ;\
kapp --version | head -n1 ;\
echo "kubecolor $(kubecolor --kubecolor-version)" ;\
echo "kubectl $(kubectl version --short --client)" ;\
echo "kube-linter $(kube-linter version)" ;\
echo "kubent $(kubent --version 2>&1)" ;\

View File

@@ -52,9 +52,10 @@ KUBE_PS1_NS_COLOR="green"
PS1="\e[1m\e[31m[\$HOSTIP] \e[0m(\$(kube_ps1)) \e[34m\u@\h\e[35m \w\e[0m\n$ "
export EDITOR=vim
export KUBECOLOR_LIGHT_BACKGROUND=true
export PATH="$HOME/.krew/bin:$PATH"
alias k=kubectl
alias k=kubecolor
complete -F __start_kubectl k
. /usr/share/bash-completion/completions/kubectl.bash

1
motd
View File

@@ -3,4 +3,5 @@
🔎 Check "/versions.txt" to see the list of included tools.
🔗 See https://github.com/jpetazzo/shpod for more information.
📦️ You can install extra packages with 'sudo apk add PKGNAME'.
🎨 Dark terminal background? Unset KUBECOLOR_LIGHT_BACKGROUND.