kubectl version mismatch for k8s v1.23

Bug #1991773 reported by Ai Hamano
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kuryr-kubernetes
Fix Released
Undecided
Roman Dobosz

Bug Description

As of October 2022, after specifying "KURYR_KUBERNETES_VERSION=1.23.3" in local.conf and installing with devstack, the following version is displayed with the "kubectl version" command.
```
$ kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.25.2
Kustomize Version: v4.5.7
Server Version: v1.23.12
WARNING: version difference between client (1.25) and server (1.23) exceeds the supported minor version skew of +/-1
```

As shown in the warning, if the server version is 1.23, the client version should be 1.22-1.24 instead of 1.25.
This is because kubectl is installed as a dependency of kubeadm.
The kubeadm version will be the specified 1.23.
But kubectl doesn't specify a version, so it installs with the latest version at that time.
* https://opendev.org/openstack/kuryr-kubernetes/src/branch/stable/zed/devstack/lib/kubernetes#L26-L30
```
    # NOTE(gryf): kubectl will be installed alongside with the kubeadm as
    # a dependency
    apt_get install \
        kubelet="${KURYR_KUBERNETES_VERSION}-00" \
        kubeadm="${KURYR_KUBERNETES_VERSION}-00"
```

kubectl should also be installed with a version specified.

Changed in kuryr-kubernetes:
assignee: nobody → Roman Dobosz (roman-dobosz)
Changed in kuryr-kubernetes:
status: New → Confirmed
Revision history for this message
Roman Dobosz (roman-dobosz) wrote :

Yeah, new version for kubectl has landed some time ago on the repository, and we didn't pin it. Patch is on the way.

Changed in kuryr-kubernetes:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kuryr-kubernetes (master)

Reviewed: https://review.opendev.org/c/openstack/kuryr-kubernetes/+/861081
Committed: https://opendev.org/openstack/kuryr-kubernetes/commit/d300cb65e6534256c9377aa918ed6dcbb47fba08
Submitter: "Zuul (22348)"
Branch: master

commit d300cb65e6534256c9377aa918ed6dcbb47fba08
Author: Roman Dobosz <email address hidden>
Date: Wed Oct 12 14:07:56 2022 +0200

    Pin kubectl to the installed kubernetes version.

    During devstack deployment it can happen, that changing desired version
    of the kubernetes, kubectl will be intalled with different version. This
    patch make sure, that all of the installed kubernetes components are
    coherent.

    Closes-Bug: #1991773
    Change-Id: Ied04e93bbe16e7a40213c35f0c6775bbcbf514ac

Changed in kuryr-kubernetes:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kuryr-kubernetes 8.0.0.0rc1

This issue was fixed in the openstack/kuryr-kubernetes 8.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.