1.30 k8s pods查询

This commit is contained in:
dengqichen 2025-12-13 22:00:22 +08:00
parent 2ce817b978
commit bd1f7fe89e

View File

@ -662,11 +662,11 @@ public class K8sServiceIntegrationImpl extends BaseExternalSystemIntegration imp
timestamp timestamp
); );
// 使用strategic merge patch更新Deployment明确指定patch类型 // 使用strategic merge patch更新Deployment
api.patchNamespacedDeployment( api.patchNamespacedDeployment(
deploymentName, deploymentName,
namespace, namespace,
new io.kubernetes.client.custom.V1Patch(patchBody, io.kubernetes.client.custom.V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH), new io.kubernetes.client.custom.V1Patch(patchBody),
null, null,
null, null,
null, null,
@ -706,11 +706,11 @@ public class K8sServiceIntegrationImpl extends BaseExternalSystemIntegration imp
// 构建patch内容更新spec.replicas // 构建patch内容更新spec.replicas
String patchBody = String.format("{\"spec\":{\"replicas\":%d}}", replicas); String patchBody = String.format("{\"spec\":{\"replicas\":%d}}", replicas);
// 使用strategic merge patch更新Deployment的scale明确指定patch类型 // 使用strategic merge patch更新Deployment的scale
api.patchNamespacedDeploymentScale( api.patchNamespacedDeploymentScale(
deploymentName, deploymentName,
namespace, namespace,
new io.kubernetes.client.custom.V1Patch(patchBody, io.kubernetes.client.custom.V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH), new io.kubernetes.client.custom.V1Patch(patchBody),
null, null,
null, null,
null, null,