0

我在 python 中创建了“helloworld”应用程序并将其 dockerised 并将我的图像推送到 docker hub 存储库中。然后将其部署在 Kubernetes 仪表板中。

Kubernetes 中的服务

这是我的 yaml 文件

    {
  "kind": "Service",
  "apiVersion": "v1",
  "metadata": {
    "name": "helloworld2",
    "namespace": "default",
    "selfLink": "/api/v1/namespaces/default/services/helloworld2",
    "uid": "d522c798-3639-11e9-9694-0800278c22c8",
    "resourceVersion": "16642",
    "creationTimestamp": "2019-02-22T00:36:02Z",
    "labels": {
      "k8s-app": "helloworld2"
    }
  },
  "spec": {
    "ports": [
      {
        "name": "tcp-30001-8080-ljs7r",
        "protocol": "TCP",
        "port": 30001,
        "targetPort": 8080,
        "nodePort": 30935
      }
    ],
    "selector": {
      "k8s-app": "helloworld2"
    },
    "clusterIP": "10.107.196.133",
    "type": "NodePort",
    "sessionAffinity": "None",
    "externalTrafficPolicy": "Cluster"
  },
  "status": {
    "loadBalancer": {}
  }
}

当我尝试访问我的服务时,我得到了这个

无法访问网站

不知道我错过了什么。请帮忙

4

0 回答 0