From 325c6b1d2fe47e5bb93d5c6bdc49575b0769c177 Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Fri, 22 Nov 2024 14:47:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=82=E8=BD=BD=E4=BF=AE=E6=94=B9=E4=B8=BAju?= =?UTF-8?q?icefs=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/platform/utils/K8sClientUtil.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/K8sClientUtil.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/K8sClientUtil.java index 012b1c71..bbc81b3b 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/K8sClientUtil.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/K8sClientUtil.java @@ -12,7 +12,9 @@ import io.kubernetes.client.openapi.ApiException; import io.kubernetes.client.openapi.apis.AppsV1Api; import io.kubernetes.client.openapi.apis.CoreV1Api; import io.kubernetes.client.openapi.models.*; +import io.kubernetes.client.util.ClientBuilder; import io.kubernetes.client.util.Config; +import io.kubernetes.client.util.credentials.AccessTokenAuthentication; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.json.JSONObject; @@ -61,10 +63,10 @@ public class K8sClientUtil { this.http = http; this.token = token; try { -// this.apiClient = new ClientBuilder(). -// setBasePath(http).setVerifyingSsl(false). -// setAuthentication(new AccessTokenAuthentication(token)).build(); - this.apiClient = Config.fromCluster(); + this.apiClient = new ClientBuilder(). + setBasePath(http).setVerifyingSsl(false). + setAuthentication(new AccessTokenAuthentication(token)).build(); +// this.apiClient = Config.fromCluster(); } catch (Exception e) { log.error("构建K8s-Client异常", e); throw new RuntimeException("构建K8s-Client异常");