From 7c989d48af667f646301bc28976c7206c9fd5419 Mon Sep 17 00:00:00 2001 From: nxtcoder17 Date: Fri, 27 Sep 2024 13:49:05 +0530 Subject: [PATCH 1/2] ci: fixing github workflows and actions - migrating to workflows, instead of composing huge custom actions --- .../actions/build-container-images/action.yml | 85 ++++ .github/actions/setup/action.yml | 454 ++++++++++++++++++ .../build-images.yml | 0 .../release-k3s-runner.yml | 0 .github/workflows/release.yml | 87 ++++ Taskfile.yml | 6 +- .../.dockerignore | 0 .../Dockerfile | 0 .../Taskfile.yml | 15 +- .../k8s-manifests/daemonset.yml | 0 .../main.sh | 60 +-- cmd/gcp-spot-node-terminator/Taskfile.yml | 16 +- 12 files changed, 674 insertions(+), 49 deletions(-) create mode 100644 .github/actions/build-container-images/action.yml create mode 100644 .github/actions/setup/action.yml rename .github/{workflows => workflows.old}/build-images.yml (100%) rename .github/{workflows => workflows.old}/release-k3s-runner.yml (100%) create mode 100644 .github/workflows/release.yml rename cmd/{aws-spot-k3s-terminator => aws-spot-node-terminator}/.dockerignore (100%) rename cmd/{aws-spot-k3s-terminator => aws-spot-node-terminator}/Dockerfile (100%) rename cmd/{aws-spot-k3s-terminator => aws-spot-node-terminator}/Taskfile.yml (60%) rename cmd/{aws-spot-k3s-terminator => aws-spot-node-terminator}/k8s-manifests/daemonset.yml (100%) rename cmd/{aws-spot-k3s-terminator => aws-spot-node-terminator}/main.sh (59%) diff --git a/.github/actions/build-container-images/action.yml b/.github/actions/build-container-images/action.yml new file mode 100644 index 0000000..fa92a47 --- /dev/null +++ b/.github/actions/build-container-images/action.yml @@ -0,0 +1,85 @@ +name: 'IAC container images' + +inputs: + github_token: + description: 'GitHub Token' + required: true + + cachix_cache_name: + description: "cachix cache name" + default: "" + + cachix_auth_token: + description: "cachix auth token" + + working_directory: + description: 'working directory' + default: "." + + # builds + builds_iac_job: + description: "builds IAC job" + default: false + + builds_aws_spot_node_terminator: + description: "builds AWS Spot Node terminator" + default: false + + builds_gcp_spot_node_terminator: + description: "builds GCP Spot Node terminator" + default: false + +runs: + using: 'composite' + steps: + - name: setup ENV variables + shell: bash + working-directory: ${{ inputs.working_directory }} + run: |+ + dir=${{ inputs.working_directory }} + if [ "$(basename $dir)" != "." ]; then + echo "IMAGE_REPOSITORY_PREFIX=ghcr.io/${{ github.repository }}/$(basename $dir)" | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT + else + echo "IMAGE_REPOSITORY_PREFIX=ghcr.io/${{ github.repository }}" | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT + fi + + - name: setup nix (with cachix) + uses: kloudlite/actions/setup-nix-cachix@v1 + with: + flake_lock: ${{ inputs.working_directory }}/flake.lock + nix_develop_arguments: "${{ inputs.working_directory }}#default" + + cachix_cache_name: ${{ inputs.cachix_cache_name }} + cachix_auth_token: ${{ inputs.cachix_auth_token }} + + - name: setup docker + uses: kloudlite/actions/setup-docker@v1 + with: + docker_registry: "ghcr.io" + docker_username: ${{ github.actor }} + docker_password: ${{ inputs.github_token }} + + - name: generate image tag + uses: kloudlite/actions/generate-image-tag@v1 + + - name: builds iac job image + if: ${{ inputs.builds_iac_job == 'true' }} + working-directory: ${{ inputs.working_directory }} + shell: bash + run: | + task local:build:iac-job Image="${IMAGE_REPOSITORY_PREFIX}/iac-job:$IMAGE_TAG" + # task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/websocket-server:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + # - name: builds aws-spot-node-terminator + # if: ${{ inputs.builds_aws_spot_node_terminator == 'true' }} + # working-directory: ${{ inputs.working_directory }}/cmd/aws-spot-node-terminator + # shell: bash + # run: | + # task local:build:iac-job Image="${IMAGE_REPOSITORY_PREFIX}/iac-job:$IMAGE_TAG" + + - name: builds gcp-spot-node-terminator + if: ${{ inputs.builds_gcp_spot_node_terminator == 'true' }} + working-directory: ${{ inputs.working_directory }}/cmd/gcp-spot-node-terminator + shell: bash + run: | + task container:build-and-push image="${IMAGE_REPOSITORY_PREFIX}/iac-job:$IMAGE_TAG" push=true dockerArgs="" diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..144833d --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,454 @@ +name: 'infrastructure-as-code setup action' +description: 'infrastructure-as-code setup action' + +inputs: + github_token: + description: 'GitHub Token' + required: true + + image_tag: + description: 'image tag, if empty, will be generated from branch or tag' + default: '' + + cachix_enabled: + description: "cachix enabled" + default: "false" + + cachix_cache_name: + description: "cachix cache name" + default: "kloudlite" + + cachix_auth_token: + description: "cachix auth token" + + docker_enabled: + description: "dokcer enabled" + default: "false" + + git_directory: + description: 'git directory' + default: "." + + # APIs + accounts-api: + description: 'build accounts api' + default: false + + auth-api: + description: 'build auth api' + default: false + + comms-api: + description: 'build comms api' + default: false + + console-api: + description: 'build console api' + default: false + + container-registry-api: + description: 'build container-registry api' + default: false + + gateway-api: + description: 'build gateway api' + default: false + + iam-api: + description: 'build iam api' + default: false + + infra-api: + description: 'build infra api' + default: false + + iot-console-api: + description: 'build iot-console api' + default: false + + message-office-api: + description: 'build message-office api' + default: false + + observability-api: + description: 'build observability api' + default: false + + tenant-agent: + description: 'build tenant-agent' + default: false + + webhook-api: + description: 'build webhook api' + default: false + + websocket-server-api: + description: 'build websocket-server api' + default: false + + gateway-kube-proxy: + description: 'build gateway kube proxy' + default: false + +runs: + using: 'composite' + steps: + - name: setup ENV Variables + shell: bash + id: env-vars + working-directory: ${{ inputs.git_directory }} + run: |+ + GOMODCACHE=${{github.workspace}}/actions/go-mod-cache + GOCACHE=${{github.workspace}}/actions/go-cache + echo "GOMODCACHE=$GOMODCACHE" >> $GITHUB_OUTPUT + echo "GOCACHE=$GOCACHE" >> $GITHUB_OUTPUT + + echo "GOMODCACHE=$GOMODCACHE" >> $GITHUB_ENV + echo "GOCACHE=$GOCACHE" >> $GITHUB_ENV + echo "FILES_HASH=${{ hashFiles('**/*.go', '**/go.mod', '**/go.sum')}}" >> $GITHUB_OUTPUT + echo "PUSH_IMAGE=false" >> $GITHUB_ENV + if [ "$(basename ${{ inputs.git_directory }})" != "." ]; then + echo "IMAGE_REPOSITORY_PREFIX=ghcr.io/${{ github.repository }}/$(basename ${{inputs.git_directory}})" >> $GITHUB_ENV + else + echo "IMAGE_REPOSITORY_PREFIX=ghcr.io/${{ github.repository }}" >> $GITHUB_ENV + fi + + - name: ensures path to setup action exists + shell: bashs + run: |+ + ln -sf ${{ inputs.git_directory }}/.github/actions ./github-actions + + - name: setup nix (with cachix) + if: ${{ inputs.cachix_enabled == 'true' }} + uses: ./github-actions/setup-nix-cachix/ + with: + flake_lock: ${{ inputs.git_directory }}/flake.lock + nix_develop_arguments: "${{ inputs.git_directory }}#default" + + cachix_cache_name: ${{ inputs.cachix_cache_name }} + cachix_auth_token: ${{ inputs.cachix_auth_token }} + + - name: setup nix cache (with github cache) + if: ${{ inputs.cachix_enabled == 'false' }} + uses: ./github-actions/setup-nix-github/ + with: + flake_lock: ${{ inputs.git_directory }}/flake.lock + nix_develop_arguments: "${{ inputs.git_directory }}#default" + + - name: setup docker + if: ${{ inputs.docker_enabled == 'true' }} + uses: ./github-actions/setup-docker + with: + docker_username: ${{ github.actor }} + docker_password: ${{ inputs.github_token }} + + + - name: check if image needs to be pushed + if: github.event_name != 'pull_request' + shell: bash + run: |+ + echo "PUSH_IMAGE=true" >> $GITHUB_ENV + + - name: Create Image Tag + if: ${{ inputs.image_tag != '' }} + shell: bash + run: |+ + echo "IMAGE_TAG=${{ inputs.image_tag }}" >> $GITHUB_ENV + + - name: Create Image Tag from branch name + if: ${{ inputs.image_tag == '' && startsWith(github.ref, 'refs/heads/release-') }} + shell: bash + run: | + set +e + IMAGE_TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/release-//g') + echo "$IMAGE_TAG" | grep -i '\-nightly$' + if [ $? -ne 0 ]; then + IMAGE_TAG="$IMAGE_TAG-nightly" + fi + set -e + + echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV + + - name: Create Image Tag from tag + if: ${{ inputs.image_tag == '' && startsWith(github.ref, 'refs/tags/') }} + shell: bash + run: | + IMAGE_TAG=$(echo ${GITHUB_REF#refs/tags/}) + echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV + + - name: override image if image_tag is nightly + if: "${{ endsWith(env.IMAGE_TAG, '-nightly') }}" + shell: bash + run: |+ + echo "OVERRIDE_PUSHED_IMAGE=true" >> $GITHUB_ENV + + - name: accounts api go build cache + if: ${{ inputs.accounts-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-accounts-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-accounts-api- + + - name: accounts api + if: ${{ inputs.accounts-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/accounts + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/accounts:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: auth api go build cache + if: ${{ inputs.auth-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-auth-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-auth-api- + + - name: auth api + if: ${{ inputs.auth-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/auth + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/auth:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: comms api go build cache + if: ${{ inputs.comms-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-comms-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-comms-api- + + - name: comms api + if: ${{ inputs.comms-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/comms + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/comms:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: console api go build cache + if: ${{ inputs.console-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-console-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-console-api- + + - name: console api + if: ${{ inputs.console-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/console + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/console:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: container-registry api go build cache + if: ${{ inputs.container-registry-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-container-registry-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-container-registry-api- + + - name: container-registry api + if: ${{ inputs.container-registry-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/container-registry + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/container-registry:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: gateway api go build cache + if: ${{ inputs.gateway-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-gateway-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-gateway-api- + + - name: gateway api + if: ${{ inputs.gateway-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/gateway + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/gateway:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: iam api go build cache + if: ${{ inputs.iam-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-iam-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-iam-api- + + - name: iam api + if: ${{ inputs.iam-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/iam + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/iam:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: infra api go build cache + if: ${{ inputs.infra-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-infra-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-infra-api- + + - name: infra api + if: ${{ inputs.infra-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/infra + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/infra:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: iot-console api go build cache + if: ${{ inputs.iot-console-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-iot-console-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-iot-console-api- + + - name: iot-console api + if: ${{ inputs.iot-console-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/iot-console + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/iot-console:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: message-office api go build cache + if: ${{ inputs.message-office-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-message-office-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-message-office-api- + + - name: message-office api + if: ${{ inputs.message-office-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/message-office + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/message-office:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: observability api go build cache + if: ${{ inputs.observability-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-observability-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-observability-api- + + - name: observability api + if: ${{ inputs.observability-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/observability + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/observability:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: tenant-agent go build cache + if: ${{ inputs.tenant-agent == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-tenant-agent-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-tenant-agent- + + - name: tenant-agent + if: ${{ inputs.tenant-agent == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/tenant-agent + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/tenant-agent:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: webhook api go build cache + if: ${{ inputs.webhook-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-webhook-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-webhook-api- + + - name: webhook api + if: ${{ inputs.webhook-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/webhook + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/webhook:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: websocket-server api go build cache + if: ${{ inputs.websocket-server-api == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-websocket-server-api-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-websocket-server-api- + + - name: websocket-server api + if: ${{ inputs.websocket-server-api == 'true' }} + working-directory: ${{ inputs.git_directory }}/apps/websocket-server + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/websocket-server:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + + - name: gateway kube proxy api build cache + if: ${{ inputs.gateway-kube-proxy == 'true' }} + uses: actions/cache@v4 + with: + path: |+ + ${{ env.GOMODCACHE }} + ${{ env.GOCACHE }} + key: go-${{ runner.os }}-gateway-kube-proxy-${{ steps.env-vars.outputs.FILES_HASH }} + save-always: true + restore-keys: go-${{ runner.os }}-gateway-kube-proxy- + + - name: gateway logs proxy + if: ${{ inputs.gateway-kube-proxy == 'true' }} + working-directory: ${{ inputs.git_directory }}/cmd/gateway-kube-proxy + shell: bash + run: | + task container:build-and-push image=${IMAGE_REPOSITORY_PREFIX}/cmd/gateway-kube-proxy:${IMAGE_TAG:-latest} upx=true override=$OVERRIDE_PUSHED_IMAGE push_image=${PUSH_IMAGE} + diff --git a/.github/workflows/build-images.yml b/.github/workflows.old/build-images.yml similarity index 100% rename from .github/workflows/build-images.yml rename to .github/workflows.old/build-images.yml diff --git a/.github/workflows/release-k3s-runner.yml b/.github/workflows.old/release-k3s-runner.yml similarity index 100% rename from .github/workflows/release-k3s-runner.yml rename to .github/workflows.old/release-k3s-runner.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b8fecdc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,87 @@ +name: build-images + +on: + workflow_dispatch: + + push: + tags: + - "v*" + + paths: + - cmd/** + - infrastructure-templates/** + - terraform/** + - ".github/workflows/*" + - ".github/actions/**" + - Dockerfile + +permissions: + contents: read + packages: write + +jobs: + build-images: + strategy: + fail-fast: true + matrix: + name: + - iac-job + - aws-spot-node-terminator + - gcp-spot-node-terminator + + runs-on: ubuntu-latest + name: build container images + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: setup nix (with cachix) + uses: kloudlite/actions/setup-nix-cachix@v1 + with: + flake_lock: ${{ inputs.working_directory }}/flake.lock + nix_develop_arguments: ${{ inputs.working_directory }}#default + + cachix_cache_name: ${{ secrets.CACHIX_CACHE_NAME }} + cachix_auth_token: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - name: setup docker + uses: kloudlite/actions/setup-docker@v1 + with: + docker_registry: "ghcr.io" + docker_username: ${{ github.actor }} + docker_password: ${{ secrets.GITHUB_TOKEN }} + + - name: generate image tag + uses: kloudlite/actions/generate-image-tag@v1 + + - name: builds iac job image + if: ${{ matrix.name == 'iac-job' }} + working-directory: "./" + shell: bash + run: | + task local:build:iac-job Image="ghcr.io/${{ github.repository }}/iac-job:${IMAGE_TAG}" + + - name: builds gcp-spot-node-terminator + if: ${{ matrix.name == 'gcp-spot-node-terminator' }} + working-directory: ./cmd/gcp-spot-node-terminator + shell: bash + run: | + task container:build-and-push image="ghcr.io/${{github.repository}}/cmd/gcp-spot-node-terminator:$IMAGE_TAG" push=true dockerArgs="" + + - name: builds aws spot node terminator + if: ${{ matrix.name == 'aws-spot-node-terminator'}} + working-directory: ./cmd/aws-spot-node-terminator + shell: bash + run: | + task container:build-and-push image="ghcr.io/${{ github.repository }}/cmd/aws-spot-node-terminator:$IMAGE_TAG" push=true dockerArgs="" + + # - uses: ./.github/actions/build-container-images + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} + # cachix_cache_name: ${{ secrets.CACHIX_CACHE_NAME }} + # cachix_auth_token: "${{ secrets.CACHIX_AUTH_TOKEN }}" + # working_directory: "." + # + # builds_iac_job: ${{ matrix.name == 'iac-job' }} + # builds_aws_spot_node_terminator: ${{ matrix.name == 'aws-spot-node-terminator' }} + # builds_gcp_spot_node_terminator: ${{ matrix.name == 'gcp-spot-node-terminator' }} diff --git a/Taskfile.yml b/Taskfile.yml index 278f1c6..21dc1ba 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -27,6 +27,9 @@ tasks: vars: output_dir: ./result nix_store_closure: /tmp/nix-store-closure + requires: + vars: + - Image cmds: - echo OUTPUT DIR is "{{.output_dir}}" - sudo rm -rf {{.output_dir}} @@ -58,7 +61,8 @@ tasks: tar cf context.tar . popd mv $dir/context.tar . - - nerdctl build -f DockerfileNIX2 -o type=oci,push=true,name={{.Image}},compression=zstd,compression-level=22,force-compression=true,oci-mediatype=true -t {{.Image}} . + + - docker buildx build -f DockerfileNIX2 -o type=oci,push=true,name={{.Image}},compression=zstd,compression-level=22,force-compression=true,oci-mediatype=true -t {{.Image}} . --push - rm ./context.tar container:build-and-push: diff --git a/cmd/aws-spot-k3s-terminator/.dockerignore b/cmd/aws-spot-node-terminator/.dockerignore similarity index 100% rename from cmd/aws-spot-k3s-terminator/.dockerignore rename to cmd/aws-spot-node-terminator/.dockerignore diff --git a/cmd/aws-spot-k3s-terminator/Dockerfile b/cmd/aws-spot-node-terminator/Dockerfile similarity index 100% rename from cmd/aws-spot-k3s-terminator/Dockerfile rename to cmd/aws-spot-node-terminator/Dockerfile diff --git a/cmd/aws-spot-k3s-terminator/Taskfile.yml b/cmd/aws-spot-node-terminator/Taskfile.yml similarity index 60% rename from cmd/aws-spot-k3s-terminator/Taskfile.yml rename to cmd/aws-spot-node-terminator/Taskfile.yml index 5307974..9527e96 100644 --- a/cmd/aws-spot-k3s-terminator/Taskfile.yml +++ b/cmd/aws-spot-node-terminator/Taskfile.yml @@ -2,17 +2,16 @@ version: 3 tasks: container:build-and-push: - preconditions: - - sh: '[[ -n "{{.Image}}" ]]' - msg: 'var Image must have a value' + requires: + vars: + - image vars: - Push: true - DockerArgs: "" + push: '{{ .push | default "true" }}' cmds: - - docker build -t {{.Image}} . {{.DockerArgs}} + - docker build -t {{.image}} . {{.dockerArgs}} - |+ - if [ "{{.Push}}" == "true" ]; then - docker push {{.Image}} + if [ "{{.push}}" == "true" ]; then + docker push {{.image}} fi local-build: diff --git a/cmd/aws-spot-k3s-terminator/k8s-manifests/daemonset.yml b/cmd/aws-spot-node-terminator/k8s-manifests/daemonset.yml similarity index 100% rename from cmd/aws-spot-k3s-terminator/k8s-manifests/daemonset.yml rename to cmd/aws-spot-node-terminator/k8s-manifests/daemonset.yml diff --git a/cmd/aws-spot-k3s-terminator/main.sh b/cmd/aws-spot-node-terminator/main.sh similarity index 59% rename from cmd/aws-spot-k3s-terminator/main.sh rename to cmd/aws-spot-node-terminator/main.sh index 71bf9b5..782c77c 100644 --- a/cmd/aws-spot-k3s-terminator/main.sh +++ b/cmd/aws-spot-node-terminator/main.sh @@ -29,45 +29,45 @@ echo ' ' function debug_msg() { - if [ "${debug_mode}" == "true" ]; then - echo "[debug] " "$@" - fi + if [ "${debug_mode}" == "true" ]; then + echo "[debug] " "$@" + fi } az_name=$(curl http://169.254.169.254/latest/meta-data/placement/availability-zone) labelled_az=$(kubectl get nodes/"$node_name" -o jsonpath='{.metadata.labels.kloudlite\.io/cloud-provider\.az}') if [[ "$az_name" != "$labelled_az" ]]; then - echo "node $node_name is in a different AZ ($az_name) than the desired AZ ($labelled_az), spot instances thing, Anyway labelling correctly now" - kubectl label --overwrite nodes "$node_name" "kloudlite.io/cloud-provider.az=$az_name" + echo "node $node_name is in a different AZ ($az_name) than the desired AZ ($labelled_az), spot instances thing, Anyway labelling correctly now" + kubectl label --overwrite nodes "$node_name" "kloudlite.io/cloud-provider.az=$az_name" fi while true; do - debug_msg "executing 'curl --connect-timeout 1 -s -f $url'" - d=$(curl --connect-timeout 1 -s -f "$url") - exit_code=$? - debug_msg "exit_code is $exit_code (!= 0), so trying again in 3 seconds" - if [ "$exit_code" -eq 0 ]; then - echo "Instance is marked for termination: $d" - term_time=$(echo -n "$d" | jq -r '.time') - term_timestamp=$(date -d "$term_time" +%s) - curr_timestamp=$(date +%s) + debug_msg "executing 'curl --connect-timeout 1 -s -f $url'" + d=$(curl --connect-timeout 1 -s -f "$url") + exit_code=$? + debug_msg "exit_code is $exit_code (!= 0), so trying again in 3 seconds" + if [ "$exit_code" -eq 0 ]; then + echo "Instance is marked for termination: $d" + term_time=$(echo -n "$d" | jq -r '.time') + term_timestamp=$(date -d "$term_time" +%s) + curr_timestamp=$(date +%s) - diff=$((term_timestamp - curr_timestamp)) - echo "we have ${diff}s to drain and terminate the node ${node_name}" - if [ $((diff)) -ge 0 ]; then - debug_msg kubectl drain --ignore-daemonsets --delete-local-data --force --grace-period=$((diff - 30)) "${node_name}" - kubectl drain --ignore-daemonsets --delete-local-data --force --grace-period=$((diff - 30)) "${node_name}" - kubectl delete node/"${node_name}" - fi - else - # need to uncordon if new spot node has arrived, and is ready - node_status=$(kubectl get node/"${node_name}" -o jsonpath='{.status.conditions[?(.type == "Ready")].status}') - node_is_schedulable=$(kubectl get node/"${node_name}" -o jsonpath='{.spec.unschedulable}') + diff=$((term_timestamp - curr_timestamp)) + echo "we have ${diff}s to drain and terminate the node ${node_name}" + if [ $((diff)) -ge 0 ]; then + debug_msg kubectl drain --ignore-daemonsets --delete-local-data --force --grace-period=$((diff - 30)) "${node_name}" + kubectl drain --ignore-daemonsets --delete-local-data --force --grace-period=$((diff - 30)) "${node_name}" + kubectl delete node/"${node_name}" + fi + else + # need to uncordon if new spot node has arrived, and is ready + node_status=$(kubectl get node/"${node_name}" -o jsonpath='{.status.conditions[?(.type == "Ready")].status}') + node_is_schedulable=$(kubectl get node/"${node_name}" -o jsonpath='{.spec.unschedulable}') - if [ "$node_status" = "True" ]; then - [ "$node_is_schedulable" = "true" ] && echo "node ${node_name} is ready, but marked as unschedulable, uncordoning ..." && kubectl uncordon "${node_name}" && exit 0 - fi - fi - sleep 3 + if [ "$node_status" = "True" ]; then + [ "$node_is_schedulable" = "true" ] && echo "node ${node_name} is ready, but marked as unschedulable, uncordoning ..." && kubectl uncordon "${node_name}" && exit 0 + fi + fi + sleep 3 done diff --git a/cmd/gcp-spot-node-terminator/Taskfile.yml b/cmd/gcp-spot-node-terminator/Taskfile.yml index 2a75b00..00f503f 100644 --- a/cmd/gcp-spot-node-terminator/Taskfile.yml +++ b/cmd/gcp-spot-node-terminator/Taskfile.yml @@ -2,18 +2,14 @@ version: 3 tasks: container:build-and-push: - preconditions: - - sh: '[[ -n "{{.Image}}" ]]' - msg: 'var Image must have a value' + requires: + vars: + - image vars: - Push: true - DockerArgs: "" + push: '{{.push | default "true"}}' + dockerArgs: "" cmds: - - docker build -t {{.Image}} . {{.DockerArgs}} - - |+ - if [ "{{.Push}}" == "true" ]; then - docker push {{.Image}} - fi + - docker buildx build -t {{.image}} . {{.dockerArgs}} --push={{.push}} local-build: preconditions: From 1851995efc99b5cdedab6389064f99611579b62a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 08:08:36 +0000 Subject: [PATCH 2/2] chore(deps): bump golang.org/x/net Bumps the go_modules group with 1 update in the / directory: [golang.org/x/net](https://github.com/golang/net). Updates `golang.org/x/net` from 0.17.0 to 0.23.0 - [Commits](https://github.com/golang/net/compare/v0.17.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect dependency-group: go_modules ... Signed-off-by: dependabot[bot] --- go.mod | 23 +---------------- go.sum | 79 ---------------------------------------------------------- 2 files changed, 1 insertion(+), 101 deletions(-) diff --git a/go.mod b/go.mod index 24ff1eb..73f0812 100644 --- a/go.mod +++ b/go.mod @@ -2,25 +2,4 @@ module github.com/kloudlite/infrastructure-as-code go 1.21.1 -require ( - github.com/kloudlite/operator v0.0.0-20231216132735-642d2cd1dfd6 - sigs.k8s.io/yaml v1.4.0 -) - -require ( - github.com/go-logr/logr v1.2.4 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/gofuzz v1.2.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/text v0.13.0 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/apimachinery v0.28.1 // indirect - k8s.io/klog/v2 v2.100.1 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect - sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect -) +require sigs.k8s.io/yaml v1.4.0 diff --git a/go.sum b/go.sum index 235a6d6..ea2896b 100644 --- a/go.sum +++ b/go.sum @@ -1,85 +1,6 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kloudlite/operator v0.0.0-20231216132735-642d2cd1dfd6 h1:iiCRcZqzrusLf7jIQAhq7SL4489eveJE5oHLdjYrxT8= -github.com/kloudlite/operator v0.0.0-20231216132735-642d2cd1dfd6/go.mod h1:4JM9BYl5zrN47k6uY7zPTn+T/nKiFvZ5t6fgwG82loI= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/apimachinery v0.28.1 h1:EJD40og3GizBSV3mkIoXQBsws32okPOy+MkRyzh6nPY= -k8s.io/apimachinery v0.28.1/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.3.0 h1:UZbZAZfX0wV2zr7YZorDz6GXROfDFj6LvqCRm4VUVKk= -sigs.k8s.io/structured-merge-diff/v4 v4.3.0/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=