Browse Source

修改配置

dev-complex-computation
chenzhihang 1 year ago
parent
commit
b0e3f2660b
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/K8sClientUtil.java

+ 6
- 4
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/K8sClientUtil.java View File

@@ -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异常");


Loading…
Cancel
Save