mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
perf: k8s ack、tke 支持重启ingress
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
## 一、源码安装
|
||||
|
||||
### 环境要求
|
||||
- nodejs 20 及以上
|
||||
- nodejs 22 及以上
|
||||
### 源码启动
|
||||
```shell
|
||||
# 克隆代码
|
||||
|
||||
@@ -150,4 +150,18 @@ export class K8sClient {
|
||||
this.logger.info("ingress patched", opts.body);
|
||||
return res;
|
||||
}
|
||||
|
||||
async restartIngress(namespace: string, ingressNames: string[], labels: any) {
|
||||
const body = {
|
||||
metadata: {
|
||||
labels: {
|
||||
...labels,
|
||||
},
|
||||
},
|
||||
};
|
||||
for (const ingress of ingressNames) {
|
||||
await this.patchIngress({ namespace, ingressName: ingress, body });
|
||||
this.logger.info(`ingress已重启:${ingress}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user