Skip to content

Commit

Permalink
Merge pull request #168 from theohbrothers/enhancement/bump-kubectl-1…
Browse files Browse the repository at this point in the history
….28-variants-to-1.28.14

Enhancement: Bump kubectl 1.28 variants to 1.28.14
  • Loading branch information
theohbrothersbot authored Sep 15, 2024
2 parents 0c9d7f6 + 5fd80d7 commit 4ca7355
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 39 deletions.
72 changes: 36 additions & 36 deletions .github/workflows/ci-master-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ jobs:
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
build-1-28-13:
build-1-28-14:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -623,9 +623,9 @@ jobs:
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-1.28.13-${{ github.sha }}
key: ${{ runner.os }}-buildx-1.28.14-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-1.28.13-
${{ runner.os }}-buildx-1.28.14-
${{ runner.os }}-buildx-
- name: Login to Docker Hub registry
Expand All @@ -638,7 +638,7 @@ jobs:

# This step generates the docker tags
- name: Prepare
id: prep-1-28-13
id: prep-1-28-14
run: |
set -e
Expand All @@ -651,7 +651,7 @@ jobs:
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="1.28.13"
VARIANT="1.28.14"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
Expand All @@ -661,51 +661,51 @@ jobs:
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT
- name: 1.28.13 - Build (PRs)
- name: 1.28.14 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: variants/1.28.13
context: variants/1.28.14
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: false
tags: |
${{ github.repository }}:${{ steps.prep-1-28-13.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-13.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 1.28.13 - Build and push (master)
- name: 1.28.14 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v5
with:
context: variants/1.28.13
context: variants/1.28.14
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-28-13.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-13.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 1.28.13 - Build and push (release)
- name: 1.28.14 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: variants/1.28.13
context: variants/1.28.14
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-28-13.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-13.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-13.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# This step generates the docker tags
- name: Prepare
id: prep-1-28-13-envsubst-git-jq-kustomize-sops-ssh-yq
id: prep-1-28-14-envsubst-git-jq-kustomize-sops-ssh-yq
run: |
set -e
Expand All @@ -718,7 +718,7 @@ jobs:
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="1.28.13-envsubst-git-jq-kustomize-sops-ssh-yq"
VARIANT="1.28.14-envsubst-git-jq-kustomize-sops-ssh-yq"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
Expand All @@ -728,45 +728,45 @@ jobs:
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT
- name: 1.28.13-envsubst-git-jq-kustomize-sops-ssh-yq - Build (PRs)
- name: 1.28.14-envsubst-git-jq-kustomize-sops-ssh-yq - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: variants/1.28.13-envsubst-git-jq-kustomize-sops-ssh-yq
context: variants/1.28.14-envsubst-git-jq-kustomize-sops-ssh-yq
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: false
tags: |
${{ github.repository }}:${{ steps.prep-1-28-13-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-13-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 1.28.13-envsubst-git-jq-kustomize-sops-ssh-yq - Build and push (master)
- name: 1.28.14-envsubst-git-jq-kustomize-sops-ssh-yq - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v5
with:
context: variants/1.28.13-envsubst-git-jq-kustomize-sops-ssh-yq
context: variants/1.28.14-envsubst-git-jq-kustomize-sops-ssh-yq
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-28-13-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-13-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: 1.28.13-envsubst-git-jq-kustomize-sops-ssh-yq - Build and push (release)
- name: 1.28.14-envsubst-git-jq-kustomize-sops-ssh-yq - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: variants/1.28.13-envsubst-git-jq-kustomize-sops-ssh-yq
context: variants/1.28.14-envsubst-git-jq-kustomize-sops-ssh-yq
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
push: true
tags: |
${{ github.repository }}:${{ steps.prep-1-28-13-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-13-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-13-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-1-28-14-envsubst-git-jq-kustomize-sops-ssh-yq.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

Expand Down Expand Up @@ -3387,7 +3387,7 @@ jobs:
- build-1-31-1
- build-1-30-5
- build-1-29-9
- build-1-28-13
- build-1-28-14
- build-1-27-16
- build-1-26-15
- build-1-25-16
Expand Down Expand Up @@ -3418,7 +3418,7 @@ jobs:
- build-1-31-1
- build-1-30-5
- build-1-29-9
- build-1-28-13
- build-1-28-14
- build-1-27-16
- build-1-26-15
- build-1-25-16
Expand Down Expand Up @@ -3451,7 +3451,7 @@ jobs:
- build-1-31-1
- build-1-30-5
- build-1-29-9
- build-1-28-13
- build-1-28-14
- build-1-27-16
- build-1-26-15
- build-1-25-16
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Dockerized `kubectl` with useful tools.
| `:1.30.5-envsubst-git-jq-kustomize-sops-ssh-yq` | [View](variants/1.30.5-envsubst-git-jq-kustomize-sops-ssh-yq) |
| `:1.29.9` | [View](variants/1.29.9) |
| `:1.29.9-envsubst-git-jq-kustomize-sops-ssh-yq` | [View](variants/1.29.9-envsubst-git-jq-kustomize-sops-ssh-yq) |
| `:1.28.13` | [View](variants/1.28.13) |
| `:1.28.13-envsubst-git-jq-kustomize-sops-ssh-yq` | [View](variants/1.28.13-envsubst-git-jq-kustomize-sops-ssh-yq) |
| `:1.28.14` | [View](variants/1.28.14) |
| `:1.28.14-envsubst-git-jq-kustomize-sops-ssh-yq` | [View](variants/1.28.14-envsubst-git-jq-kustomize-sops-ssh-yq) |
| `:1.27.16` | [View](variants/1.27.16) |
| `:1.27.16-envsubst-git-jq-kustomize-sops-ssh-yq` | [View](variants/1.27.16-envsubst-git-jq-kustomize-sops-ssh-yq) |
| `:1.26.15` | [View](variants/1.26.15) |
Expand Down
2 changes: 1 addition & 1 deletion generate/definitions/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"1.31.1",
"1.30.5",
"1.29.9",
"1.28.13",
"1.28.14",
"1.27.16",
"1.26.15",
"1.25.16",
Expand Down
60 changes: 60 additions & 0 deletions variants/1.28.14-envsubst-git-jq-kustomize-sops-ssh-yq/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
FROM alpine:3.15
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN apk add --no-cache ca-certificates

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN set -eux; \
BIN_URL=https://dl.k8s.io/release/v1.28.14/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl; \
SHA512=$( wget -qO- "$BIN_URL.sha512" ); \
wget -qO- "$BIN_URL" > /usr/local/bin/kubectl; \
chmod +x /usr/local/bin/kubectl; \
sha512sum /usr/local/bin/kubectl | grep "^$SHA512 "; \
kubectl version --client

# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile
# Bring in gettext so we can get `envsubst`, then throw
# the rest away. To do this, we need to install `gettext`
# then move `envsubst` out of the way so `gettext` can
# be deleted completely, then move `envsubst` back.
RUN apk add --no-cache --virtual .gettext gettext \
&& mv /usr/bin/envsubst /tmp/ \
\
&& runDeps="$( \
scanelf --needed --nobanner /tmp/envsubst \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --no-cache $runDeps \
&& apk del .gettext \
&& mv /tmp/envsubst /usr/local/bin/

RUN apk add --no-cache git

RUN apk add --no-cache jq

RUN apk add --no-cache curl \
&& curl -L https://github.com/kubernetes-sigs/kustomize/releases/download/v2.0.3/kustomize_2.0.3_linux_amd64 -o /usr/local/bin/kustomize \
&& chmod +x /usr/local/bin/kustomize \
&& apk del curl

RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^53aec65e45f62a769ff24b7e5384f0c82d62668dd96ed56685f649da114b4dbb '; \
sops --version

RUN apk add --no-cache gnupg

RUN apk add --no-cache openssh-client

RUN apk add --no-cache yq

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- kubectl "$@"
elif [ $# -gt 0 ] && kubectl "$1" --help > /dev/null 2>&1; then
set -- kubectl "$@"
fi

exec "$@"
20 changes: 20 additions & 0 deletions variants/1.28.14/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM alpine:3.15
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

RUN apk add --no-cache ca-certificates

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN set -eux; \
BIN_URL=https://dl.k8s.io/release/v1.28.14/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl; \
SHA512=$( wget -qO- "$BIN_URL.sha512" ); \
wget -qO- "$BIN_URL" > /usr/local/bin/kubectl; \
chmod +x /usr/local/bin/kubectl; \
sha512sum /usr/local/bin/kubectl | grep "^$SHA512 "; \
kubectl version --client

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
10 changes: 10 additions & 0 deletions variants/1.28.14/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- kubectl "$@"
elif [ $# -gt 0 ] && kubectl "$1" --help > /dev/null 2>&1; then
set -- kubectl "$@"
fi

exec "$@"

0 comments on commit 4ca7355

Please sign in to comment.