Advertisement
supermaca

Untitled

Mar 18th, 2023
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.53 KB | None | 0 0
  1. # 177
  2. # Creating a service to expose the webserver pods
  3. apiVersion: v1
  4. kind: Service
  5. metadata:
  6.   name: webserver-service  # Name of the service
  7. spec:
  8.   type: NodePort  # Exposing the service to the world outside the cluster
  9.   selector:
  10.     app: httpd  # Selecting the pods labeled as "httpd"
  11.   ports:
  12.     - nodePort: 30123  # Port number used to access the service from outside the cluster
  13.       port: 80  # Port number used within the cluster
  14.       targetPort: 80  # Port number the service should forward traffic to on the pods
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement