wandb / helm-charts

Our official helm charts for deploying wandb into k8s
MIT License
18 stars 8 forks source link

Generated manifests have duplicate selector labels #125

Open tico24 opened 5 months ago

tico24 commented 5 months ago

To recreate, in the operator-wandb directory run:

helm dependency update
helm template -s charts/app/templates/deployment.yaml . > out.yaml
cat out.yaml

The resulting yaml will have duplicate selector labels:

...
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: app
      app.kubernetes.io/instance: release-name
      helm.sh/chart: app-0.1.0
      app.kubernetes.io/name: app
      app.kubernetes.io/instance: release-name
      app.kubernetes.io/version: "0.33.0"
      wandb.com/app-name: app-0.1.0
      app.kubernetes.io/managed-by: Helm
...

Note app.kubernetes.io/name: app and app.kubernetes.io/instance: release-name are duplicated.

On the whole, kubernetes ignores the duplication. Kustomize is less nice and will throw errors along these lines:

error: map[string]interface {}(nil): yaml: unmarshal errors:
  line 20: mapping key "app.kubernetes.io/name" already defined at line 17
  line 21: mapping key "app.kubernetes.io/instance" already defined at line 18