question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] unexpected removing all kafka resources when upgrade using helm3

See original GitHub issue

Describe the bug I’m using strimzi operator v0.19.0 and tried upgrade to 0.20.0. When I’ve ran helm upgrade procedure all my resources (users, topics, clusters) was removed. I try to reproduce problem with fresh installed cluster and situation was reproduced again.

To Reproduce Steps to reproduce the behavior:

1. helm install strimzi-kafka strimzi/strimzi-kafka-operator --namespace kafka --set watchNamespaces="{kafka,test-kafka}" --version=0.19.0
2. create cluster, users and topics from manifests (apiVersion: v1beta1)
3. helm upgrade strimzi-kafka strimzi/strimzi-kafka-operator --namespace kafka --set watchNamespaces="{kafka,test-kafka}"
kubectl get crd| grep kafka| wc -l
       0

After the steps above my cluster and users/topics was removed. The operator pod try to start and crashed with the following error:

2020-10-26 14:35:47 WARN  WatchConnectionManager:198 - Exec Failure: HTTP 404, Status: 404 - 404 page not found

java.net.ProtocolException: Expected HTTP 101 response but was '404 Not Found'
	at okhttp3.internal.ws.RealWebSocket.checkResponse(RealWebSocket.java:229) [com.squareup.okhttp3.okhttp-3.12.6.jar:?]
	at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:196) [com.squareup.okhttp3.okhttp-3.12.6.jar:?]
	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:203) [com.squareup.okhttp3.okhttp-3.12.6.jar:?]
	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) [com.squareup.okhttp3.okhttp-3.12.6.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]
2020-10-26 14:35:47 WARN  WatchConnectionManager:198 - Exec Failure: HTTP 404, Status: 404 - 404 page not found

java.net.ProtocolException: Expected HTTP 101 response but was '404 Not Found'
	at okhttp3.internal.ws.RealWebSocket.checkResponse(RealWebSocket.java:229) [com.squareup.okhttp3.okhttp-3.12.6.jar:?]
	at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:196) [com.squareup.okhttp3.okhttp-3.12.6.jar:?]
	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:203) [com.squareup.okhttp3.okhttp-3.12.6.jar:?]
	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) [com.squareup.okhttp3.okhttp-3.12.6.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]

Expected behavior The operator should be updated without removing resources.

Environment (please complete the following information):

  • Strimzi version: 0.19.0
  • Installation method: Helm chart
  • Kubernetes cluster: v.1.18.8
  • Infrastructure: Rancher2 on Amazon EC2 instances

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:33 (10 by maintainers)

github_iconTop GitHub Comments

5reactions
gris-griscommented, Nov 10, 2020

A quick workaround we found with our team:

  1. Backup and delete all secrets related to Strimzi helm chart sh.helm.release.v1.strimzi
  2. Redeploy with version 0.20.0, CRD’s will not be deleted and version upgrade completes successfully
3reactions
driosalidocommented, Nov 11, 2020

A quick workaround we found with our team:

  1. Backup and delete all secrets related to Strimzi helm chart sh.helm.release.v1.strimzi
  2. Redeploy with version 0.20.0, CRD’s will not be deleted and version upgrade completes successfully

There is also the option to edit the data in the helm secret instead of deleting it

kubectl get secrets -n NAMESPACE sh.helm.release.v1.DEPLOYNAME -o json | jq .data.release -r | base64 --decode | base64 --decode | gunzip - > /var/tmp/manifest.json

The remove the CRD data inside the templates and manifest sections and upload the secret again

DATA=`cat /var/tmp/manifest.json | gzip -c | base64 | base64`
kubectl patch secret -n NAMESPACE sh.helm.release.v1.DEPLOYNAME --type='json' -p="[ {\"op\":\"replace\",\"path\":\"/data/release\",\"value\":\"$DATA\"}]"

Then the upgrade to 0.20.0 will leave the CRDs alone…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking Changes in Helm 3 (and How to Fix Them) - ITNEXT
This is nice if your YAML files are all perfectly aligned with the Kubernetes API docs; if not you'll have to remove any...
Read more >
Change log for 4.9.52
Kubernetes upgraded from 1.21.1 to 1.22.8; Red Hat Enterprise Linux ... Bug 2009024: Delete all the ports from tagged Neutron networks.
Read more >
Helm 3, the Good, the Bad and the Ugly - Banzai Cloud
The recurring problem here is that Helm is a clever templating tool for YAML files and doesn't care how Kubernetes works. Another great...
Read more >
Troubleshoot Bitnami Helm chart issues
The following are the most common issues that Bitnami users face when dealing with Bitnami charts: Credential errors while upgrading chart ...
Read more >
Kafka - Bitnami - Artifact Hub
Apache Kafka is a distributed streaming platform designed to build real-time ... The command removes all the Kubernetes components associated with the chart ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found