Skip to content

ArgoCD OutOfSync when using Gateway API #3538

@adambkaplan

Description

@adambkaplan

Describe the bug

When managing ArgoCD with ArgoCD (Application referencing the helm chart), the Application remains OutOfSync due to the defaulting behavior of the Gateway APIs.

Root cause is a diff in the backend refs - missing the following:

  backendRefs:
    - group: ''
      kind: Service

Workaround: add the following ignoreDifferences to the Application yaml:

  ignoreDifferences:
    - group: gateway.networking.k8s.io
      kind: HTTPRoute
      jsonPointers:
        - /spec/rules/0/backendRefs/0/group
        - /spec/rules/0/backendRefs/0/kind

Related helm chart

argo-cd

Helm chart version

8.6.3

To Reproduce

  1. Install ArgoCD on the cluster using the Helm chart.

    helm install argo-cd oci://ghcr.io/argoproj/argo-helm/argo-cd \
     	--version 8.6.3 \
     	--namespace argo-cd \
     	--create-namespace
  2. Install the Gateway APIs (can be done with an ArgoCD Application!)

    apiVersion: argoproj.io/v1alpha1
    kind: Application
    metadata:
      finalizers:
        - resources-finalizer.argocd.argoproj.io
      name: gateway-api
      namespace: argo-cd
    spec:
      destination:
       server: https://kubernetes.default.svc
       project: default
     source:
       path: config/crd
       repoURL: https://github.com/kubernetes-sigs/gateway-api
       targetRevision: v1.4.0
     syncPolicy:
       automated:
         prune: true
         selfHeal: true
       syncOptions:
         - CreateNamespace=true
         - PrunePropagationPolicy=foreground
         - PruneLast=true
         - ServerSideApply=true
  3. Add an Application that takes over the management of ArgoCD's deployment:

    apiVersion: argoproj.io/v1alpha1
    kind: Application
    metadata:
      finalizers:
        - resources-finalizer.argocd.argoproj.io
      name: argo-cd
      namespace: argo-cd
    spec:
      destination:
        namespace: argo-cd
        server: https://kubernetes.default.svc
      project: default
      source:
        helm:
          valuesObject:
            configs:
              params:
                server.insecure: true
            global:
              domain: argo-cd.k8s.local
            server:
              httproute:
                enabled: true
                hostnames:
                  - argo-cd.k8s.local
                parentRefs:
                  # Note: this is a gateway I created for the above domain
                  - group: gateway.networking.k8s.io
                    kind: Gateway
                    name: central-gateway
                    namespace: central-gateway
                    sectionName: https-wildcard
        path: .
        repoURL: oci://ghcr.io/argoproj/argo-helm/argo-cd
        targetRevision: 8.6.3
      syncPolicy:
        automated:
          prune: true
          selfHeal: true
        syncOptions:
        - CreateNamespace=true
        - PrunePropagationPolicy=foreground
        - PruneLast=true
        - ServerSideApply=true
    

Expected behavior

ArgoCD deploys the helm chart and is able to successfully sync.

Screenshots

Image

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    argo-cdbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions