I have gotten this far:
$kubectl get replicaset --namespace default -l "app=myapp,release=myapp" -o jsonpath="{.items[0].metadata.annotations}"
Which gives me:
map[deployment.kubernetes.io/revision:1 deployment.kubernetes.io/desired-replicas:2 deployment.kubernetes.io/max-replicas:3]
I want to extract '2'
I tried various versions of
$kubectl get replicaset --namespace default -l "app=myapp,release=myapp" -o jsonpath="{.items[0].metadata.annotations.'deployment.kubernetes.io\/desired-replicas'}"
but I am getting a blank response.
Any help is appreciated
Try -o jsonpath="{.items[0].metadata.annotations.deployment\.kubernetes\.io/desired-replicas'}"
I mean just escape the .
s with \
if any present in key.