kubectl 重启某个 Namespace 下的所有 Deployment

1
2
NAMESPACE="arc-os"
for DEPLOY in $(kubectl get deployments -n $NAMESPACE | tail -n +2 | cut -d ' ' -f 1); do kubectl rollout restart deployments/$DEPLOY -n $NAMESPACE; done