Skip to content

Support for custom labels and annotations for resources deployed via karmada-operator (Kind: Karmada) #6355

@spolspol

Description

@spolspol

Feature Request: Propagate Labels Defined in Karmada Resource to All Operator-Managed Resources

What would you like to be added:

Currently, the labels block defined within the Kind: Karmada resource only applies labels to Deployment resources. This means that when specifying custom labels within the karmadaAPIServer configuration, such as:

karmadaAPIServer:
  imagePullPolicy: IfNotPresent
  imageRepository: registry.k8s.io/kube-apiserver
  imageTag: v1.31.3
  labels:
    argocd.argoproj.io/instance: karmada

Only the Deployment for the Karmada API server will receive the argocd.argoproj.io/instance: karmada label. Other resources deployed by the Karmada operator, including (but not limited to) RBAC resources, Services, Endpoints, and Secrets, do not inherit these labels. This is due to a limitation in the Karmada CRD where label propagation is not implemented for these other managed resources.

This feature request proposes extending the functionality to allow the specified labels in the Kind: Karmada resource to be applied to all resources managed by the Karmada operator.

Why is this needed:

The ability to apply custom labels consistently across all resources managed by the Karmada operator is crucial for several use cases. The core requirement is to enable users to label and annotate all Kubernetes resources without arbitrary restrictions.

A primary use case is the integration with tools like ArgoCD. By applying specific labels (and potentially annotations) to all resources managed by the Karmada operator, users can accurately track these resources within the ArgoCD application's resource tree. This ensures proper visualization, monitoring, and management of the entire Karmada ecosystem within ArgoCD, streamlining operations and improving observability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions