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

cicd: backend migration actually requires external-secrets created in the step after #234

Open
davidcheung opened this issue Oct 13, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@davidcheung
Copy link
Contributor

davidcheung commented Oct 13, 2021

Note: On brand new build this doesnt happen, but can be a problem if people deploy one(staging) environment, do some development then go ahead and deploy their 2nd(prod) environment at a later date.

The existing flow for CI/CD pipeline deployment goes something like this

  1. build image
  2. check migration files
    2.1 if no migration files skip to deploy
    2.2 if there are migration files create migration job and waits for job to succeed
  3. deploy (kustomize apply overlay/)

On a brand new repo during ci/cd, when there's no migration file it works, But if the first time running one already has migration files, the k8s environment does not have secret for migration job to mount, which would be created from external-secrets during deploy step.

@davidcheung davidcheung added the bug Something isn't working label Oct 13, 2021
@davidcheung
Copy link
Contributor Author

basically the same reason as commitdev/zero-backend-go#72

@deven96
Copy link
Contributor

deven96 commented Oct 23, 2021

How would you suggest going about it @davidcheung ?
If there are migration files but no k8s secret, then we deploy first and migrate after?

@davidcheung
Copy link
Contributor Author

@deven96 Thanks so much!
I think the solution could be applying the external secret manifest before the deployments,
so it can deploy pre-requisites(kustomize) -> run migration -> deploy application(kustomize) then I think it should work in all scenarios
but separating the kustomize in 2 steps would increase some complexity, not sure if there's a better way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Up Next
Development

No branches or pull requests

2 participants