kubectl get pods <-n namespace> <--all-namespace> -o jsonpath="{.items[*].spec.containers[*].name}" |tr -s '[[:space:]]' '\n' |sort |wc -l

kubectl get pods <-n namespace> <--all-namespace> -o jsonpath="{.items[*].spec.initContainers[*].name}" |tr -s '[[:space:]]' '\n' |sort |wc -l