强制删除NAMESPACE
[root@k8s-master1 ~]# cat delete.sh
#!/bin/bash
set -eo pipefail
die(服务器托管网) { echo "$*" 1>&2 ; exit 1; }
need() {
which "$1" &>/dev/null || die "Binary '$1' is missing but required"
}
# checking pre-reqs
need "jq"
need "curl"
need "kubectl"
PROJECT="$1"
shift
test -n "$PROJECT" || die "Missing arguments: kill-ns "
kubectl proxy &>/dev/null &
PROXY_PID=$!
killproxy () {
kill $PROXY_PID
}
trap killproxy EXIT
sleep 1 # give the proxy a second
kubectl get namespace "$PROJECT" -o json | jq 'del(.spec.finalizers[] | select("kubernetes"))' | curl -s -k -H "Content-Type: application/json" -X PUT -o /dev/null --data-binary @- http://localhost:8001/api/v1/namespaces/$PROJECT/finalize && echo "Killed namespace: $PROJECT"
执行方法
sh delete.sh [NS服务器托管网名称]
强制删除Pod
[root@k8s-master1 ~]# kubectl delete pod pod-gpu-test-1 --force --grace-period 0
Warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
pod "pod-gpu-test-1" force deleted
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
当功能标记系统崩溃时,应用程序会发生什么情况?有两种可能性:故障安全或故障崩溃。 第一种可能性是什么都不会发生。这是故障安全模式。没有对船旗国进行任何更新,但一切都继续按照其一贯的方式运作。当功能标记系统重新出现时,从用户的角度来看没有任何变化。这种系统之所以…