这是我第一次阅读Kubernetes教程。我在无头Ubuntu服务器上安装了Docker、Kubectl和Minikube (18.04)。我是这样经营迷你库的-
minikube start --vm-driver=none我有一个本地码头映像,它在端口9110上运行restful服务。我创建一个部署并像这样公开它-
kubectl run hello-node --image=dbtemplate --port=9110 --image-pull-policy=Never
kubectl expose deployment hello-node --type=NodePort 我的服役状况-
# kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-node NodePort 10.98.104.45 <none> 9110:32651/TCP 39m
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 3h2m
# kubectl describe services hello-node
Name: hello-node
Namespace: default
Labels: run=hello-node
Annotations: <none>
Selector: run=hello-node
Type: NodePort
IP: 10.98.104.45
Port: <unset> 9110/TCP
TargetPort: 9110/TCP
NodePort: <unset> 32651/TCP
Endpoints: 172.17.0.5:9110
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
# minikube ip
192.168.1.216如您所见,该服务可在172.17.0.5的内部IP上使用。
是否有办法将此服务映射到/公开在父主机的IP上,即192.168.1.216。我想要192.168.1.216:9110的服务。
发布于 2019-01-07 05:13:11
我想minikube tunnel可能就是你要找的。https://github.com/kubernetes/minikube/blob/master/docs/networking.md
LoadBalancer类型的服务可以通过minikube tunnel命令公开。
https://stackoverflow.com/questions/54068442
复制相似问题