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

[Feature] Inherit MariaDB labels #82

Closed
AlcaYezzz opened this issue Apr 5, 2023 · 4 comments
Closed

[Feature] Inherit MariaDB labels #82

AlcaYezzz opened this issue Apr 5, 2023 · 4 comments
Assignees
Labels
feature priority-short-term To be resolved in the short term

Comments

@AlcaYezzz
Copy link

Is your feature request related to a problem? Please describe.

Our infrastructure rely on some k8s label where we expect specific values :

  • app.kubernetes.io/component
  • app.kubernetes.io/instance
  • app.kubernetes.io/name
  • app.kubernetes.io/version

Describe the solution you'd like
We'd like to be able to override the label set by mariadb-operator with some custom label.
One way to do this would be to inherit label from mariadb-operator manifest inside child objects (statefulset, pods, ...)

Something like:

apiVersion: mariadb.mmontes.io/v1alpha1
kind: MariaDB
metadata:
  name: mariadb
  labels:
    app.kubernetes.io/component: mycomponent
    app.kubernetes.io/instance: myinstance
    app.kubernetes.io/name: myname
    app.kubernetes.io/version: 1.0.0

Would create a statefulset and the associated pods with the same labels

Potentially, a configuration, to specify the labels where we seek inheritance could allow backward compatibility.

Something like the configuration done by zalando with their postgres operator:

inherited_labels list of label keys that can be inherited from the cluster manifest, and added to each child objects (Deployment, StatefulSet, Pod, PVCs, PDB, Service, Endpoints and Secrets) created by the operator. Typical use case is to dynamically pass labels that are specific to a given Postgres cluster, in order to implement NetworkPolicy. The default is empty.

https://opensource.zalando.com/postgres-operator/docs/reference/operator_parameters.html

@mmontes11 mmontes11 added the priority-short-term To be resolved in the short term label Apr 5, 2023
@mmontes11
Copy link
Member

mmontes11 commented Apr 5, 2023

Hey @AlcaYezzz !

This is definetly something missing in mariadb-operator, it will be implemented as part of the next release. Stay tuned for the v0.0.12 release 🚀

Contributions are welcome! Take a look at the statefulset and labels builders if you would like to work on this, it shouldn't be too hard:

Thanks for reporting this 🙏🏻

@mmontes11 mmontes11 changed the title [Feature] Custom label [Feature] Inherit MariaDB labels Apr 14, 2023
@mmontes11
Copy link
Member

Hey @AlcaYezzz , this has been implemented in the following PR:

It will be released in the v0.0.12, stay tuned! 🚀

@Kazyini
Copy link

Kazyini commented Sep 18, 2023

Was this never published? No labels are set for me. In the example config is also no more? To find: https://github.com/mariadb-operator/mariadb-operator/blob/main/examples/manifests/mariadb_v1alpha1_mariadb.yaml

@mmontes11
Copy link
Member

@Kazyini Yes it has, have you tried this?:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature priority-short-term To be resolved in the short term
Projects
None yet
Development

No branches or pull requests

3 participants