Which kubectl should I use on macOS? - docker

On macOS there's Docker Desktop which comes with a kubectl, there's the Homebrew kubectl, then there's the gcloud kubectl.
I'm looking to use Minikube for local Kubernetes development and also GKE for production.
Which kubectl should I use? I'm thoroughly confused by all the various versions and how they differ from one another. Does it matter at all other than the version of the binary?

It doesn't really matter from where you get an executable as long as it is a trusted source. Although you have to use a supported version (documentation):
kubectl is supported within one minor version (older or newer) of kube-apiserver.
Example:
kube-apiserver is at 1.20
kubectl is supported at 1.21, 1.20, and 1.19

Related

Specifying the Kubernetes version in Docker Desktop for Mac

It looks like Docker Desktop for Mac is using a 1.22+ version of Kubernetes which introduces a number of breaking changes specifically to the ingress-nginx controller apiVersion. This is causing issues with our local development cluster.
There are couple options:
Rolling back the Kubernetes version to something <1.22 in the development cluster.
Updating ingress-nginx and the development configuration to use >=1.22.
I'm trying to go with route 1. and downgrade the version to match our production cluster: v1.20.7 primarily because 1.22+ isn't available in Azure yet it looks like. It makes sense to me to have the development and production versions match.
That is my question: How do you change the version of Kuberentes that `docker-desktop uses?
If that can't be done, then I guess I'll just have to go with 2.
What've tried so far is simply following the kubectl documentation:
curl -LO "https://dl.k8s.io/release/v1.20.7/bin/darwin/arm64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version --client
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.0", GitCommit:"ab69524f795c42094a6630298ff53f3c3ebab7f4", GitTreeState:"clean", BuildDate:"2021-12-07T18:08:39Z", GoVersion:"go1.17.3", Compiler:"gc", Platform:"darwin/arm64"}
Skeptical it was going to work and sure enough it doesn't.
Edit:
Option 3.: use something like minikube, mikrok8s, k3d, etc.
It is looking like the only way to downgrade change the kubectl version is to downgrade Docker Desktop for Mac.
As best as I could determine, there is not a way to do this. (Please correct me if I'm wrong).
The options appear to just be:
Downgrade Docker Desktop for Mac to a version that has the version of Kubernetes that you want. Can find previous versions here: https://docs.docker.com/desktop/mac/release-notes/
Use something like minikube, mikrok8s, k3d, etc. that gives you better control over the Kubernetes version being used.
I ended up just dong 1. as opposed to adding another tool to our development environment, but 2. feels like a much better option.

Which docker versions are supported on kubernetes 1.18 and 1.19?

I found the following description about supported docker versions in kubernetes v1.18 and 1.19 documents.
Container runtimes
The Kubernetes release notes list which versions of Docker are compatible with that version of Kubernetes.
But I cannot find supported docker versions in the Relase Notes.
v1.18 Release Notes
v1.19 Release Notes
Also, I check the other k8s documents.
v1.15 and v1.16 document describe supported docker versions.
The documents specifically list them.
v1.15 Release Notes
v1.16 Release Notes
The list of validated docker versions remains unchanged.
The current list is 1.13.1, 17.03, 17.06, 17.09, 18.06, 18.09. (#72823, #72831)
In fact, there is no information about docker version for 1.18 and 1.19 kubernetes version.
You can suggest documentation upgrade using this link for kubernetes team to include theses information.
As per https://kops.sigs.k8s.io/releases/1.19-notes/ the Docker 19.03.11 for Kubernetes 1.18+ will be supported.
Docker 19.03.11 for Kubernetes 1.18+
The change logs for all of the Kubernetes versions, and information on supported versions of Docker, are also specified on the following webpage,
https://github.com/kubernetes/kubernetes/tree/master/CHANGELOG

no matches for kind "Deployment" in version "apps/v1"

I have minikube v0.26.0 version and kubectl v1.10.1 version and localKube v1.8.0
i get the following error when i try to deploy the kubeless ui
$ kubectl create -f https://raw.githubusercontent.com/kubeless/kubeless-ui/master/k8s.yaml
ERROR:
unable to recognize "https://raw.githubusercontent.com/kubeless/kubeless-ui/master/k8s.yaml": no matches for kind "Deployment" in version "apps/v1"
after a long R & D
minikube start --logtostderr --v=0 --bootstrapper=localkube --vm-driver virtualbox
now it downloaded the latest localkube version, and this solved my problem.
As the comment says, you're using a version of Kubernetes that's very old. Deployment wasn't available under apps/v1 until Kubernetes 1.9, and you appear to be using 1.8.
If you want to solve this problem without upgrading your cluster, you'll need to replace the apiVersion value in all of your Deployment objects with one of the older paths:
apiVersion: apps/v1beta1
kind: Deployment
Note that while this will fix the immediate problem, you will still likely run into other compatibility issues, and should upgrade your cluster.

OC 3.9.0 + Istio

I would llike to try Istio on Openshift platform. Could somebody confirm if succesfully install Istio locally on Openshift on Windows 10 machine?
I am not able to run the newest Openshift (oc 3.11 or oc 3.10) because of error
error: cannot create volume share
And I can't run Istio on Openshift 3.9 because some Istio components won't start. Also on official page only Openshift version 3.10+ is mentioned.
Is it worth to try Istio with Openshift 3.9 ?
Currently, I think Istio is not stable to be Enterprise Ready, so Red Hat does not make it in its official supported list.
If you want just give a try with this, I highly recommend you to take a look at this https://learn.openshift.com/servicemesh/ to avoid the boring installation things.

Docker version supported in Kubernetes 1.8

I'm going to upgrade my Kubernetes cluster to the version 1.8.7. Does anybody know which docker version is best compatible with it?
This is what I found on the Kubernetes official page, but I suppose it might be for the latest k8s release (1.9)?
On each of your machines, install Docker. Version v1.12 is
recommended, but v1.11, v1.13 and 17.03 are known to work as well.
Versions 17.06+ might work, but have not yet been tested and verified
by the Kubernetes node team.
Thank you!
According to the kubernetes v1.8.0 changelog
Continuous integration builds use Docker versions 1.11.2, 1.12.6, 1.13.1, and 17.03.2. These versions were validated on Kubernetes 1.8.
So any of these version should work fine.

Resources