5.2.2 访问该应用

  kubectl apply -f svc.yaml

apiVersion: v1
kind: Service
metadata:
  name: hello-svc
  labels:
    app: hello-world
spec:
  type: NodePort
  ports:
  - port: 8080
    nodePort: 30001
    protocol: TCP
  selector:
    app: hello-world

部署好后,通过集群中任一节点和端口号30001访问

 

posted @ 2024-06-26 14:04  ~技术小白  阅读(13)  评论(0)    收藏  举报