kubernetesgoogle-kubernetes-enginejsonpathazure-aksk8s-cronjobber

kubernetes to print specific columns


Need only specific columns using JSONPATH query in kubernetes:

NAME  STATUS    ROLES   AGE VERSION
1     Ready     master  35d v1.18.6
2     Ready     <none>  35d v1.18.6
3     Ready     <none>  35d v1.18.6             
4     Ready     <none>  35d v1.18.6             
5     Ready     master  35d v1.18.6             
6     Ready     <none>  35d v1.18.6

Desired output should look like this:

NAME    VERSION
1       v1.18.6
2       v1.18.6
3       v1.18.6
4       v1.18.6
5       v1.18.6 
6       v1.18.6

Solution

  • Th answer to above question is:

    It will produce output:

    01    v1.18.6
    02    v1.18.6
    03    v1.18.6
    04    v1.18.6
    05    v1.18.6
    

    For further sorting: