Missing labels
christophe-f opened this issue · comments
What do you want to improve?
Would like to be able to set labels.
What is the current behavior?
What is the new behavior?
@christophe-f I believe the upstream backstage chart already provides the ability to apply common labels:
https://github.com/backstage/charts/blob/f50465f9907f639fcbc4c99a5c197fdaf8f92bbd/charts/backstage/values.yaml#L32-L33
Which can be found in the janus helm chart at upstream.properties.commonLabels
which should apply the labels to all the deployed objects. From testing, it appears that only the following resources get the label applied to them:
- The backstage deployment (not the pods or postgres resources)
- The backstage route
- The backstage ingress
- The backstage service (Not the postgres service)
- The backstage service monitor
helm-backstage/charts/backstage/values.schema.json
Lines 4044 to 4051 in 417057a
We can also use the upstream.properties.backstage.properties.podLabels
field in the values.yaml to include the labels for the backstage deployment's pods (The deployment itself doesn't get this label, only the pods do):
helm-backstage/charts/backstage/values.schema.json
Lines 3732 to 3739 in 417057a
So to get labels on BOTH the backstage deployment and the backstage deployment's pods, the end user will need to apply both.
Currently it doesn't seem there's a way to apply labels via the helm chart for the other resources (ex: postgres stateful set, route resources, service resources, etc.)
Additionally, neither of these values are visible in the Form view on openshift, so it would require the end-user to directly modify the values.yaml
via the YAML view.
What is the acceptance criteria for this issue? What resources do we want to be able to set labels for in the helm chart?
It appears that the backstage upstream chart uses a bitnami postgreSQL chart which appears to also have a commonLabel
field. However, when I put the commonLabel
in the values.yaml:
upstream:
nameOverride: backstage
backstage:
# backstage configs
commonLabels:
test: label
postgresql:
# postgresql configs
Only the backstage resources (excluding pods) get the commonLabels
labels, while the postgresql resources do not for some reason, despite the postgresql chart also uses the commonLabels
values when creating labels for its resources
Only the backstage resources (excluding pods) get the commonLabels labels, while the postgresql resources do not for some reason, despite the postgresql chart also uses the commonLabels values when creating labels for its resources
I think this is expected. The values are not inherited into nested Charts like this.
To set labels for postgresql
you need to put commonLabels
to postgresql
section.
upstream:
nameOverride: backstage
backstage:
# backstage configs
commonLabels:
test: label
postgresql:
commonLabels:
test: label
# postgresql configs
This issue stemmed from an EAP customer asking for the ability to add labels to the pods in the backstage deployment. This issue occurred to them when the dependency for the upstream backstage chart used v1.1.2
of the upstream chart. (Approximately around the time the janus-idp chart was v2.2.0
).
The podLabels
configuration that fixes this issue were added into the upstream chart in backstage helm chart v1.1.3
via this pull request.
Since the current upstream backstage chart dependency is v1.2.0
, this issue is resolved.