Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- kind: Service
- apiVersion: v1
- metadata:
- name: simple-service
- spec:
- # Expose the service on a static port on each node
- # so that we can access the service from outside the cluster
- type: NodePort
- # When the node receives a request on the static port (30123) (port2-def)
- # and dynamic port for port1-abc
- # "select pods with the label 'app' set to 'service-test-app'"
- # and forward the request to one of them
- selector:
- app: service-test-app
- ports:
- # Three types of ports for a service
- # nodePort - a static port assigned on each the node
- # port - port exposed internally in the cluster
- # targetPort - the container port to send requests to
- - nodePort:
- port: 8080
- targetPort: 80
- name: port1-abc
- - nodePort: 30123
- port: 8081
- targetPort: 81
- name: port2-def
- protocol: UDP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement