murtiko
murtiko

Reputation: 273

ArgoCD does not install helm chart dependencies

I am struggling to install a helm chart which has dependencies using ArgoCD.

I can install the helm chart without any issues using helm install ....

But it seems like ArgoCD just ignores the dependency of the helm chart completely.

I have searched for this a lot, but nobody seems to have an issue (unless a condition is used for dependency, which i am not using).

Some more details:

This is the Chart.yaml of the base chart (that i depend on):

apiVersion: "v2"
name: "base-chart"
version: "1.0.0"
appVersion: "1.0.0"

This is the Chart.yaml of the actual chart:

apiVersion: "v2"
name: "app-chart"
version: "1.0.1"
appVersion: "1.0.1"
dependencies:
- name: "base-chart"
  version: "1.0.0"
  repository: "https://<my-private-repo>/repository/<repo>"
  alias: "base"

This is the argocd application manifest:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: myapp
  namespace: argocd
  labels:
    name: myapp
  annotations:
    argocd.argoproj.io/sync-wave: "1"
spec:
  project: default

  sources:
    - repoURL: https://<mynexus.com>/repository/<repo>/
      targetRevision: 1.0.1
      chart: app-chart

  destination:
    server: https://kubernetes.default.svc
    namespace: myapp

Here are the details of the argocd installation:

[root@kubernetes1 mydir]# argocd version
argocd: v2.12.1+26b2039
  BuildDate: 2024-08-16T17:01:06Z
  GitCommit: 26b2039a55b9bdf807a70d344af8ade5171d3d39
  GitTreeState: clean
  GoVersion: go1.22.6
  Compiler: gc
  Platform: linux/amd64
argocd-server: v2.12.1+26b2039
  BuildDate: 2024-08-16T16:42:13Z
  GitCommit: 26b2039a55b9bdf807a70d344af8ade5171d3d39
  GitTreeState: clean
  GoVersion: go1.22.4
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v5.4.2 2024-05-22T15:19:38Z
  Helm Version: v3.15.2+g1a500d5
  Kubectl Version: v0.29.6
  Jsonnet Version: v0.20.0

I could not find any related error messages on argocd application-server and repo-server logs or on the argocd ui. The application syncs correctly and appears in sync. However the resources from the dependent chart are nowhere to be found.

Appreciate any help or pointers. I am really stuck.

I am new to argocd, but feel like this should be one of the most basic scenarios, i mean to install a helm chart (with dependencies), no?

Upvotes: 0

Views: 1315

Answers (2)

murtiko
murtiko

Reputation: 273

The problem was caused by a .helmignore file on the app chart which caused resources from the base chart to be completely ignored :(

The problem has obviously nothing to do with argocd, it can deploy charts with dependencies without any issues, even if those charts have helm hooks (that are supported by argocd).

Make sure to check .helmignore files if you encounter similar issues.

Upvotes: 0

Delta George
Delta George

Reputation: 4216

Try adding this hook to the application resource:

    syncPolicy:
      automated:
        prune: true
        selfHeal: true
      hooks:
        - type: PostSync
          command: ["helm"]
          args: ["dependency", "update"]

Upvotes: 1

Related Questions