|
|
|
@@ -4,8 +4,6 @@ import com.alibaba.fastjson2.JSON; |
|
|
|
import com.ruoyi.platform.constant.Constant; |
|
|
|
import com.ruoyi.platform.domain.DevEnvironment; |
|
|
|
import com.ruoyi.platform.mapper.ComputingResourceDao; |
|
|
|
import io.fabric8.kubernetes.api.model.SecurityContext; |
|
|
|
import io.fabric8.kubernetes.api.model.SecurityContextBuilder; |
|
|
|
import io.kubernetes.client.Exec; |
|
|
|
import io.kubernetes.client.custom.IntOrString; |
|
|
|
import io.kubernetes.client.custom.Quantity; |
|
|
|
@@ -15,6 +13,7 @@ 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; |
|
|
|
@@ -64,9 +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 = 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异常"); |
|
|
|
|