2 min read
When we print values using jsonpath we'll get all the values in a single line (actually, it won't even bother adding the newline character at the end of the list):
$ kubectl get ns -o jsonpath='{ .items[*].metadata.name }'
default dynamodb-operator ec2-operator iam-operator kube-node-lease kube-public kube-system local-path-storage testvault
06/06/2023
Read more...2 min read
If we need to write some script to retrieve a certain information that kubectl can provide, we can always add the option to remove headers and use something like awk to narrowit down. There's also a better way than doing this:
kubectl get ns --no-headers | awk '{ print $1 }'
31/08/2022
Read more...