6

I am developing an ETL pipeline using Argo Workflows, and in order to handle environment related configurations, I am using Kustomize.

Here is the base/cronworkflow.yaml file

apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
  name: cronworkflow
spec:
  concurrencyPolicy: Forbid
  failedJobsHistoryLimit: 3
  successfulJobsHistoryLimit: 3
  startingDeadlineSeconds: 300
  workflowSpec:
    entrypoint: start
    templates:
    - name: start
      container:
        name: my-start-task
        image: app-image
        command:
          - /bin/sh
          - -xec
          - |
            ./entrypoint.sh
        env:
          - name: AWS_ACCESS_KEY_ID
            valueFrom:
              secretKeyRef:
                name: aws-creds
                key: access-key

Kustomize doesn't seem to work well when using patchesStrategicMerge, because it can only deal (out of the box at least) only with standard k8s kinds. With 3rd party kinds, it will simply overwrite the entire tree structure instead of trying to merge.

I had to use patchesJson6902 on the yaml file defining my Argo CronWorkflow, but now the images transformer doesn't seem to work anymore.

Am I missing something? Is there a convenient way to fix the behavior of patchesStrategicMerge? Are argo workflows "type definitions" for Kustomize available somewhere?

Vektor88
  • 163
  • 1
  • 5

1 Answers1

8

Kustomize offers a way to "hint" where to find image tags.

Add a file called kustomconfig.yaml:

images:
- path: spec/templates[]/container/image
  kind: WorkflowTemplate
- path: spec/templates[]/script/image
  kind: WorkflowTemplate

Add the following to your kustomization.yaml:

configurations:
- kustomconfig.yaml

You're done. The images transformer will pick up those fields.

Chris Jones
  • 103
  • 3
crenshaw-dev
  • 196
  • 3