Git Product home page Git Product logo

Comments (8)

dgoodwin avatar dgoodwin commented on July 30, 2024 3

I'm on board with just reporting the problem. Logs are good but some users may miss that when they're not getting the apps they expect, we could also however add a condition in ApplicationSet Status showing the issues encountered in reconciling which should help put it in-front of them where they would be likely to find it.

from applicationset.

mgoodness avatar mgoodness commented on July 30, 2024 2

Agree that we need to address the application name & label length issue, but I'd like to do it in such away that end-users (like me) can still provide their own templates for naming:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: cluster-services-internal-ingress-nginx
  namespace: argocd
spec:
  generators:
    - clusters:
        selector:
          matchExpressions: [...]
  template:
    metadata:
      labels:
        app: internal-ingress-nginx
        cluster: '{{metadata.labels.cluster}}'
        env: '{{metadata.labels.env}}'
        org: '{{metadata.labels.org}}'
        region: '{{metadata.labels.region}}'
      name: 'cluster-services-iin-{{metadata.labels.org}}-{{metadata.labels.env}}-{{metadata.labels.region}}-{{metadata.labels.cluster}}'
      namespace: argocd
    spec: {...}

Note that I'd love to do something like '{{appset.name}}-{{metadata.labels.org}}-{{metadata.labels.env}}-{{metadata.labels.region}}-{{metadata.labels.cluster}}', but in this case had to truncate -internal-ingress-nginx to -iin because a number of my generated applications names would exceed the 63-character limit for labels.

from applicationset.

dgoodwin avatar dgoodwin commented on July 30, 2024

A proposal for discussion:

Assume we start with base name of {appsetname}-{generatoritemname}.

All generators would be required to provide some kind of a name for each matching Application. For clusters we could use the cluster name. For git discovery probably the matching folder name. For git files we require a name property in each list row. And similar for the ApplicationSet inline list items.

We use that full concatenated name if it's not too long, and if it is we fall back to something like this, which is how we solved this problem in one of my team's projects: https://github.com/openshift/hive/blob/master/pkg/apis/helpers/namer.go#L15

from applicationset.

dgoodwin avatar dgoodwin commented on July 30, 2024

I discovered the cluster generator was using the Secret name for the "name" templating, which can be quite long. (i.e. cluster-api.mycluster.mydomain.openshift.com-3927666468). I've opened #41 to fix this to use the name Argo has instead and that will help avoid this problem.

However it still is going to be quite possible to hit depending on the kubeconfig context name and template name.

from applicationset.

mgoodness avatar mgoodness commented on July 30, 2024

I discovered the cluster generator was using the Secret name for the "name" templating, which can be quite long. (i.e. cluster-api.mycluster.mydomain.openshift.com-3927666468). I've opened #41 to fix this to use the name Argo has instead and that will help avoid this problem.

My environment is exactly the opposite, with most Secret names being considerably shorter than the contexts. I know there's other work being done around cluster naming, though, so this strikes me as a reasonable change.

from applicationset.

dgoodwin avatar dgoodwin commented on July 30, 2024

Can't decide if there's anything we need to fix here, the name is in control of your applicationset, and what params you want to use. Should we leave it to users to manage the length limit? Or do we need to provide some protection from the easy to hit scenario where the name comes out too long?

from applicationset.

mgoodness avatar mgoodness commented on July 30, 2024

My inclination is to let users manage the length, but log if the rendered name exceeds 63 characters and is therefore unusable.

from applicationset.

mgoodness avatar mgoodness commented on July 30, 2024

Oh yeah, I like that!

from applicationset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.