falco helm upgrade / labelselector field immutable
Today I got this unusual error when upgrading the Falco helm chart from 1.19.4 to 2.0+.
Error: UPGRADE FAILED: cannot patch "falco" with kind DaemonSet:
DaemonSet.apps "falco" is invalid:
spec.selector: Invalid value: v1.LabelSelector{
MatchLabels:map[string]string{"app.kubernetes.io/instance":"falco", "app.kubernetes.io/name":"falco"},
MatchExpressions:[]v1.LabelSelectorRequirement(nil)
}: field is immutable
The explanation is here as given by Stackoverflow user misha2048:
You cannot update selectors for [...] ReplicasSets, Deployments, DaemonSets [...] from
my-app: ABC
tomy-app: XYZ
and then simply [apply the changes].
Instead, you should kubectl delete ds falco
first. In this case,
because the labels changed from:
labels:
app: falco
app.kubernetes.io/managed-by: Helm
chart: falco-1.19.4
heritage: Helm
release: falco
to:
labels:
app.kubernetes.io/instance: falco
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: falco
app.kubernetes.io/version: 0.32.2
helm.sh/chart: falco-2.0.16
Maybe it would've been nice if this was mentioned in the not so verbose Falco Helm changelog. Are there upgrade docs anywhere?