Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/345.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 访问kubernetes群集显示超时_Java_Kubernetes - Fatal编程技术网

Java 访问kubernetes群集显示超时

Java 访问kubernetes群集显示超时,java,kubernetes,Java,Kubernetes,当我尝试使用Java应用程序访问Kubernetes集群时,我发现连接超时。当我尝试通过curl连接到集群时http://localhost:8080或curlhttps://localhost:6443,表示连接被拒绝。我试图解决此问题,但失败。要访问群集,请使用以下命令启动代理: kubectl代理 [root@masterpkg]#kubectl代理 从127.0.0.1:8001开始发球 然后从另一个终端 卷曲 其他方法可以做到这一点 -使用以下命令获取您的IP群集: kubectl集群

当我尝试使用Java应用程序访问Kubernetes集群时,我发现连接超时。当我尝试通过
curl连接到集群时http://localhost:8080
或curl
https://localhost:6443
,表示连接被拒绝。我试图解决此问题,但失败。

要访问群集,请使用以下命令启动代理: kubectl代理

[root@masterpkg]#kubectl代理 从127.0.0.1:8001开始发球

然后从另一个终端

卷曲

其他方法可以做到这一点 -使用以下命令获取您的IP群集: kubectl集群信息

   for example :

     kubectl cluster-info

     Kubernetes master is running at https://xxx.xxx.xxx.xxx:6443
然后做: 卷曲——不安全

可能此时您会发现您必须提供证书
访问群集。

能否向我们展示您用于访问K8s的代码片段?能否分享一些您如何部署该服务的yaml?