Skip to content

argocd fails to deploy #1125

@vish6760

Description

@vish6760

Describe the bug

  1. Namespace creation order problem -Helm sends all manifests from the post-renderer to the Kubernetes API in a single batch. The Namespace object from namespace.yaml is applied at the same time as other namespaced resources, so the namespace does not exist yet when those resources are created.
  2. all.yaml is not referenced in kustomization.yaml (only namespace.yaml is), so Helm will be deploying only the chart’s default manifests without the intended overrides.

To Reproduce
Steps to reproduce the behavior:

  1. Run install-argocd.sh

Expected behavior
Helm deploys the argocd chart.

Server (please complete the following information):

  • Ubuntu 22.04

Additional context

# /opt/genestack/bin/install-argocd.sh
Executing Helm command:
helm upgrade --install argocd oci://registry-1.docker.io/bitnamicharts/argo-cd     --namespace=argocd     --timeout 120m     --post-renderer /etc/genestack/kustomize/kustomize.sh     --post-renderer-args argocd/base     -f /opt/genestack/base-helm-configs/argocd/helm-argocd-overrides.yaml
Release "argocd" does not exist. Installing it now.
Pulled: registry-1.docker.io/bitnamicharts/argo-cd:10.0.0
Digest: sha256:f98d705cf4983d6635fa0fc63c88e8fb8b7fda8ae2d3e01ee8536649a1c7939e
Error: create: failed to create: namespaces "argocd" not found

Existing contents of install-argocd.sh.

# cat /opt/genestack/bin/install-argocd.sh
#!/bin/bash

# Default parameter value
TARGET=${1:-base}

# Directory to check for YAML files
CONFIG_DIR="/etc/genestack/helm-configs/argocd"

# Helm command setup
HELM_CMD="helm upgrade --install argocd oci://registry-1.docker.io/bitnamicharts/argo-cd \
    --namespace=argocd \
    --timeout 120m \
    --post-renderer /etc/genestack/kustomize/kustomize.sh \
    --post-renderer-args argocd/${TARGET} \
    -f /opt/genestack/base-helm-configs/argocd/helm-argocd-overrides.yaml"

# Check if YAML files exist in the specified directory
if compgen -G "${CONFIG_DIR}/*.yaml" > /dev/null; then
    # Add all YAML files from the directory to the helm command
    for yaml_file in "${CONFIG_DIR}"/*.yaml; do
        HELM_CMD+=" -f ${yaml_file}"
    done
fi

# Run the helm command
echo "Executing Helm command:"
echo "${HELM_CMD}"
eval "${HELM_CMD}"

Existing kustomization.yaml configuration for argocd.

# cat /opt/genestack/base-kustomize/argocd/base/kustomization.yaml
sortOptions:
  order: fifo
resources:
  - namespace.yaml

namespace: argocd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions