Skip to content

Commit 51d66c6

Browse files
committed
Added kubectl-grep and kubectl-argo-rollouts
1 parent 12b4a5a commit 51d66c6

File tree

4 files changed

+62
-32
lines changed

4 files changed

+62
-32
lines changed

Dockerfile

+30-19
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ echo "::group::Build Python 3.12"
2727
FTP="https://www.python.org/ftp/python"
2828
# determine the latest patch version
2929
ver=$(curl -s $FTP/ | sed -En 's/^.+href="('${VER/./\\.}'\..+)\/".+$/\1/p' | sort -Vr | head -1)
30-
curl -sL $FTP/$ver/Python-$ver.tgz | tar -xz
30+
curl -fsL $FTP/$ver/Python-$ver.tgz | tar -xz
3131
cd Python*
3232
# https://docs.python.org/3/using/configure.html
3333
./configure -q \
@@ -82,7 +82,7 @@ echo "::group::Build GNU parallel"
8282

8383
cd /tmp
8484
FTP="https://ftp.gnu.org/gnu/parallel"
85-
curl -sL $FTP/parallel-latest.tar.bz2 | tar -xj
85+
curl -fsL $FTP/parallel-latest.tar.bz2 | tar -xj
8686
cd parallel*
8787
./configure --prefix=/usr/local -q
8888
make -sj$(nproc)
@@ -252,7 +252,7 @@ echo "::group::Install Linux utilities"
252252
REL="https://github.com/casey/just/releases/latest"
253253
VER=$(curl -Is $REL | sed -En 's/^location:.+\/tag\/(.+)\r$/\1/p')
254254
URL="$REL/download/just-$VER-$(uname -m)-unknown-linux-musl.tar.gz"
255-
curl -sSL $URL | tar -xz --no-same-owner just* completions/*.bash
255+
curl -fsSL $URL | tar -xz --no-same-owner just* completions/*.bash
256256
mv just /usr/local/bin
257257
mv */*.bash /usr/local/etc/bash_completion.d
258258
mv just.1 /usr/local/share/man/man1
@@ -262,7 +262,7 @@ echo "::group::Install Linux utilities"
262262
install_bin() {
263263
cd /usr/local/bin
264264
local bin=$1 src=$2
265-
curl -sSLo $bin $src
265+
curl -fsSLo $bin $src
266266
chmod +x $bin
267267
$bin --version
268268
}
@@ -284,7 +284,7 @@ echo "::group::Install Linux utilities"
284284
local pkg url
285285
for pkg in "$@"; do
286286
url="$EPEL/9/Everything/$(uname -m)/Packages/${pkg::1}/"
287-
url+=$(curl -Ls $url | sed -En 's/^.+href="('${pkg}'-[0-9.]+[^"]+).+$/\1/p')
287+
url+=$(curl -sL $url | sed -En 's/^.+href="('${pkg}'-[0-9.]+[^"]+).+$/\1/p')
288288
rpm -i $url
289289
done
290290
}
@@ -303,7 +303,7 @@ echo "::group::Install Python tools"
303303
( set -uxo pipefail
304304

305305
# install Poetry: https://python-poetry.org/docs/#installing-with-the-official-installer
306-
curl -sSL https://install.python-poetry.org | \
306+
curl -fsSL https://install.python-poetry.org | \
307307
POETRY_HOME="/usr/local/poetry" python3 -
308308
# /usr/local/poetry/bin is already in $PATH via Dockerfile ENV command
309309
poetry -V
@@ -341,7 +341,7 @@ set -e
341341
echo "::group::Install Node.js 22"
342342
( set -uxo pipefail
343343

344-
curl -sSL https://rpm.nodesource.com/setup_22.x | bash -
344+
curl -fsSL https://rpm.nodesource.com/setup_22.x | bash -
345345
dnf install -y nodejs
346346
dnf clean all
347347
rm -rf /var/log/* /var/cache/dnf
@@ -367,7 +367,7 @@ echo "::group::Install AWS tools"
367367

368368
# install AWS CLI v2: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
369369
cd /tmp
370-
curl -sSLo awscliv2.zip https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip
370+
curl -fsSLo awscliv2.zip https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip
371371
unzip -q awscliv2.zip
372372
./aws/install
373373
rm -rf aws awscliv2.zip
@@ -385,7 +385,7 @@ echo "::group::Install AWS tools"
385385
rm -rf /var/log/* /var/cache/dnf
386386
REL="https://s3.amazonaws.com/mountpoint-s3-release/latest"
387387
ARCH=$(uname -m | sed 's/aarch64/arm64/') # must be x86_64 or arm64
388-
curl -sSL $REL/$ARCH/mount-s3.tar.gz | \
388+
curl -fsSL $REL/$ARCH/mount-s3.tar.gz | \
389389
tar -xz -C /usr/local/bin --no-same-owner --strip 2 ./bin
390390
mount-s3 --version
391391
)
@@ -404,15 +404,15 @@ echo "::group::Install OCI image tools"
404404
# install Dive: https://github.com/wagoodman/dive#installation
405405
REL="https://github.com/wagoodman/dive/releases/latest"
406406
VER=$(curl -Is $REL | sed -En 's/^location:.+\/tag\/v(.+)\r$/\1/p')
407-
curl -sSL $REL/download/dive_${VER}_linux_${ARCH}.tar.gz | \
407+
curl -fsSL $REL/download/dive_${VER}_linux_${ARCH}.tar.gz | \
408408
tar -xz -C /usr/local/bin --no-same-owner dive
409409
dive --version
410410
(
411411
# install MinToolkit: https://github.com/mintoolkit/mint#installation
412412
REL="https://github.com/mintoolkit/mint/releases/latest"
413413
# name must be *linux.* or *linux_arm64.*
414414
ARCH=${ARCH/%amd*/} ARCH=${ARCH/arm/_arm}
415-
curl -sSL $REL/download/dist_linux${ARCH}.tar.gz | \
415+
curl -fsSL $REL/download/dist_linux${ARCH}.tar.gz | \
416416
tar -xz -C /usr/local/bin --no-same-owner --strip 1 dist_linux${ARCH}/mint*
417417
mint --version
418418
)
@@ -433,13 +433,13 @@ echo "::group::Install Kubernetes tools"
433433
cd /usr/local/bin
434434
REL="https://dl.k8s.io/release"
435435
VER=$(curl -sL $REL/stable.txt)
436-
curl -sSLO $REL/$VER/bin/linux/$ARCH/kubectl
436+
curl -fsSLO $REL/$VER/bin/linux/$ARCH/kubectl
437437
chmod +x kubectl
438438
kubectl version --client
439439

440440
# install Kubeconform: https://github.com/yannh/kubeconform#installation
441441
REL="https://github.com/yannh/kubeconform/releases/latest"
442-
curl -sSL $REL/download/kubeconform-linux-${ARCH}.tar.gz | \
442+
curl -fsSL $REL/download/kubeconform-linux-${ARCH}.tar.gz | \
443443
tar -xz -C /usr/local/bin --no-same-owner kubeconform
444444
ln -s /usr/local/bin/kubeconform /usr/local/bin/kubectl-conform
445445
kubectl conform -v
@@ -448,27 +448,31 @@ echo "::group::Install Kubernetes tools"
448448
cd /tmp
449449
REL="https://github.com/kubernetes-sigs/krew/releases/latest"
450450
KREW=krew-linux_${ARCH}
451-
curl -sSL $REL/download/$KREW.tar.gz | tar -xz ./$KREW
451+
curl -fsSL $REL/download/$KREW.tar.gz | tar -xz ./$KREW
452452
./$KREW install krew
453453
rm -f ./$KREW
454454
# /root/.krew/bin is already in $PATH via Dockerfile ENV command
455455
kubectl krew version
456456

457+
# install kubectl-grep: https://github.com/guessi/kubectl-grep#installation
458+
kubectl krew install grep
459+
kubectl grep version --short
460+
457461
# install kube-score: https://github.com/zegl/kube-score#installation
458462
kubectl krew install score
459463
if [ $ARCH == arm64 ]; then
460464
echo "Installing the proper $ARCH binary for kube-score"
461465
REL="https://github.com/zegl/kube-score/releases/latest"
462466
VER=$(curl -Is $REL | sed -En 's/^location:.+\/tag\/v(.+)\r$/\1/p')
463-
curl -sSL $REL/download/kube-score_${VER}_linux_${ARCH}.tar.gz | \
467+
curl -fsSL $REL/download/kube-score_${VER}_linux_${ARCH}.tar.gz | \
464468
tar -C /root/.krew/store/score/* -xz
465469
fi
466470
kubectl score version
467471

468472
# install Helm: https://helm.sh/docs/intro/install/
469473
REL="https://github.com/helm/helm/releases/latest"
470474
VER=$(curl -Is $REL | sed -En 's/^location:.+\/tag\/(.+)\r$/\1/p')
471-
curl -sSL https://get.helm.sh/helm-$VER-linux-${ARCH}.tar.gz | \
475+
curl -fsSL https://get.helm.sh/helm-$VER-linux-${ARCH}.tar.gz | \
472476
tar -xz -C /usr/local/bin --no-same-owner --strip 1 linux-${ARCH}/helm
473477
helm version
474478

@@ -483,7 +487,7 @@ echo "::group::Install Kubernetes tools"
483487
REL="$REPO/releases/latest"
484488
# name must be *linux.tgz or *linux-arm.tgz
485489
ARCH=${ARCH/%amd*/} ARCH=${ARCH/%arm*/-arm}
486-
curl -sSL $REL/download/helm-ssm-linux${ARCH}.tgz | tar -xz
490+
curl -fsSL $REL/download/helm-ssm-linux${ARCH}.tgz | tar -xz
487491
VER=$(curl -Is $REL | sed -En 's/^location:.+\/tag\/(.+)\r$/\1/p')
488492
sed -i "s/\"dev\"/\"$VER\"/" plugin.yaml
489493
helm ssm --help
@@ -494,16 +498,23 @@ echo "::group::Install Kubernetes tools"
494498
# install Helmfile: https://github.com/helmfile/helmfile#installation
495499
REL="https://github.com/helmfile/helmfile/releases/latest"
496500
VER=$(curl -Is $REL | sed -En 's/^location:.+\/tag\/v(.+)\r$/\1/p')
497-
curl -sSL $REL/download/helmfile_${VER}_linux_${ARCH}.tar.gz | \
501+
curl -fsSL $REL/download/helmfile_${VER}_linux_${ARCH}.tar.gz | \
498502
tar -xz -C /usr/local/bin --no-same-owner helmfile
499503
helmfile --version
500504

