kiali: Kiali 1.36 upgrade from 1.32 service selector incorrect

Issue Description We are noticing that when upgrading from 1.32 to 1.36 the service selectors seem to stick around:

    selector:
      app: kiali
      app.kubernetes.io/instance: kiali
      app.kubernetes.io/name: kiali
      version: v1.32.0

This causes issues with hitting the service obviously. We are installing from the helm chart, so its possible this is related to the helm chart rather than the operator?

Versions used Kiali: 1.32.0 -> 1.36.0 Istio: 1.8.4 Kubernetes flavour and version: k3s version v1.20.4-k3s1

To Reproduce Steps to reproduce the behavior:

  1. Helm install the 1.32.0 operator + instance
  2. Helm upgrade to the 1.36.0 operator + instance
  3. Check the kiali service that has been created
  4. See the extra/wrong selectors.

Expected behavior The service should be updated on upgrades.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15

Commits related to this issue

Most upvoted comments

I want to more formally declare what the problem is.

The problem only shows up if:

(a) You have already installed Kiali server using operator v1.34 or earlier, and… (b) You have not deleted the Kiali CR (i.e. you have not uninstalled that Kiali server), and… © You upgrade the operator (and hence the existing Kiali server) to v1.35 or higher.

If you delete the Kiali CRs prior to upgrading the operator, this isn’t a problem.

If you are starting from v1.35 or higher (and, say, upgrade to v1.36.1) or if you are starting before v1.35 and are upgrading to before v1.35, this also isn’t a problem.

So, in short, upgrading an existing Kiali server from pre-v1.35 to 1.35+ is a problem.

OK. I know what this is. The “version” field has been removed from the selector (happened in this PR which went into Kiali v1.35.0). So this problem only happens if you upgrade from a pre-v1.35 operator to a v1.35-or-higher operator. Once you get past v1.35, this won’t happen.

It looks like Kubernetes patch is not removing that now-defunct “version” field when applied to an existing service that already had it.

There are two workarounds you can do for this.

  1. Delete the Kiali CR prior to the upgrade - this uninstalls the Kiali Server. The upgraded operator will create a new Kiali deployment.

or

  1. Manually patch the service after the upgrade is complete and the service has been updated:
kubectl patch service kiali -n kiali --type=json -p='[{"op":"remove","path":"/spec/selector/version"}]'