代码拉取完成,页面将自动刷新
#!/bin/bash
echo "Removing the Kubernetes manifests from this demo..."
kubectl delete -f kind/bot-deployment.yaml
kubectl delete -f kind/bot-service.yaml
kubectl delete -f kind/database-deployment.yaml
kubectl delete -f kind/database-pvc.yaml
kubectl delete -f kind/database-service.yaml
# Find all kubectl port-forward processes and kill them
echo "Identifying all kubectl port-forward processes..."
# Use pgrep to find the PIDs of the processes with 'kubectl port-forward' command
pids=$(pgrep -f "kubectl port-forward")
if [ -z "$pids" ]; then
echo "No kubectl port-forward processes found."
else
# Display the PIDs and kill them
for pid in $pids; do
echo "Terminating process with PID: $pid"
kill $pid
if [ $? -eq 0 ]; then
echo "Successfully terminated process with PID: $pid"
else
echo "Failed to terminate process with PID: $pid. You may need to run the script as root or use 'sudo'."
fi
done
fi
echo "All kubectl port-forward processes have been terminated."
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。