🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## kubernetes 笔记 [TOC=3,8] ---- ### 安装 #### 升级内核 ```shell $: chmod +x ./kernel_upgrade.sh && ./kernel_upgrade.sh ``` ---- #### 安装 Docker 已安装可跳过。 ```shell $: chmod +x ./docker_install.sh && ./docker_install.sh ``` ---- #### 安装 k8s ##### 1: 准备工作 1. 准备三台虚拟主机,mac 地址需要不同,并设置好网络环境,保证 三台虚机 网络可以互通。 2. 接下来所有的命令在当前主机上执行前,需要先根据当前主机修改 `_hostname` 、`_hosts` 、`_m_ip` 文件 修改 `_hostname` 文件,内容为 主机名,如 主节点 `k8s-master` ,worker 节点 `k8s-node1` ~~~ k8s-master ~~~ 修改 `_hosts` ,如: ~~~ 192.168.11.67 k8s-master 192.168.11.90 k8s-node1 192.168.11.91 k8s-node2 ~~~ 修改 `_m_ip` 文件,内容为 内网ip > 注意 这些节ip 都是内网ip,而非外网ip ---- ##### 2: 执行安装脚本 > 注意,需要在所有节点执行,请注意需改 _hostname 文件 ```shell $: chmod +x ./nodes_install.sh && ./nodes_install.sh ``` 说明:脚本会自动识别主节点,会在主节点上初始化集群。 ---- ##### 3: worker 节点加入到集群 见 `node_join.sh` 脚本 ,复制命令,token 值 为 上一步中主节点输出的集群初始化结果。 ---- ##### 4: 测试 冒烟测试 ... ---- #### 其它 ``` vi /etc/kubernetes/kubeadm-config.yaml ``` ```shell # 查看日志 $: journalctl -xeu kubelet $: systemctl status kubelet $: netstat -antup | grep 6443 $: kubectl get cs ``` 常用命令: ```shell # 查看节点列表 $: kubectl get nodes -o wide $: kubectl get nodes --show-labels # 查看 pod 列表 $: kubectl get pods -n kube-system -o wide $: kubectl get pods --all-namespaces -o wide # 查看 deployment 列表 $: kubectl get deployments --all-namespaces -o wide #: kubectl edit deployment nginx-deployment # 查看 ReplicaSet 列表 $: kubectl get rs --all-namespaces -o wide # 查看 services 列表 $: kubectl get svc --all-namespaces -o wide $: kubectl describe svc nginx-svc # 查看 ingress 列表 $: kubectl get ingress --all-namespaces -o wide # 显示 DaemonSet 列表 $: kubectl get ds --all-namespaces # 查看 pvc 列表 $: kubectl get pvc -n yf-test # 查看 pv 列表 $: kubectl get pv # 查看 namespace 列表 $: kubectl get namespaces # 分区配额限制 $: kubectl get resourcequota -n yf-test $: kubectl describe resourcequota yf-test -n yf-test # 创建命名空间 $: kubectl create namespace yf-test $: kubectl get sc --all-namespaces -o wide # 查看某个资源的详细信息 $: kubectl describe pods calico-node-bmfqh -n kube-system $: kubectl describe pods coredns-6d8c4cb4d-4xdsv -n kube-system # 查看 密钥 $: kubectl get secret docker-secret -o jsonpath='{.data}' $: kubectl get secret --all-namespaces -o wide $: kubectl describe secret docker-secret $: echo 'MWYyZDFlMmU2N2Rm' | base64 --decode # 查看配置 $: kubectl get configmap --all-namespaces -o wide # 删除 pod $: kubectl delete pod coredns-6d8c4cb4d-4xdsv -n kube-system # 查看某个 pod 的日志 $: kubectl logs coredns-6d8c4cb4d-4xdsv -n kube-system $: kubectl logs coredns-6d8c4cb4d-4xdsv --all-containers -n kube-system # 进入容器 $: kubectl exec -it yf-api-deployment-f4ff84b49-g62bk -n yf-test -c nginx -- sh # 验证集群可用性 $: kubectl get nodes -owide # 查看集群健康情况 $: kubectl get cs $: kubeadm token list ``` ~~~ vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static DEFROUTE=yes ONBOOT=yes IPADDR=192.168.11.67 NETMASK=255.255.255.0 GATEWAY=192.168.11.1 DNS1=114.114.114.114 DNS2=223.5.5.5 DNS3=1.1.1.1 DNS4=8.8.8.8 ~~~ ```shell ip addr service network restart systemctl stop firewalld.service systemctl disable firewalld.service systemctl status firewalld.service vi /etc/resolv.conf ``` ---- 容器别名 ```shell $: alias calicoctl="kubectl exec -i -n kube-system calicoctl -- /calicoctl" ``` ---- ~~~ ⚡ root@k8s-master  ~/kubernetes/install  kubectl get pods --all-namespaces -o wide NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES kube-system calico-kube-controllers-cd8566cf-dq5k6 1/1 Running 1 (9m54s ago) 22m 10.244.235.198 k8s-master <none> <none> kube-system calico-node-8kf6k 1/1 Running 1 (17m ago) 22m 192.168.11.91 k8s-node2 <none> <none> kube-system calico-node-bvwc8 1/1 Running 1 (9m55s ago) 22m 192.168.11.67 k8s-master <none> <none> kube-system calico-node-r7fc9 1/1 Running 0 22m 192.168.11.90 k8s-node1 <none> <none> kube-system coredns-6d8c4cb4d-4q6lb 1/1 Running 0 2m19s 10.244.36.65 k8s-node1 <none> <none> kube-system coredns-6d8c4cb4d-p6jl7 1/1 Running 0 3m49s 10.244.169.129 k8s-node2 <none> <none> kube-system etcd-k8s-master 1/1 Running 4 (9m55s ago) 5h3m 192.168.11.67 k8s-master <none> <none> kube-system kube-apiserver-k8s-master 1/1 Running 4 (9m53s ago) 5h3m 192.168.11.67 k8s-master <none> <none> kube-system kube-controller-manager-k8s-master 1/1 Running 7 (9m55s ago) 5h3m 192.168.11.67 k8s-master <none> <none> kube-system kube-proxy-gqjg4 1/1 Running 2 (18m ago) 113m 192.168.11.91 k8s-node2 <none> <none> kube-system kube-proxy-mvjb8 1/1 Running 3 (18m ago) 113m 192.168.11.90 k8s-node1 <none> <none> kube-system kube-proxy-ssbdr 1/1 Running 4 (9m55s ago) 5h2m 192.168.11.67 k8s-master <none> <none> kube-system kube-scheduler-k8s-master 1/1 Running 6 (9m54s ago) 5h3m 192.168.11.67 k8s-master <none> <none> ~~~ ~~~ coredns ports: 8080 8181/ready 53 9153 ~~~ coredns 要这样处理下(不需要,是节点 nfs-utils 没安装的问题) https://blog.csdn.net/qq_40806970/article/details/99845808 ```shell $: kubectl edit cm coredns -n kube-system # loop 注释 # 删除 pod ``` coredns 默认有两个副本,如果 pod 不正常,删除 pod 重建后就会恢复(调度到 非 master 节点上后正常)。 ---- ### 理解 Kubernetes 对象 Kubernetes 对象是持久化的实体,用来表示 集群状态,和指示其 如何 运行应用容器,及容器所需资源等。 ---- ### Pod **更新策略** [Pod 更新与替换](https://kubernetes.io/zh-cn/docs/concepts/workloads/pods/#pod-update-and-replacement) Pod 的绝大多数元数据都是不可变的。例如,你不可以改变其 namespace、name、 uid 或者 creationTimestamp 字段;generation 字段是比较特别的, 如果更新该字段,只能增加字段取值而不能减少。 1. 其它字段更新都会导致触发“更新策略”吗? 2. 如果没有字段需要变更,就是想触发“更新策略”如何实现,如镜像更新了,但是标签名不变的情况? 用 env 字段 ---- ### 容器 Kubernetes 中的抽象允许你将容器化的应用部署到集群,而无需将它们绑定到某个特定的独立计算机。为了使用这种新的部署模型,应用需要以将应用与单个主机分离的方式打包:它们需要被容器化。与过去的那种应用直接以包的方式深度与主机集成的部署模型相比,容器化应用更灵活、更可用。 Kubernetes 以更高效的方式跨集群自动分发和调度应用容器 **容器运行时** 如 Docker ,负责从仓库中提取容器镜像,运行应用容器。 ---- ### Service Service可以起到对pod负载均衡的作用,主要有3种service type(ClusterIP,NodePort,LoadBalance),其中type为ClusterIP时有2种情况,clusterIP设置为None时,我们把它称为headless service,这个headless service与普通的service有什么区别呢? headless service设置clusterIP为None,那么在k8s集群中,kube-proxy就不对其进行代理,则集群内部对象在访问该服务时将返回服务的全部pod的ip,开发者可以根据这些ip列表自己做负载均衡。我们对以上说法进行下证明 https://blog.csdn.net/RIGHTSONG/article/details/114917562 > NodePort 随机分配一个集群内唯一的端口,访问任意节点ip的该端口都能找到服务 (而不论节点上是否有该 pod ,不过直接访问 pod 所在节点的ip 应该更快一点)。 1. 每个 Pod 都有自己的 虚拟ip 2. Pod 内镜像网络互通(不是容器环境互通,而是通过 kube-proxy 实现的网络互通) 3. 东西流量(集群内部流量) 完全可以通过 服务名(Pod虚拟ip)互通,端口就是 容器的指定端口。 ---- ### 命名空间 在 Kubernetes 中,名字空间(Namespace) 提供一种机制,将同一集群中的资源划分为相互隔离的组。 同一名字空间内的资源名称要唯一,但跨名字空间时没有这个要求。 名字空间作用域仅针对带有名字空间的对象, (例如 Deployment、Service 等),这种作用域对集群范围的对象 (例如 StorageClass、Node、PersistentVolume 等)不适用。 如: yf --- ### 节点 分为 主节点 和 工作节点,主节点 调度 pod 在工作节点运行。 ---- ### 网络 ---- ### pod 运行容器的负载,k8s 最小调度点。 ---- ### statfulset ---- ### 卷 ---- ### 持久存储 节点选择 ---- ### 节点选择 节点选择控制,节点亲和性 ---- ### 负载均衡 基于 DNS 和 Service 的 两层负载均衡 ~~~ DNS 域名解析负载均衡 www.domain.com / | \ / | \ --------------------------------------------------------------------------- DNS 的负载均衡太简单,这里还可以加一层厂商的负载均衡 如 SLB,不过成本不低 --------------------------------------------------------------------------- / | \ / | \ Ingress node 192.168.0.1 192.168.0.2 192.168.0.3 ... | \ \ Service svc-A svc-B svc-C ... |\ \ | \ \ | \ \ | \ \ | \ \ | \ \ | \ \ | \ \ | \ \ | \ \ pod pod-a-1(node1) pod-a-2(node2) pod-a-3(node3) ... 无状态 pod 横向水平扩展 ~~~ 部署 Ingress Controller 的节点充当内部服务与外部的桥梁,服务与 pod 节点之间也有一层负载均衡。 Ingress Controller 负载最好单独固定使用几个节点,上面不进行其它工作 pod 负载,网络和 cpu 配置要好,并针对网络程序进行优化。 无状态 pod 副本可无限水平扩容,理论上只要节点足够,负载提升就没有上限。 > 如果自行安装高可用组件的话 (HAProxy, keepalived),会有一个虚拟ip 绑定到某一个节点上(keepalived 会确保虚拟ip 一直绑定到可用的节点上),此后访问这个虚拟ip 就会根据一定的机制被路由的某一个节点上,以此实现高可用。 ---- ### ConfigMap ---- ### 日志 ---- ### 监控 ---- ### 滚动发布 ---- ### DaemonSet DaemonSet 保证满足条件的节点只会部署一个 pod ,需要注意的是这里 “只会部署一个 pod ” 是指 该 pod 在一个节点上只会部署一个 而不是指一个节点只能有一个 DaemonSet pod,一个节点可以有多个 DaemonSet pod,如 可部署多个不同的 DaemonSet pod: logstash , Prometheus Node Exporter, kube-proxy ---- ### 计划任务 ---- ### 安装 helm ```shell $: mkdir helm && cd helm #$: wget https://get.helm.sh/helm-v3.12.1-linux-amd64.tar.gz $: wget https://yf5gcar.oss-cn-shanghai.aliyuncs.com/org/helm-v3.12.1-linux-amd64.tar.gz $: tar -zxvf helm-v3.12.1-linux-amd64.tar.gz $: mv linux-amd64/helm /usr/local/bin/helm $: helm version # 阿里云 helm 仓库 $: helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts $: helm repo add aliyun https://apphub.aliyuncs.com/stable ``` ```shell $: helm list --all-namespaces $: helm delete xxx -n xxx-namespace ``` ---- ### 部署 Ingress https://kubernetes.github.io/ingress-nginx/deploy/#bare-metal-clusters **install for helm:** ```shell # 添加仓库 $: helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx # 查看仓库列表 $: helm repo list # 搜索 ingress-nginx $: helm search repo ingress-nginx # 下载安装包 $: helm pull ingress-nginx/ingress-nginx --version 4.7.0 $: tar -zxvf ingress-nginx-4.7.0.tgz ``` 配置参数 调整 (除了安装 helm ,这些可以跳过, ingress-nginx-4.7.0 已准备好,直接安装就可以了。) ~~~ # 修改 values.yaml 镜像地址:修改为国内镜像 registry: registry.cn-hangzhou.aliyuncs.com image: google_containers/nginx-ingress-controller image: google_containers/kube-webhook-certgen tag: v1.3.0 hostNetwork: true dnsPolicy: ClusterFirstWithHostNet 修改部署配置的 kind: DaemonSet nodeSelector: ingress: "true" # 增加选择器,如果 node 上有 ingress=true 就部署 将 admissionWebhooks.enabled 修改为 false 将 service 中的 type 由 LoadBalancer 修改为 ClusterIP,如果服务器是云平台才用 LoadBalancer ~~~ ```shell # 为需要部署 ingress 的节点上加标签 $: kubectl label nodes k8s-node1 ingress=true $: kubectl get nodes --show-labels # 删除节点 # 注意,不要直接 非法删除 节点服务器(如直接释放节点主机),应该是这个 这个命令删除节点,不然的话会造成集群状态异常,此时可以尝试 重启 主节点服务器 reboot $: kubectl delete nodes k8s-node-xxx # 安装 ingress-nginx $: kubectl create namespace ingress-nginx $: helm install ingress-nginx ./ingress-nginx-4.7.0 -n ingress-nginx ``` ~~~ 遇到 镜像下载失败时,修改 镜像地址 kubectl edit ds ingress-nginx-controller -n ingress-nginx image: registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v1.8.0 ~~~ ```shell $: kubectl get pods --all-namespaces -o wide # 在 ingress 节点上查看,可以看到 ingress-nginx 已经启动了,接下来 配置我们的 ingress 资源就好了 $: netstat -antup | grep 80 $: netstat -antup | grep 443 ``` ---- ### 外部访问集群 [运维 - 01.kubernetes笔记 Pod及 Security Context安全上下文 - 个人文章 - SegmentFault 思否](https://segmentfault.com/a/1190000040651880?utm_source=sf-similar-article) > 提示没有SSL认证 因为.kube/config秘钥格式curl无法识别 > 解决办法是让 kubectl proxy 实现https会话卸载 通过kubectl---->API service相互认证 curl通过http访问 kubectl映射端口 [kubectl proxy 让外部网络访问K8S service的ClusterIP - 尘叶心繁的专栏 - TNBLOG](http://tnblog.net/hb/article/details/4681) ```shell # master 上执行 $: kubectl proxy --address='0.0.0.0' --accept-hosts='^*$' # server: https 改为 http,ip 改为 外网ip,端口 改为 8001 # http://124.222.180.179:8001 $: cat ~/.kube/config ``` 这样在 Lens 中就可以导入集群使用了,不过感觉 UI 也不是很好用,命令行反而还更快更方便些。 ---- ### 配置默认存储类 ```shell # 为空说明没有配置存储类 $: kubectl get storageclass $: kubectl get sc ``` **安装 NFS 存储类** https://kubernetes.io/zh-cn/docs/concepts/storage/storage-classes/#nfs https://github.com/kubernetes-sigs/nfs-ganesha-server-and-external-provisioner ```shell $: cd install/nfs # k8s-node2 节点上部署 nfs 服务 $: kubectl label nodes k8s-node2 nfs=true # 每个节点上安装 (否则使用时可能挂载失败) $: yum install -y nfs-utils # 部署 nfs 服务 $: kubectl apply -f deployment.yaml $: kubectl apply -f rbac.yaml # 创建 nfs 存储类 (提供者: example.com/nfs Service 实现) $: kubectl apply -f class.yaml # 创建 pvc $: kubectl apply -f claim.yaml # 默认已自动制备 pv $: kubectl get pv # 测试 pod 挂载 pv $: kubectl apply -f write-pod.yaml $: kubectl apply -f read-pod.yaml # 设置默认存储类 $: kubectl patch storageclass example-nfs -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' # IsDefaultClass: Yes $: kubectl describe sc example-nfs # 可以看到默认存储类设置完成 $: kubectl get sc NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE example-nfs (default) example.com/nfs Delete Immediate false 27m ``` ---- **国外镜像无法拉取问题:** 遇到国内下载不了的镜像可以先看看 registry.cn-hangzhou.aliyuncs.com/google_containers 中有没有, 如果没有就去 https://labs.play-with-docker.com 上白嫖国外的服务器来下载镜像 再打标签推到阿里镜像仓库上自己用就行了,出口转内销了啊,不对,应该是 走私进口 ^_^,嗯,曲线救国。 ```shell $: docker pull registry.k8s.io/sig-storage/nfs-provisioner:v4.0.8 $: docker login registry.cn-hangzhou.aliyuncs.com --username=811800545@qq.com $: docker tag registry.k8s.io/sig-storage/nfs-provisioner:v4.0.8 registry.cn-hangzhou.aliyuncs.com/yf5g/sig-storage-nfs-provisioner:v4.0.8 $: docker push registry.cn-hangzhou.aliyuncs.com/yf5g/sig-storage-nfs-provisioner:v4.0.8 $: docker pull registry.cn-hangzhou.aliyuncs.com/yf5g/sig-storage-nfs-provisioner:v4.0.8 ``` ---- ### 在 Kubernetes 上安装 KubeSphere 注意: 1. 安装前一定要确认 集群需要已配置默认 StorageClass,否则安装会失败 2. 如果安装失败,请执行 `kubesphere-delete.sh` 完全卸载后再重新安装 3. 必须保证节点资源至少 4C-8G (DevOps 节点可能需要 16G 内存) 4. 可插拔组件 也支持 安装后再启用,所有安装时可以先按照如下最小安装 [在 Kubernetes 上最小化安装 KubeSphere](https://www.kubesphere.io/zh/docs/v3.3/quick-start/minimal-kubesphere-on-k8s/) [启用可插拔组件](https://www.kubesphere.io/zh/docs/v3.3/pluggable-components/) kubesphere 版本: v3.3.2 使用端口: NodePort (IP:30880) 默认帐户: admin/P@88w0rd 建议安装组件: ~~~ KubeSphere 监控系统 ✔ KubeSphere DevOps系统 ✔ KubeSphere 事件系统 x KubeSphere 告警和通知 x KubeSphere 应用商店 x KubeSphere 日志系统 x KubeSphere 服务网格 x ~~~ ```shell $: cd install/kubesphere # $: wget https://github.com/kubesphere/ks-installer/releases/download/v3.3.2/kubesphere-installer.yaml # 下载后编辑文件 # $: wget https://github.com/kubesphere/ks-installer/releases/download/v3.3.2/cluster-configuration.yaml $: kubectl apply -f kubesphere-installer.yaml $: kubectl apply -f cluster-configuration.yaml # 检查安装情况 $: kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l 'app in (ks-install, ks-installer)' -o jsonpath='{.items[0].metadata.name}') -f $: kubectl get svc/ks-console -n kubesphere-system # 访问 NodeIP:NodePort 登录控制台 124.221.89.233:30880 ``` ```shell # 卸载 $: chmod +x ./kubesphere-delete.sh && ./kubesphere-delete.sh ``` 常见问题: https://www.cnblogs.com/cosmos-wong/p/15759645.html ---- ### 记一次 网络故障 集群容器内无法访问外网域名 因为之前 非常规删除过一次 节点,后面再出现了一个 coredns 不正常的情况。 ```shell kubectl -n kube-system edit cm coredns -o yaml ``` 找到原因了:是节点 nfs-utils 没安装的问题 coredns 默认有两个副本,如果 pod 不正常,删除 pod 重建后就会恢复(调度到 非 master 节点上后正常)。 ---- ### 问题排查步骤 **集群问题** ```shell # 查看日志 $: journalctl -xeu kubelet # 查看状态 $: systemctl status kubelet # 检查端口 $: netstat -antup | grep 6443 # 查看集群状态 $: kubectl get cs ``` **节点问题** ```shell # 查看节点列表 $: kubectl get nodes -o wide $: kubectl get nodes --show-labels # 查看节点信息 # 查看 NotReady 原因 $: kubectl describe nodes k8s-node2 # 查看 coredns-xxxxxxx-xxx 状态(至少两个 pod ,不能在 master 上,如果不正常可以尝试删除) $: kubectl get pods -n kube-system -o wide # 查看 pod 详情 $: kubectl describe pods coredns-xxxxxxx-xxx -n kube-system # 删除 pod $: kubectl delete pods coredns-xxxxxxx-xxx -n kube-system ``` **Pod 问题** ```shell # 查看 pod 列表 $: kubectl get pods --all-namespaces -o wide $: kubectl get pods -n kube-system -o wide $: kubectl get pods -n yf-test -o wide # 查看 pod 详情 $: kubectl describe pods yf-api-deployment-f4ff84b49-g62bk -n yf-test # 获取 pod yaml 格式的配置 $: kubectl get pods yf-api-deployment-f4ff84b49-g62bk -n yf-test -o yaml # 查看 deployment 详情 $: kubectl describe deployment yf-api-deployment -n yf-test # 编辑 deployment $: kubectl edit deployment yf-api-deployment -n yf-test # 获取 deployment yaml 格式的配置 $: kubectl get deployment yf-api-deployment -n yf-test -o yaml # 查看某个 pod 的日志 $: kubectl logs coredns-6d8c4cb4d-4xdsv -n kube-system $: kubectl logs coredns-6d8c4cb4d-4xdsv --all-containers -n kube-system # 进入容器 $: kubectl exec -it yf-api-deployment-f4ff84b49-g62bk -n yf-test -c nginx -- sh # 显示 DaemonSet 列表 $: kubectl get ds --all-namespaces ``` **服务问题** ```shell # 查看 services 列表 $: kubectl get svc --all-namespaces -o wide $: kubectl describe svc nginx-svc # 查看 ingress 列表 $: kubectl get ingress --all-namespaces -o wide ``` **pv/pvc** ```shell # 获取 存储类 列表 $: kubectl get sc --all-namespaces -o wide # 查看 pvc 列表 $: kubectl get pvc -n yf-test # 查看 pv 列表 $: kubectl get pv ``` **secret/configmap** ```shell # 查看 密钥 $: kubectl get secret docker-secret -o jsonpath='{.data}' $: kubectl get secret --all-namespaces -o wide $: kubectl describe secret docker-secret $: echo 'MWYyZDFlMmU2N2Rm' | base64 --decode # 查看配置 $: kubectl get configmap --all-namespaces -o wide ``` **** **kubesphere 流水线问题** 1. 流水线编辑 把 node 都选 base 再试一下 2. 重新创建 devops-jenkins, devops-controller 负载试一下 http://101.133.137.104:30880/clusters/default/projects/kubesphere-devops-system/deployments/devops-jenkins/resource-status 3. 删除 base pod 试试,http://101.133.137.104:30180/computer/ base 节点删除试试(也有同步删除) 4. 重启 Jenkins 试试 http://101.133.137.104:30180/restart 5. 先把等待的流水线任务全部停止