forked from hellofresh/eks-rolling-update
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to k8s 1.25, update deps, add docker-image ghcr
- Loading branch information
1 parent
61d3d09
commit 70bb357
Showing
8 changed files
with
71 additions
and
122 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,57 @@ | ||
name: Build Docker Images | ||
|
||
on: | ||
push: | ||
tags: | ||
- '**' | ||
branches: | ||
- 'main' | ||
pull_request: | ||
types: | ||
- "opened" | ||
- "reopened" | ||
- "synchronize" | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
strategy: | ||
matrix: | ||
image: ["eks-rolling-update"] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.image }} | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=edge | ||
type=ref,event=pr | ||
- name: Build and push Docker Images | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
build-args: | | ||
"TARGET=${{ matrix.image }}" | ||
"VERSION=${{ version }}" |
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,4 +1,5 @@ | ||
venv | ||
.venv | ||
.DS_Store | ||
*.pyc | ||
.vscode | ||
|
@@ -8,4 +9,4 @@ venv | |
.eggs/ | ||
build/ | ||
dist/ | ||
*.egg-info/ | ||
*.egg-info/ |
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,25 +1,24 @@ | ||
FROM python:3-alpine3.10 as builder | ||
ARG VERSION | ||
FROM python:3.11.4-alpine3.18 as builder | ||
ARG KUBERNETES_VERSION=v1.25.10 | ||
ARG VERSION=master | ||
RUN apk add --no-cache curl make && \ | ||
curl -LO https://amazon-eks.s3-us-west-2.amazonaws.com/1.14.6/2019-08-22/bin/linux/amd64/aws-iam-authenticator && \ | ||
chmod +x aws-iam-authenticator && \ | ||
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ | ||
curl -LO https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kubectl && \ | ||
chmod +x kubectl | ||
|
||
COPY . . | ||
RUN make dist version=${VERSION} | ||
|
||
FROM python:3-alpine3.10 | ||
FROM python:3.11.4-alpine3.18 | ||
|
||
COPY --from=builder /aws-iam-authenticator /kubectl /usr/local/bin/ | ||
COPY --from=builder /kubectl /usr/local/bin/ | ||
COPY --from=builder /dist/*.whl /tmp | ||
|
||
RUN apk add --no-cache bash gcc musl-dev | ||
RUN pip3 install --no-cache-dir \ | ||
awscli \ | ||
/tmp/*.whl && \ | ||
rm -rf /tmp/* && \ | ||
AWS_DEFAULT_REGION=us-east-1 eks_rolling_update.py -h | ||
AWS_DEFAULT_REGION=eu-central-1 eks_rolling_update.py -h | ||
|
||
WORKDIR /app | ||
ENTRYPOINT ["eks_rolling_update.py"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
boto3~=1.9.246 | ||
kubernetes~=10.0.1 | ||
boto3~=1.26.153 | ||
kubernetes~=25.3.0 | ||
python-dotenv~=0.10.2 | ||
urllib3<1.26 | ||
urllib3<1.26 |