k get deploy -o template --template='{{range .items}}{{.metadata.name}}--replicas:{{.spec.replicas}}--{{range .spec.template.spec.containers}}cpu:{{.resources.limits.cpu}},mem:{{.resources.limits.memory}}{{end}}{{printf "\n"}}{{end}}'
使用index处理引号问题
1
k get ingress -A -o template --template='{{range .items}}{{.metadata.name}}--class:{{ index .metadata.annotations "kubernetes.io/ingress.class"}}{{printf "\n"}}{{end}}'