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

Migrate job not showing up in ArgoCD #107

Open
supercairos opened this issue Feb 22, 2024 · 2 comments
Open

Migrate job not showing up in ArgoCD #107

supercairos opened this issue Feb 22, 2024 · 2 comments

Comments

@supercairos
Copy link

There is an issue with OpenFGA helm chart when it's used with ArgoCD.

Migrate job doesn't show up on ArgoCD and is not created by ArgoCD.

This is due to the default helm hooks in place in the migrate job defined in the default values.yaml of this helm charts:
https://github.com/openfga/helm-charts/blob/main/charts/openfga/values.yaml#L269-L271

migrate:
  annotations:
    helm.sh/hook: "post-install, post-upgrade, post-rollback, post-delete"
    helm.sh/hook-weight: "-5"
    helm.sh/hook-delete-policy: "before-hook-creation"

The current workaround is to disable them like this in one of your child charts:

migrate:
  annotations:
    helm.sh/hook: null
    helm.sh/hook-weight: null
    helm.sh/hook-delete-policy: null

Could we remove them ?

@supercairos
Copy link
Author

supercairos commented Feb 22, 2024

It seams that ArgoCD doesn't understand post-rollback. Removing it should fix the issue:

migrate:
  annotations:
    helm.sh/hook: "post-install, post-upgrade, post-delete"

See here:
https://argo-cd.readthedocs.io/en/stable/user-guide/helm/#helm-hooks

@nikonet
Copy link

nikonet commented May 3, 2024

Hello.

I found a way to make this work using ArgoCD's built-in sync waves.

I use Helm in Kustomize like this:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: openfga

helmCharts:
- name: openfga
  repo: https://openfga.github.io/helm-charts
  version: 0.2.3
  releaseName: openfga
  namespace: openfga
  valuesFile: values.yaml

And the full helm values:

replicaCount: 1

datastore:
  engine: postgres
  uriSecret: pg-uri
  
serviceAccount: # Requires existing before the migrations job
  annotations:
    argocd.argoproj.io/hook: PreSync
    argocd.argoproj.io/sync-wave: "-2"

migrate:
  annotations:
    argocd.argoproj.io/hook: PreSync
    argocd.argoproj.io/sync-wave: "-1"

For reference I'm using CNPG (postgres 14.11) as postgres operator and external-secrets-operator to create a shared secret for the pg username, password and uri.

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