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

Common objet labels and annotations #311

Open
fernandezcuesta opened this issue Nov 13, 2024 · 0 comments
Open

Common objet labels and annotations #311

fernandezcuesta opened this issue Nov 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@fernandezcuesta
Copy link

fernandezcuesta commented Nov 13, 2024

What problem are you facing?

As a end user, I want to inject labels to all crossplane-managed resources. When using provider-kubernetes I might want to add labels or annotations to all resulting resources from Objects, so that its metadata would end up like:

apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/managed-by: crossplane
    foo: bar
  namespace: default
  name: foo

When creating an Object like:

---
apiVersion: kubernetes.crossplane.io/v1alpha2
kind: Object
metadata:
  name: foo
spec:
  forProvider:
    manifest:
      apiVersion: v1
      kind: ConfigMap
      metadata:
        labels:
          foo: bar
        namespace: default
        name: foo

How could Crossplane help solve your problem?

I feel this should come directly from the ProviderConfig, e.g. under spec.commonLabels or by adding a new kind ObjectTemplate where we could set the skeleton of an Object (mainly metadata annotations and labels) from which all resulting Objects would merge.
Additionally a selector field could help selecting which Objects we want to alter.

apiVersion: kubernetes.crossplane.io/v1alpha2
kind: ObjectTemplate
metadata:
  name: common
spec:
  selector: {} # applies to all Objects
  commonLabels:
    app.kubernetes.io/managed-by: crossplane
@fernandezcuesta fernandezcuesta added the enhancement New feature or request label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant