Skip to content

cluster-addons application name duplication #78

@nikitad-fanatics

Description

@nikitad-fanatics

Description

I use hub and spoke topology setup for ArgoCD from this example https://github.com/gitops-bridge-dev/gitops-bridge/tree/main/argocd/iac/terraform/examples/eks/multi-cluster/hub-spoke-irsa.
There is an issue when a spoke cluster connected, cluster-addons application can not provision addons from appsets to a new destination.
I found error log in ApplicationSet Controller:

{"applicationset":{"Namespace":"argocd","Name":"cluster-addons"},"level":"error","msg":"validation error found during application validation: ApplicationSet cluster-addons contains applications with duplicate name: cluster-addons","time":""

ArgoCD version 2.14.

Question

  1. Is it a bug in an example and bootstrap appset cluster-addons should have dynamic generated name for application cluster-addons per spoke cluster?
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: cluster-addons
  namespace: argocd
spec:
  syncPolicy:
    preserveResourcesOnDeletion: true
  generators:
    - clusters:
        selector:
          matchExpressions:
            - key: akuity.io/argo-cd-cluster-name
              operator: NotIn
              values: [in-cluster]
  template:
    metadata:
      name: 'cluster-addons-{{name}}'
    spec:
      project: default
      source:
  1. I was able to fix it to instruct install cluster-addons application only for hub cluster. Is it the right solution?
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: cluster-addons
  namespace: argocd
spec:
  syncPolicy:
    preserveResourcesOnDeletion: true
  generators:
    - clusters:
   - clusters:
        selector:
          matchLabels:
            environment: control-plane

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions