apiVersion: v1
kind: Service
metadata:
  name: my-service
  namespace: cncamp
spec:
  selector:
    app: "httpserver"
  type: NodePort  ### 浏览器可以直接访问
  ports:
    - name: my-service
      port: 80   ###
      targetPort: 80  ### Pod的访问端口
      protocol: TCP
      nodePort: 31666  ### 机器上开的端口，浏览器访问