Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 177
- # Creating a service to expose the webserver pods
- apiVersion: v1
- kind: Service
- metadata:
- name: webserver-service # Name of the service
- spec:
- type: NodePort # Exposing the service to the world outside the cluster
- selector:
- app: httpd # Selecting the pods labeled as "httpd"
- ports:
- - nodePort: 30123 # Port number used to access the service from outside the cluster
- port: 80 # Port number used within the cluster
- targetPort: 80 # Port number the service should forward traffic to on the pods
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement