已经使用helm图表成功地部署了一个应用程序,但是我无法理解我应该使用哪个url来访问它,..Here是Helm为这个web应用程序创建的Nodeport服务:
kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
demo-springboot-demoweb NodePort 10.101.86.143 <none> 8080:31384/TCP 11m
xxxxxxx@xxxxxxxx5 charts % kubectl describe svc
Name: demo-springboot-demoweb
Namespace: springboot-demoweb
Labels: app=springboot-demoweb
app.kubernetes.io/managed-by=Helm
chart=springboot-demoweb-0.1.0
heritage=Helm
release=demo
Annotations: meta.helm.sh/release-name: demo
meta.helm.sh/release-namespace: springboot-demoweb
Selector: app=springboot-demoweb,release=demo
Type: NodePort
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.101.86.143
IPs: 10.101.86.143
Port: nginx 8080/TCP
TargetPort: 8080/TCP
NodePort: nginx 31384/TCP
Endpoints: 172.17.0.15:8080
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>发布于 2022-07-01 15:40:15
您已经部署了一个使用NodePort服务公开的应用程序。
这意味着集群的所有节点都在同一个端口上公开应用程序--端口号是协调的。
因此,您需要其中一个节点的ip来访问集群。您可以使用kubectl get nodes -o wide获取节点和IP地址。如果它是一个本地集群,它将显示为INTERNAL IP。
$ kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
minikube Ready control-plane,master 155m v1.23.3 192.168.49.2 <none> Ubuntu 20.04.2 LTS 5.15.0-37-generic docker://20.10.12将其中一个is与您的NodePort ( 31384 )一起使用。在我的例子中,应该是:http://192.168.49.2:31384
https://stackoverflow.com/questions/72831399
复制相似问题