Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. kind: Service
  2. apiVersion: v1
  3. metadata:
  4. name: simple-service
  5. spec:
  6. # Expose the service on a static port on each node
  7. # so that we can access the service from outside the cluster
  8. type: NodePort
  9.  
  10. # When the node receives a request on the static port (30123) (port2-def)
  11. # and dynamic port for port1-abc
  12. # "select pods with the label 'app' set to 'service-test-app'"
  13. # and forward the request to one of them
  14. selector:
  15. app: service-test-app
  16.  
  17. ports:
  18. # Three types of ports for a service
  19. # nodePort - a static port assigned on each the node
  20. # port - port exposed internally in the cluster
  21. # targetPort - the container port to send requests to
  22. - nodePort:
  23. port: 8080
  24. targetPort: 80
  25. name: port1-abc
  26.  
  27. - nodePort: 30123
  28. port: 8081
  29. targetPort: 81
  30. name: port2-def
  31. protocol: UDP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement