-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maksim Paskal <[email protected]>
- Loading branch information
1 parent
1ef205f
commit 5c3eb15
Showing
14 changed files
with
187 additions
and
65 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Remove Git Tags with Charts | ||
run: git tag -d $(git tag -l "helm-chart-*") | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.21' | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- uses: docker/setup-qemu-action@v2 | ||
- uses: docker/setup-buildx-action@v2 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,97 @@ | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
on: pull_request | ||
|
||
permissions: | ||
contents: write | ||
# on: | ||
# push: | ||
# tags: | ||
# - v* | ||
|
||
# permissions: | ||
# contents: write | ||
|
||
env: | ||
IMAGE: paskalmaksim/aks-node-termination-handler:test-${{ github.run_id }} | ||
#${{github.ref_name}} | ||
|
||
jobs: | ||
goreleaser: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Remove Git Tags with Charts | ||
run: git tag -d $(git tag -l "helm-chart-*") | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
#args: release --clean | ||
args: build --clean --skip=validate --snapshot | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- run: cp Dockerfile ./dist/aks-node-termination-handler_linux_amd64_v1/Dockerfile | ||
- run: cp Dockerfile ./dist/aks-node-termination-handler_linux_arm64/Dockerfile | ||
- run: cp Dockerfile.windows ./dist/aks-node-termination-handler_windows_amd64_v1/Dockerfile | ||
- run: tar -cvf release.tar ./dist | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: release | ||
retention-days: 1 | ||
path: release.tar | ||
|
||
publish-linux-amd64: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- uses: actions/download-artifact@v4 | ||
- run: tar xvf ./release/release.tar | ||
- run: "docker build --pull --push --platform linux/amd64 -t ${{ env.IMAGE }}-linux-amd64 ." | ||
working-directory: ./dist/aks-node-termination-handler_linux_amd64_v1 | ||
|
||
publish-linux-arm64: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- uses: docker/setup-qemu-action@v2 | ||
- uses: docker/setup-buildx-action@v2 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
- uses: actions/download-artifact@v4 | ||
- run: tar xvf ./release/release.tar | ||
- run: "docker build --pull --push --platform linux/arm64 -t ${{ env.IMAGE }}-linux-arm64 ." | ||
working-directory: ./dist/aks-node-termination-handler_linux_arm64 | ||
|
||
publish-windows: | ||
runs-on: windows-latest | ||
needs: build | ||
steps: | ||
- uses: docker/login-action@v3 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- uses: actions/download-artifact@v4 | ||
- run: tar xvf ./release/release.tar | ||
- run: "docker build --pull --platform windows/amd64 -t ${{ env.IMAGE }}-windows-amd64 ." | ||
working-directory: ./dist/aks-node-termination-handler_windows_amd64_v1 | ||
- run: docker push ${{ env.IMAGE }}-windows-amd64 | ||
|
||
publish-manifest: | ||
runs-on: ubuntu-latest | ||
needs: [publish-linux-amd64, publish-linux-arm64, publish-windows] | ||
steps: | ||
- uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- run: docker manifest create ${{ env.IMAGE }} ${{ env.IMAGE }}-linux-amd64 ${{ env.IMAGE }}-linux-arm64 ${{ env.IMAGE }}-windows-amd64 | ||
- run: docker manifest push ${{ env.IMAGE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 | ||
|
||
WORKDIR /app/ | ||
|
||
COPY ./aks-node-termination-handler.exe /app/aks-node-termination-handler.exe | ||
USER ContainerUser | ||
|
||
ENTRYPOINT [ "/app/aks-node-termination-handler.exe" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
```bash | ||
az aks create \ | ||
--subscription <ID> \ | ||
--resource-group <RG> \ | ||
--name test-win-cluster \ | ||
--node-count 1 \ | ||
--generate-ssh-keys \ | ||
--windows-admin-username azure \ | ||
--windows-admin-password 'rEplAcePassw0rd1031$' \ | ||
--vm-set-type VirtualMachineScaleSets \ | ||
--network-plugin azure | ||
|
||
az aks nodepool add \ | ||
--subscription <ID> \ | ||
--resource-group <RG> \ | ||
--cluster-name test-win-cluster \ | ||
--os-type Windows \ | ||
--priority Spot \ | ||
--eviction-policy Delete \ | ||
--spot-max-price -1 \ | ||
--enable-cluster-autoscaler \ | ||
--name spot01 \ | ||
--min-count 1 \ | ||
--max-count 3 | ||
|
||
rm ~/.kube/azure-test-win-cluster | ||
|
||
az aks get-credentials \ | ||
--subscription <ID> \ | ||
--resource-group <RG> \ | ||
--name test-win-cluster \ | ||
--file=~/.kube/azure-test-win-cluster | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters