kubernetes集群中对多个pod操作命令

  $ for i in 0 1; do kubectl exec web-$i -- sh -c 'echo hello $(hostname) > /usr/share/nginx/html/index.html'; done

原文地址:https://www.cnblogs.com/hixiaowei/p/10384005.html