-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use Sumo Logic hosted Kube RBAC Proxy (#3674)
* chore: add script and action to sync repositories Signed-off-by: Dominik Rosiek <[email protected]> * feat: use Sumo Logic hosted Kube RBAC Proxy Signed-off-by: Dominik Rosiek <[email protected]> * chore: change schedule for syncing repositories Signed-off-by: Dominik Rosiek <[email protected]> * chore: restrict sync workflow to be run once Signed-off-by: Dominik Rosiek <[email protected]> * chore: rename workflows Signed-off-by: Dominik Rosiek <[email protected]> * chore: fix typo Signed-off-by: Dominik Rosiek <[email protected]> --------- Signed-off-by: Dominik Rosiek <[email protected]>
- Loading branch information
1 parent
e7f3989
commit 5631a6a
Showing
7 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
chore: use Sumo Logic hosted Kube RBAC Proxy |
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,30 @@ | ||
name: Sync Repositories | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
sync-repositories: | ||
name: Sync container repositories | ||
strategy: | ||
matrix: | ||
include: | ||
- docker_username: DOCKERHUB_LOGIN_KUBE_RBAC_PROXY | ||
docker_password: DOCKERHUB_PASSWORD_KUBE_RBAC_PROXY | ||
aws_access_key: AWS_ACCESS_KEY_ID_KUBE_RBAC_PROXY | ||
aws_secret_access_key: AWS_SECRET_ACCESS_KEY_KUBE_RBAC_PROXY | ||
src_repository: quay.io/brancz/kube-rbac-proxy | ||
dest_docker_namespace: docker.io/sumologic | ||
dest_ecr_namespace: public.ecr.aws/a4t4y2n3 | ||
uses: ./.github/workflows/workflow-sync-repositories.yaml | ||
with: | ||
src_repository: ${{ matrix.src_repository }} | ||
dest_docker_namespace: ${{ matrix.dest_docker_namespace }} | ||
dest_ecr_namespace: ${{ matrix.dest_ecr_namespace }} | ||
secrets: | ||
DOCKER_USERNAME: ${{ secrets[matrix.docker_username] }} | ||
DOCKER_PASSWORD: ${{ secrets[matrix.docker_password] }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets[matrix.aws_access_key] }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets[matrix.aws_secret_access_key] }} |
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,59 @@ | ||
name: Sync container repository | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
src_repository: | ||
description: Source repository | ||
required: true | ||
type: string | ||
dest_docker_namespace: | ||
description: Destination DockerHub repository | ||
required: true | ||
type: string | ||
dest_ecr_namespace: | ||
description: Destination ECR repository | ||
required: true | ||
type: string | ||
secrets: | ||
DOCKER_USERNAME: | ||
required: true | ||
DOCKER_PASSWORD: | ||
required: true | ||
AWS_ACCESS_KEY_ID: | ||
required: true | ||
AWS_SECRET_ACCESS_KEY: | ||
required: true | ||
|
||
jobs: | ||
sync-repository: | ||
runs-on: ubuntu-20.04 | ||
name: ${{ inputs.src_repository }} | ||
steps: | ||
- name: No re-runs | ||
run: | | ||
if [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then | ||
echo "It is not advised to re-run this workflow! It won't speed up the process!" | ||
exit 1 | ||
else | ||
echo "not a re-run, continue" | ||
fi | ||
- uses: actions/checkout@v4 | ||
- name: Install skopeo | ||
run: sudo apt-get install skopeo -y | ||
- name: Login to Docker Hub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Synchronize image to Docker Hub repository | ||
run: ./ci/sync-repository.sh ${{ inputs.src_repository }} ${{ inputs.dest_docker_namespace }} | ||
- name: Login to ECR | ||
run: |- | ||
aws ecr-public get-login-password --region us-east-1 \ | ||
| docker login --username AWS --password-stdin ${{ inputs.dest_ecr_namespace }} | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
- name: Synchronize image to ECR repository | ||
run: ./ci/sync-repository.sh ${{ inputs.src_repository }} ${{ inputs.dest_ecr_namespace }} |
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,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
SRC_REPOSITORY=${1} | ||
DESTINATION_NAMESPACE=${2} | ||
skopeo sync \ | ||
-f v2s2 \ | ||
--retry-times 5 \ | ||
--src docker \ | ||
--dest docker \ | ||
"${SRC_REPOSITORY}" \ | ||
"${DESTINATION_NAMESPACE}" |
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