Dsan
Dsan

Reputation: 31

How to upgrade kubectl server version

On Windows 10 Pro, I installed docker and the Kubernetes cli. I upgraded the kubectl.exe to version 1.15 by replacing the old one in the docker folder. When I run “kubectl version”, it shows the client version as 1.15, but the server version still shows as 1.10. How can I upgrade the server version to 1.15?

Upvotes: 3

Views: 13059

Answers (4)

Duru Cynthia Udoka
Duru Cynthia Udoka

Reputation: 752

The simple solution to this is to delete your minikube and run:

minikube start --kubernetes-version v1.15.0

For more context, when you made the change in the docker folder, you upgraded your Kubectl client to version 1.15, but the server (the Kubernetes cluster) is still running version 1.10.

Understand that Docker Desktop includes Kubernetes as part of its installation. To upgrade the Kubernetes server to a newer version, you need to update Docker Desktop. FYI - You can also check the Kubernetes version in Docker Desktop under the Kubernetes tab in the Settings section. If there is an upgrade available, it should prompt you to update.

If you're using Minikube to run Kubernetes locally it's best to delete and start, using the below commands

 minikube stop
 minikube delete
 minikube start --kubernetes-version v1.15.0

Hope this helps!

Upvotes: 0

Krzysztof Waclawski
Krzysztof Waclawski

Reputation: 21

I had similar difference between the client version and server with minikube on Ubuntu (WSL):

WARNING: version difference between client (1.25) and server (1.23) exceeds the supported minor version skew of +/-1.

I tried running minikube with newer verion that I had locally installed as per here https://minikube.sigs.k8s.io/docs/handbook/config/#selecting-a-kubernetes-version

    kris@W:~$ minikube start --kubernetes-version=v1.28.11
😄  minikube v1.30.1 on Ubuntu 22.04 (amd64)
❗  Specified Kubernetes version 1.28.11 is newer than the newest supported version: v1.27.0-rc.0. Use `minikube config defaults kubernetes-version` for details.
✨  Using the docker driver based on existing profile
👍  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
💾  Downloading Kubernetes v1.28.11 preload ...
    > preloaded-images-k8s-v18-v1...:  345.40 MiB / 345.40 MiB  100.00% 2.27 Mi
🔄  Restarting existing docker container for "minikube" ...
🤦  StartHost failed, but will try again: driver start: start: docker start minikube: exit status 1

even though I got some errors, minikube downloaded newer image and now result is

kris@W:~$ kubectl version
    Client Version: v1.29.6
    Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
    Server Version: v1.28.11

Upvotes: 0

P Ekambaram
P Ekambaram

Reputation: 17615

You need to upgrade kubernetes control plane.

you can use below commands to upgrade k8s cluster if the cluster is setup using kubeadm

export VERSION="1.15"
export ARCH=amd64
wget https://storage.googleapis.com/kubernetes-release/release/v${VERSION}/bin/linux/amd64/kubeadm > /usr/bin/kubeadm
chmod a+rx /usr/bin/kubeadm

kubeadm upgrade apply ${VERSION}

Upvotes: 2

Nepomucen
Nepomucen

Reputation: 6507

Welcome to SO !, I assume you are using Kubernetes cluster, that is available as an installation option of Docker Desktop for Windows. In that case you cannot easily upgrade your Kubernetes cluster (server side), as its particular version is bundled with Docker Desktop installer (e.g. Docker Community Edition 2.0.0.2 2019-01-16 comes with Kubernetes 1.10.11 version).

If you want to have a full control over Kubernetes version (server side/control plane) please check minikube tool, which lets you specify it by adding '--kubernetes-version' argument (minikube start --kubernetes-version v1.15.0). With minikube there is still an option to re-use the Docker daemon inside the VM (started with 'minikube start command' in the background).

Upvotes: 6

Related Questions