无法连接到服务器:拨打tcp 192.168.99.100:8443:getsockopt:没有到主机的路由

时间:2018-05-30 17:56:07

标签: kubernetes

这是我的YAML文件:

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: tomcat-deployment
spec:
  selector:
    matchLabels:
      app: tomcat
  replicas: 1
  template:
    metadata:
      labels:
        app: tomcat
    spec:
      containers:
      - name: tomcat
        image: tomcat:9.0
        ports:
        - containerPort: 8080

当我运行命令kubectl apply -f ./deployment.yaml时,出现以下错误:Unable to connect to the server: dial tcp 192.168.99.100:8443: getsockopt: no route to host

我该如何解决这个问题?

使用kubectl version,它获得了客户端版本:

version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

1 个答案:

答案 0 :(得分:0)

请尝试curl https://192.168.99.100:8443

如果端口8443已打开,您应该获得与证书相关的信息,例如:

curl: (60) SSL certificate problem: unable to get local issuer certificate

如果未打开,请确保将其暴露在外面。