kubernetes-up-and-running / kuard

Demo app for Kubernetes Up and Running book
Apache License 2.0
1.56k stars 535 forks source link

Labels and Annotations #42

Closed abstract-thinking closed 2 years ago

abstract-thinking commented 2 years ago

Hi,

I wonder the command kubectl get deployments --show-labels does not work on my machine. No resources found in default namespace.

On the pods level it looks ok

kubectl get pods --show-labels                                                                                                      ─╯
NAME                READY   STATUS    RESTARTS   AGE   LABELS
alpaca-prod         1/1     Running   0          23m   app=alpaca,env=prod,ver=1
alpaca-test         1/1     Running   0          23m   app=alpaca,canary=true,env=test,ver=2
bandicoot-prod      1/1     Running   0          23m   app=bandicoot,env=prod,ver=2
bandicoot-staging   1/1     Running   0          22m   app=bandicoot,env=staging,ver=2
kuard               1/1     Running   0          99m   <none>

By creation I had to remove the replicas flag.

kubectl run alpaca-prod --image=gcr.io/kuar-demo/kuard-amd64:blue --labels="ver=1,app=alpaca,env=prod"

Has something changed in the logic of deployment?

Thanks, Markus

abstract-thinking commented 2 years ago

By accident I found the answer today: https://stackoverflow.com/questions/67146527/create-deployments-with-kubectl-version-1-18