501505
# install Argo CD: https://argo-cd.readthedocs.io/en/stable/cli_installation/
502506
cd /usr/local/bin
503507
REL="https://github.com/argoproj/argo-cd/releases/latest"
504-
curl -sSLo argocd $REL/download/argocd-linux-${ARCH}
508+
curl -fsSLo argocd $REL/download/argocd-linux-${ARCH}
505509
chmod +x argocd
506510
argocd version --client --short
511+
512+
# install Argo Rollouts: https://argoproj.github.io/argo-rollouts/installation/
513+
cd /usr/local/bin
514+
REL="https://github.com/argoproj/argo-rollouts/releases/latest"
515+
curl -fsSLo kubectl-argo-rollouts $REL/download/kubectl-argo-rollouts-linux-${ARCH}
516+
chmod +x kubectl-argo-rollouts
517+
kubectl argo rollouts version --short
507518
)
508519
echo "::endgroup::"
509520
EOT

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@ Includes the following components:
1313
- [AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide) and [CDK8s](https://cdk8s.io/)
1414
- [Mountpoint for Amazon S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/mountpoint.html)
1515
- [Docker CLI](https://www.docker.com/products/cli)
16-
- Plugins: [BuildX](https://github.com/docker/buildx) and [Compose](https://docs.docker.com/compose)
16+
- [BuildX](https://github.com/docker/buildx)
17+
- [Compose](https://docs.docker.com/compose)
1718
- [Dive](https://github.com/wagoodman/dive) and [MinToolkit/Mint](https://github.com/mintoolkit/mint)
1819
- [Kubectl](https://kubernetes.io/docs/tasks/tools) and [Krew](https://krew.sigs.k8s.io/)
19-
- Plugins: [Kubeconform](https://github.com/yannh/kubeconform) and [kube-score](https://github.com/zegl/kube-score)
20+
- [kubectl-grep](https://github.com/guessi/kubectl-grep)
21+
- [kubectl-argo-rollouts](https://argo-rollouts.readthedocs.io/en/stable/)
22+
- [Kubeconform](https://github.com/yannh/kubeconform)
23+
- [kube-score](https://github.com/zegl/kube-score)
2024
- [Helm](https://helm.sh/)
21-
- Plugins: [helm-diff](https://github.com/databus23/helm-diff) and [helm-ssm](https://github.com/codacy/helm-ssm)
2225
- [Helmfile](https://github.com/helmfile/helmfile)
26+
- [helm-diff](https://github.com/databus23/helm-diff)
27+
- [helm-ssm](https://github.com/codacy/helm-ssm)
2328
- [Argo CD](https://argo-cd.readthedocs.io/en/stable/)
2429

2530
As well as the following utilities:
@@ -34,7 +39,7 @@ As well as the following utilities:
3439

3540
## Prebuilt Images
3641

37-
Size is approximately 2.8 GB.
42+
Size is approximately 3 GB.
3843

3944
Images are available in the following repositories:
4045
- Docker Hub: [`docker.io/erhhung/al2023-devops`](https://hub.docker.com/repository/docker/erhhung/al2023-devops)

config/.bash_profile

+21-9
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,37 @@ alias lt='ls -altr --color=always'
66
alias la='ls -A'
77
alias du0='du -xhd0 | sort -h'
88
alias du1='du -xhd1 | sort -h'
9-
alias k='kubectl'
10-
alias h='helm'
119
alias l='less'
1210

11+
alias k='kubectl'
12+
alias kg='kubectl-grep'
13+
alias ar='kubectl-argo-rollouts'
14+
alias a='argocd'
15+
alias h='helm'
16+
1317
# source Bash completion scripts
1418
. /usr/share/bash-completion/bash_completion
1519
for f in /usr/local/etc/bash_completion.d/*; do
1620
source $f
1721
done
1822

1923
eval "$(register-python-argcomplete pipx)"
20-
. <(pip3 completion --bash)
21-
. <(pip completion --bash)
22-
. <(poetry completions bash)
23-
. <(node --completion-bash)
24-
. <(kubectl completion bash)
25-
. <(helm completion bash)
26-
. <(yq completion bash)
24+
. <(pip3 completion --bash)
25+
. <(pip completion --bash)
26+
. <(poetry completions bash)
27+
. <(just --completions bash)
28+
. <(node --completion-bash)
29+
. <(kubectl completion bash)
30+
. <(kubectl-grep completion bash)
31+
. <(kubectl-argo-rollouts completion bash)
32+
. <(argocd completion bash)
33+
. <(helm completion bash)
34+
. <(yq completion bash)
2735

36+
# register completion for aliases as well
2837
complete -o default -F __start_kubectl k
38+
complete -o default -F __start_kubectl-grep kg
39+
complete -o default -F __start_kubectl-argo-rollouts ar
40+
complete -o default -F __start_argocd a
2941
complete -o default -F __start_helm h
3042
complete -C /usr/local/bin/aws_completer aws

scripts/versions.sh

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ setver krew $(v=(`kubectl krew version | grep GitTag`); echo ${v[1]#v})
6464
setver kube-score $(v=(`kubectl score version`); echo ${v[2]%,})
6565
setver kubeconform $(v=`kubectl conform -v`; echo ${v#v})
6666
setver kubectl $(v=(`kubectl version --client | head -1`); echo ${v[2]#v})
67+
setver kubectl-argo-rollouts $(v=(`kubectl argo rollouts version --short`); v=${v[-1]#v}; echo ${v%+*})
68+
setver kubectl-grep $(v=`kubectl grep version --short`; echo ${v#v})
6769
setver md5sum $(v=(`md5sum --version | head -1`); echo ${v[-1]})
6870
setver mint $(v=`mint --version`; v=(${v//|/ }); echo ${v[-3]})
6971
gclone git://git.joeyh.name/moreutils

0 commit comments

Comments
 (0)