janus-idp / helm-backstage

Helm Chart for Deploying Backstage. This repo is deprecated. Please move to https://github.com/redhat-developer/rhdh-chart

Home Page:https://redhat-developer.github.io/rhdh-chart/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

"commonLabels": {
"additionalProperties": {
"type": "string"
},
"default": {},
"title": "Labels to add to all deployed objects",
"type": "object"
},

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):

"podLabels": {
"additionalProperties": {
"type": "string"
},
"default": {},
"title": "Labels to add to the backend deployment pods",
"type": "object"
},

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.