-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Remove the Application spec.destination.name
field
#22436
Comments
I'd like to work on this. The CR changes seem straightforward. However, I’d love to get more details on the kind of UI enhancements you're looking for, as you mentioned in your message. Do you mean something like showing it with -o wide |
@sratslla CRD changes wouldn't be bad, but versioning the CRD (setting up conversion webhooks, writing docs, deprecation notices, etc.) would all be a lot of work. I'd like to start planning for all that though. After talking with my team, I think there's a decent case to be made for deleting |
Makes sense. I’d be interested in seeing the write-up once it’s done. In the meantime, I’ll do some research and put together some ideas as well. Then we can coordinate. |
We heavily use templating based on a standardized name field with app-of-apps where the remote cluster credentials are provided by a third party in a predictable manner (crossplane, cluster-api etc). We manage close to a hundred clusters in this way. The server URI only exists in the cluster secret at this time. |
@rouke-broersma that's fair... we could go the other direction and remove |
I prefer 'symbolic' names over 'technical' references. A consumer shouldn't necessarily need to know where the remote cluster lives, only how they can reference the correct credential to get there. Tbh if we're going to introduce a breaking change I would prefer to break away from string-typed matching with a secret that may or may not have been picked up and move to secretRef/parameterRef like a lot of the kubernetes ecosystem seems to be doing, but I can't judge how feasible that is for the argocd ecosystem. |
Yeah, I think a |
I'd also argue the opposite - remove |
I also selfishly would prefer |
+1 to keeping name, if we have to remove something I think it's the server that adds less value to the end user. It's harder to recognise the target cluster with the server url if they had a bunch of them with similar url pattern, where as the name can be easily customised according to user needs. |
I am in favor of removing If we were to remove one, it should definitely be |
Sounds like a consensus! What are everyone's feelings about having Advantages:
Disadvantages:
|
I wouldn't be opposed if the argo cd cli would create the secret with same name as the kube config / a cli argument. So a secret named
EDIT: that would mean that cluster names have to abide by RFC 1123. |
The one disadvantage I can think of is that when a secret is created imperatively the cluster secret has an auto-generated name like |
If the name of the secret and the cluster name are the same then it works fine but if they are different then it kind of introduces again 2 different identifiers that the users have to juggle, either we remove name as a separate id in the definition and just use the name of the secret as the cluster name or we don't care about the secret at all and just use the cluster name as we are doing rn. |
If the secret name is used as a reference directly I would preferably make it a more abstract reference so that multiple reference implementations may be added in the future: destination:
namespace: destinationTargetNamespace
clusterRef:
apiVersion: v1 # can be optional, default value, since it is most likely
kind: Secret # can be optional, default value, since it is most likely
name: secretName destination:
namespace: destinationTargetNamespace
clusterRef:
apiVersion: v1 # can be optional, default value, since it is most likely
kind: ConfigMap
name: cmName # for example if using federated login secret is not needed destination:
namespace: destinationTargetNamespace
clusterRef:
apiVersion: v1 # can be optional, default value, since it is most likely
kind: Secret
type: cluster.x-k8s.io/secret # Different providers may have different secret format, by supporting secret type specific implementations for specific providers could be added if needed. Contents should of course be normalized to argocd cluster secret by the specific cluster secret provider implementation so argocd core does not itself need knowledge of different formats.
name: secretName
namespace: secretNamespace destination:
namespace: destinationTargetNamespace
clusterRef:
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
name: clusterResourceName
namespace: clusterResourceNamespace
I think you may still want a human readable cluster name field, simply because people may refer to a cluster with a certain name, and the secret can for technical reasons need to have a different name. However only one of the two should be accepted as a reference, the other should be for display purposes only. I also think the Argocd UI should show both the secret name and the cluster name in the clusters UI, and make it clear that one of the two is display only. |
Yep, I think I'd want to settle on the resource name as the single canonical name for programmatic reference. Then we could use a |
@rouke-broersma rather than embedding arbitrary resource ref fields in the Application spec, I think I'd suggest building an ClusterSet controller to translate those arbitrary resources into Argo CD's cluster representation (whether a Secret or a CRD). It would better separate the platform concern (managing cluster resources) from the user concern (referencing some cluster destination). |
That also seems fine to me, main point is that if some component can do the translation to something argocd understands it would be more extensible to different cluster management tooling. |
Summary
We should remove the
name
field from the Application CRD'sspec.destination
field.Motivation
Having both a
name
and aserver
field has these downsides:Proposal
Remove the field and replace it with nice CLI and UI features to make it very easy for users to find the server URL for a given cluster name.
The text was updated successfully, but these errors were encountered: