You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current kustomize application source only allows the default configuration of adding common labels, which applies said labels to object metadata, spec.selector, and spec.template.metadata. Kustomize provides configuration options to label resources without labeling the selector or template. See official documentation. Argocd should have some capability to ignore selectors/templates with commonLabels in its Kustomize application source.
Motivation
My company deploys >550 applications. If we want to add a common label to appsets for identification purposes with argocd, it also modifies the selectors, which are oftentimes immutable fields. This means for every label addition to our appsets, we would have to delete and resync hundreds of application resources. We would like a simple way to add common labels to our application resources for identification, without the overhead that comes with modifying the resource selectors.
Proposal
Kustomize command line implements the documented feature with the following:
kustomize edit add label --help
Adds one or more commonLabels to kustomization.yaml
Usage:
kustomize edit add label [flags]
Examples:
add label {labelKey1:labelValue1} {labelKey2:labelValue2}
Flags:
-f, --force overwrite commonLabel if it already exists
-h, --help help for label
--without-selector using add labels without selector option
Global Flags:
--stack-trace print a stack-trace on error
Because argocd builds kustomize through the commandline, I would like to add a boolean option to the application and applicationset template sources named labelWithoutSelector.
I would also like to be the one to contribute to this, as this would be my first time contributing to open source. (I have already made the said changes and tests on a local branch to see how easy it would be)
Example of what the application manifest would look like:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: example
namespace: example
spec:
project: example
source:
repoURL: git@github.example.com:example/example
targetRevision: main
path: example
kustomize:
commonLabels:
foo: bar
labelWithoutSelector: true
destination:
name: example
namespace: example
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
The text was updated successfully, but these errors were encountered:
It appears that the Kustomize CLI has not yet been updated to utilize the new label API. The only instance where it incorporates this API is when the --without-selector argument is included. For Argo to effectively utilize kustomize edit add label and fully integrate the new label API, further development of the Kustomize CLI is required - that is, without completely changing how the kustomize source builds the application.
Summary
Current kustomize application source only allows the default configuration of adding common labels, which applies said labels to object metadata, spec.selector, and spec.template.metadata. Kustomize provides configuration options to label resources without labeling the selector or template. See official documentation. Argocd should have some capability to ignore selectors/templates with commonLabels in its Kustomize application source.
Motivation
My company deploys >550 applications. If we want to add a common label to appsets for identification purposes with argocd, it also modifies the selectors, which are oftentimes immutable fields. This means for every label addition to our appsets, we would have to delete and resync hundreds of application resources. We would like a simple way to add common labels to our application resources for identification, without the overhead that comes with modifying the resource selectors.
Proposal
Kustomize command line implements the documented feature with the following:
Because argocd builds kustomize through the commandline, I would like to add a boolean option to the application and applicationset template sources named
labelWithoutSelector
.I would also like to be the one to contribute to this, as this would be my first time contributing to open source. (I have already made the said changes and tests on a local branch to see how easy it would be)
Example of what the application manifest would look like:
The text was updated successfully, but these errors were encountered: