Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor from deployment to cronjob #12

Open
onmomo opened this issue Jun 7, 2021 · 3 comments
Open

Refactor from deployment to cronjob #12

onmomo opened this issue Jun 7, 2021 · 3 comments

Comments

@onmomo
Copy link
Contributor

onmomo commented Jun 7, 2021

The project could leverage the K8s CronJob to do the scheduling. This would simplify the code and optimize the K8s resource usage.

eg

apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: ecr-credentials-updater
spec:
  schedule: "* */3 * * *" # ecr token expires every 12 hours, we try every 3 hours to refresh the token
  concurrencyPolicy: Forbid
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 2
...
@trondhindenes
Copy link
Owner

agreed! I'll see if I can get that done.

@onmomo
Copy link
Contributor Author

onmomo commented Jun 12, 2021

I can try to open a PR later if I find the time. The main issue is to get rid of the kubectl proxy container to allow the job to complete. This requires to refactor the kubectl authentication slightly but not a big deal.

@trondhindenes
Copy link
Owner

yup, that should be easy enough - its realy not needed. I can do the auth refactoring first, if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants