jaegertracing / helm-charts

Helm Charts for Jaeger backend
Apache License 2.0
258 stars 340 forks source link

[jaeger-operator] Jaeger-Operator's update breaks Chart installation #32

Open arugifa opened 4 years ago

arugifa commented 4 years ago

I recently updated my Jaeger-Operator's chart from 2.10.2 to 2.12.3 , and got an error with Helm:

$ helm history -o json jaeger-operator | jq .

[
  {
    "revision": 623,
    "updated": "Tue Oct 29 11:33:18 2019",
    "status": "DEPLOYED",
    "chart": "jaeger-operator-2.10.2",
    "description": "Upgrade complete"
  },
  {
    "revision": 624,
    "updated": "Thu Jan 16 15:11:11 2020",
    "status": "FAILED",
    "chart": "jaeger-operator-2.12.3",
    "description": "Upgrade \"jaeger-operator\" failed: Deployment.apps \"jaeger-operator\" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{\"app.kubernetes.io/name\":\"jaeger-operator\"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable"
  }
]

I couldn't find any info about this error in the README. So I started to look around, and found out these errors were probably due to a change in the label selectors of the Jaeger-Operator deployment: doing so is not allowed by Kubernetes, as these fields are immutable.

By deleting the deployment and reinstalling the chart, I finally solved my problem:

$ kub delete deploy jaeger-operator
$ helm rollback jaeger-operator 624

I assume other people probably also got this error (or will in the future), and that adding a note in the README could be really useful 🙌

TBBle commented 4 years ago

With Helm v2, you could use --force to turn the upgrade from PATCH into DELETE+PUT, to work around this sort of thing.

With Helm v3, that is not (currently) possible, see https://github.com/helm/helm/issues/7082.

naseemkullah commented 4 years ago

Deleting the deployment with --cascade=false will save you from downtime as well (provided you reinstall immediately after).