helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

[Feature Request] Support ArgoCD deployments

Open stephen-harris opened this issue 7 months ago • 2 comments

Is your feature request related to a problem? Please describe.

We deploy our manifests using ArgoCD and it fails when we make a change to the Job's pod specification (e.g. the secrets being mounted, the environment variables set or image version) as by default ArgoCD uses apply and due to how Temporal's helm chart configures the schema job name, the job name is static and not configurable.

Temoporal's helm template assumes it is being deployed in the context of a helm release with the job name based on the release revision: (https://github.com/temporalio/helm-charts/blob/c05acfe50c33f18942b4c3aaad748a2866323a37/charts/temporal/templates/server-job.yaml#L13), but outside of that context the job name remains at '-1'. As jobs are immutable subsequent changes to the job template will fail.

Describe the solution you'd like

There are two options I can think of:

  • Allow annotations to be added to the job spec. This allows us to instruct ArgoCD via annotations to replace the resource rather than apply updates. I've raised a PR for this option here: https://github.com/temporalio/helm-charts/pull/665
  • Alternatively, make the job name configurable / over-ridable. This is slightly less ideal, but if we can manually 'bump' the job name, that will allow us to work around this issue.

Additional context

stephen-harris avatar Jun 02 '25 10:06 stephen-harris

I'm running into this issue as well - have to manually drop the schema-1 job each time I need to upgrade, etc.

Other possible considerations:

  • Potentially add usage of helm-hooks that define it as pre-install or pre-sync (ArgoCD runs all at once, fyi), and another to remove the job pre-sync;
  • explore usage of 'generateName' ?

cedson avatar Sep 05 '25 23:09 cedson

as a hack workaround could we use a pre-sync hook that deletes the existing schema job before the sync tries to re-create it? I believe this would be idempotent since it doesn't actually touch anything inside the db

apiVersion: batch/v1
kind: Job
metadata:
  generateName: temporal-schema-cleanup-
  namespace: temporal
  annotations:
    argocd.argoproj.io/hook: PreSync
    argocd.argoproj.io/hook-delete-policy: HookSucceeded
spec:
  ttlSecondsAfterFinished: 120
  template:
    spec:
      serviceAccountName: argocd-temporal-cleanup  # Needs RBAC
      restartPolicy: Never
      containers:
      - name: cleanup
        image: bitnami/kubectl:latest
        command:
        - /bin/sh
        - -c
        - |
          kubectl delete job -n temporal \
            -l app.kubernetes.io/component=schema \
            --ignore-not-found=true
          # Or specifically: kubectl delete job temporal-schema-1 --ignore-not-found=true```

jmooo avatar Oct 22 '25 23:10 jmooo