Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currently No Way to Alter or Shorten the Fleet Name #11

Open
jacobmammoliti opened this issue Nov 22, 2024 · 0 comments · May be fixed by #12
Open

Currently No Way to Alter or Shorten the Fleet Name #11

jacobmammoliti opened this issue Nov 22, 2024 · 0 comments · May be fixed by #12

Comments

@jacobmammoliti
Copy link

jacobmammoliti commented Nov 22, 2024

There does not seem to be a way to alter or shorten the Fleet name which causes issues with character lengths and RFC 1035. Given this ApplicationSet:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: ingress-nginx
  namespace: argocd
spec:
  generators:
  - plugin:
      configMapRef:
        name: argocd-fleet-sync
      input:
        parameters:
          fleetProjectNumber: "$FLEET_PROJECT_NUMBER"
          scopeID: "$TEAM_ID"
      requeueAfterSeconds: 10
  template:
    metadata:
      name: '{{ name }}-nginx'
    spec:
      project: default
      source:
        repoURL: https://kubernetes.github.io/ingress-nginx
        chart: ingress-nginx
        targetRevision: 4.11.3
      destination:
        server: '{{ server }}'
        namespace: ingress-nginx
      syncPolicy:
        syncOptions:
          - CreateNamespace=true

The only way to have unique ArgoCD Application name's is via the cluster's full fleet name ie. <gke_cluster_name>.global.<gcp_project_number>. This fails in cases where a Helm Chart uses the name in its template for Kubernetes objects as shown in this example below:

one or more objects failed to apply, reason: Service "non-production-application.global.772391010134-nginx-ingress-ng" is invalid: metadata.name: Invalid value: "non-production-application.global.772391010134-nginx-ingress-ng": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?'),Service "non-production-application.global.772391010134-nginx-ingress-ng-admission" is invalid: [metadata.name: Invalid value: "non-production-application.global.772391010134-nginx-ingress-ng-admission": must be no more than 63 characters, metadata.name: Invalid value: "non-production-application.global.772391010134-nginx-ingress-ng-admission": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')]

This also proves to be challenging if the GKE cluster has a long name given the 63 character limit on some objects.

@jacobmammoliti jacobmammoliti linked a pull request Nov 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant