kubectl get deployments output differ from this in documentation

9/13/2019

When I run this command

kubectl get deployments

at my Linux Ubuntu 18 machine, I got different output than expected (according to documentation).

Expected: enter image description here

Actual:

enter image description here

Of course, I am not talking about values, I am talking about names of labels.

[EDIT]

My k8s version: enter image description here

-- Lucas
kubectl
kubernetes

2 Answers

9/13/2019

This is just an old output format. The newer output you're getting below contains all the same information; the "READY" field is a combination of the old "DESIRED" and "CURRENT".

It's showing as 4/5 in your output to indicate 4 pods ready/current, and 5 pods desired.

Hope this helps.

-- cewood
Source: StackOverflow

9/13/2019

The output depends on client version. Let's check it with the same server

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.0", GitCommit:"6e937839ac04a38cac63e6a7a306c5d035fe7b0a", GitTreeState:"clean", BuildDate:"2017-09-28T22:57:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:36:19Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}

$ kubectl get deployments kube-dns -n kube-system
NAME       DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
kube-dns   2         2         2            2           10d

Switching the kubectl version changes output:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:44:30Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:36:19Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}

$ kubectl get deployments kube-dns -n kube-system
NAME       READY   UP-TO-DATE   AVAILABLE   AGE
kube-dns   2/2     2            2           10d
-- Konstantin Vustin
Source: StackOverflow