Skip to content

Unable to install Argo CD Helm Chart with long release name (and metrics enabled) #3840

@bhampl

Description

@bhampl

Describe the bug

When installing the Argo CD Helm Chart with a long release name (Helm allows release names up to 53 characters), the installations fails, as the Helm Chart templates produce Kubernetes objects with non-unique names, as names are truncated.
This is especially noticeable when enabling the metrics of the various components (i.e. <component>.metrics.enabled=true), as this creates services with -metrics suffixes leading to additional must be no more than 63 characters errors.

Related helm chart

argo-cd

Helm chart version

9.5.2

To Reproduce

  1. Run helm install "$(printf '%.0sa' {1..53})" argo-cd --repo https://argoproj.github.io/argo-helm --version 9.5.2 --namespace argocd --create-namespace
  2. See the following errors:
Error: INSTALLATION FAILED: 5 errors occurred:
	* serviceaccounts "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re" already exists
	* roles.rbac.authorization.k8s.io "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re" already exists
	* rolebindings.rbac.authorization.k8s.io "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re" already exists
	* services "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re" already exists
	* deployments.apps "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re" already exists

When metrics are enabled then there are even more errors:

  1. Create a values.yaml which enables the metrics services:
values.yaml content (minimal example)
redis:
  metrics:
    enabled: true
server:
  metrics:
    enabled: true
repoServer:
  metrics:
    enabled: true
applicationSet:
  metrics:
    enabled: true
notifications:
  metrics:
    enabled: true
  1. Run helm install "$(printf '%.0sa' {1..53})" argo-cd --repo https://argoproj.github.io/argo-helm --version 9.5.2 --namespace argocd -f ./values.yaml --create-namespace
  2. See the following errors:
Error: INSTALLATION FAILED: 10 errors occurred:
	* serviceaccounts "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re" already exists
	* roles.rbac.authorization.k8s.io "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re" already exists
	* rolebindings.rbac.authorization.k8s.io "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re" already exists
	* Service "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re-metrics" is invalid: metadata.name: Invalid value: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re-metrics": must be no more than 63 characters
	* Service "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-se-metrics" is invalid: metadata.name: Invalid value: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-se-metrics": must be no more than 63 characters
	* Service "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-ap-metrics" is invalid: metadata.name: Invalid value: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-ap-metrics": must be no more than 63 characters
	* Service "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re-metrics" is invalid: metadata.name: Invalid value: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re-metrics": must be no more than 63 characters
	* Service "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-no-metrics" is invalid: metadata.name: Invalid value: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-no-metrics": must be no more than 63 characters
	* services "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re" already exists
	* deployments.apps "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-argocd-re" already exists

Expected behavior

No error is displayed and the Kubernetes objects are created successfully.

Screenshots

No response

Additional context

Similar to #1328

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