1

I am applying the app-of-apps with Argo CD on my application deployments, where I have a directory with the applications definitions, and then a directory with resource definitions and a kustomization.yaml file. When a new version is released, all I do is run kustomize set image ... in a pipeline that will issue an autocommit and Argo will pick it up.

I currently have the following structure of files and it is repeated for other environments, like staging and dev.

deployments
├── production
│   ├── app-1
│   │   ├── kustomization.yaml
|   |   └── deployment.yaml
│   ├── app-2
│   │   ├── kustomization.yaml
|   |   └── deployment.yaml
└───└── apps
        ├── app1.yaml
        └── app2.yaml 

I know decided to throw myself in the Helm world and create charts for each application with the required resource definitions. Then, in each environment folder I will keep an appropriate values.yaml file to override the proper values for each environment application deployment.

I would like to have the same flow as before, where the pipeline updates the new image tag (this time in the values.yaml file), creates the autocommit and Argo will sync it.

Is it possible to somehow do a kustomize set image... in each of the values.yaml file accordingly? Or what would be a smarter approach here?

everspader
  • 1,272
  • 14
  • 44

2 Answers2

1

In my case, I implemented a simple github action that fix 'yaml' format file in another repo then commit it.

I have two kinds of github repositories, the one is for application development and the other for storing k8s manifests which app-of-apps pattern is applied.

There is a github action for CI/CD in my development repository triggered when dev branches are merged to the 'main'.

It build new docker image and publish it to Docker hub(or AWS ECR) with version tag, then update values.yaml with the tag in k8s manifests repository helm chart via another github action ('fix-yaml-in-another-repo')

Jun H. Cha
  • 11
  • 3
-1

Step 1:

- name: image-tag
  value: "{{ .Values.image_tag }}"

Step 2:

# kustomize helmfile -i values.
Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109