zalando / zalando/postgres-operator
Specifying wild card label keys for inherited labels?
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.2k
- Forks
- 1.1k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 3
Description
- Operator image:
registry.opensource.zalan.do/acid/postgres-operator:v1.10.1 - Kubernetes deployment type: On-premise Kubernetes cluster running on vSphere infrastructure. Kubernetes version:
1.26.2 - Running Postgres Operator in production? Yes
- Type of issue: Feature request/question
I have label policies in place for applications running on Kubernetes. Our label keys comprise the application name, followed by a domain. For example:
labels:
app1.acme.com/app: app1
app1.acme.com/component: database
And so on.
I need to apply these labels to my PostgreSQL cluster pods as well.
Since the Postgres Operator serves multiple applications and each has its label keys, I need a dynamic method to populate these labels to each application. However, the Postgres Operator Helm chart requires a defined set of inherited labels:
https://github.com/zalando/postgres-operator/blob/master/charts/postgres-operator/values.yaml#L149
For this to work, I need to explicitly specify each label under inherited_labels every time I onboard a new application, which is annoying and tedious. Therefore, it would be great if I could specify a wild card for the label keys, For example: *.acme.com/*.
I've noticed that the downscaler_annotations parameter accepts regular expressions. It would be great if inherited_labels accepted them as well.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with charts/postgres-operator/values.yaml at the inherited_labels setting and compare its configuration with the downscaler_annotations parameter, which already accepts regular expressions. Determine how the proposed .acme.com/ pattern should be interpreted and verify that matching labels are applied to PostgreSQL cluster pods.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, helm, kubernetes, postgresql
- Domain
- databases, devops
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100