Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

kubectl jq json pod name

# kubectl does not support regular expressions for JSONpath output
# The following command does not work
kubectl get pods -o jsonpath='{.items[?(@.metadata.name=~/^test$/)].metadata.name}'

# The following command achieves the desired result
kubectl get pods -o json | jq -r '.items[] | select(.metadata.name | test("test-")).spec.containers[].image'
Comment

kubectl jq json pod name jsonpath

kubectl get pods -o json
kubectl get pods -o=jsonpath='{@}'
kubectl get pods -o=jsonpath='{.items[0]}'
kubectl get pods -o=jsonpath='{.items[0].metadata.name}'
kubectl get pods -o=jsonpath="{.items[*]['metadata.name', 'status.capacity']}"
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"	"}{.status.startTime}{"
"}{end}'
Comment

kubectl jq json pod name

# kubectl does not support regular expressions for JSONpath output
# The following command does not work
kubectl get pods -o jsonpath='{.items[?(@.metadata.name=~/^test$/)].metadata.name}'

# The following command achieves the desired result
kubectl get pods -o json | jq -r '.items[] | select(.metadata.name | test("test-")).spec.containers[].image'
Comment

PREVIOUS NEXT
Code Example
Shell :: nlog linux folder 
Shell :: uninstalling vscode for centos 8 
Shell :: service previous logs 
Shell :: ls command in linux 
Shell :: find all cron jobs in linux 
Shell :: how to install bash script on mac terminal 
Shell :: linux apt ignore not found package 
Shell :: falha ao instalar arquivo não há suporte ubuntu 
Shell :: v4l2 not found 
Shell :: Target DEP-11-icons-small (stable/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-groovy.list:1 and /etc/apt/sources.list.d/docker-ce.list:1 
Shell :: strstr bash 
Shell :: Display full date and time in history command 
Shell :: how to create a github repo on linux command line 
Shell :: deploying to heroku from git 
Shell :: avalible ios simulators 
Shell :: Windows 10 - Get a list of installed apps into a text file 
Shell :: how to provide 777 access recurssively unix 
Shell :: full path with linux find 
Shell :: install litedb 
Shell :: create file of packages to install with yum 
Shell :: cursor size in linux not changing on the desktop 
Shell :: emulator android 
Shell :: remove and exclude folder in git for upcomming commits 
Shell :: bash script get value from piped input 
Shell :: how to install ubuntu on mac 
Shell :: como usar o cmd do git 
Shell :: npm warn ws butterfly install peer dependencies 
Shell :: bash get first number from string 
Shell :: aws codedeploy logs 
Shell :: linux install with package manager snap snapd 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =