webservice.common.labels duplicates labels in some release objects
Summary
Labels that are added via gitlab.webservice.common.labels
are being duplicated for only some objects managed by helm. Impacted objects:
- Service
- PDB
- HPA
- Deployment - for both deployment spec and the Pod spec
- Ingress
Not impacted:
- NetworkPolicy
- ConfigMap
- ServiceAccount
Configuration used
Introduced configuration: gitlab-com/gl-infra/k8s-workloads/gitlab-com!873 (diffs)
Current behavior
Example result:
gitlab, gitlab-webservice-git, HorizontalPodAutoscaler (autoscaling) has changed:
...
kind: HorizontalPodAutoscaler
metadata:
name: gitlab-webservice-git
namespace: gitlab
labels:
app: webservice
chart: webservice-4.11.4
release: gitlab
heritage: Helm
+ shard: default
+ stage: main
tier: sv
gitlab.com/webservice-name: git
+ shard: default
+ stage: main
tier: sv
type: git
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: gitlab-webservice-git
minReplicas: 1
maxReplicas: 5
metrics:
...
Expected behavior
Example result:
gitlab, gitlab-webservice-git, HorizontalPodAutoscaler (autoscaling) has changed:
...
kind: HorizontalPodAutoscaler
metadata:
name: gitlab-webservice-git
namespace: gitlab
labels:
app: webservice
chart: webservice-4.11.4
release: gitlab
heritage: Helm
+ shard: default
+ stage: main
tier: sv
gitlab.com/webservice-name: git
tier: sv
type: git
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: gitlab-webservice-git
minReplicas: 1
maxReplicas: 5
metrics:
...
Versions
- Chart:
a53d14845b91d1e96aecacf14b41e8be97455e57
Suspect
We bring in webservice labels and the common labels appear to set them twice in our charts. The implementation of this may need to be revisited.
Edited by John Skarbek