|
|
|
@ -17,14 +17,10 @@ import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
|
public class K8sClientTest {
|
|
|
|
|
|
|
|
|
|
public static void getAllPodList() throws IOException, ApiException {
|
|
|
|
|
//Master /root/.kube/config文件拷贝过来
|
|
|
|
|
String kubeConfigPath = PathKit.getRootClassPath() + "\\.kube\\config";
|
|
|
|
|
if (!new File(kubeConfigPath).exists()) {
|
|
|
|
|
System.out.println("kubeConfig不存在,跳过");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//Master /root/.kube/config文件拷贝过来
|
|
|
|
|
public static String kubeConfigPath = PathKit.getRootClassPath() + "\\.kube\\config";
|
|
|
|
|
|
|
|
|
|
public static void getAllPodList() throws IOException, ApiException {
|
|
|
|
|
ApiClient apiClient = ClientBuilder.kubeconfig(KubeConfig.loadKubeConfig(new FileReader(kubeConfigPath))).build();
|
|
|
|
|
// new a CoreV1Api
|
|
|
|
|
CoreV1Api api = new CoreV1Api(apiClient);
|
|
|
|
|