-
Notifications
You must be signed in to change notification settings - Fork 0
/
service.yaml
20 lines (19 loc) · 853 Bytes
/
service.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
kind: Service
apiVersion: v1
metadata:
# can be the same, must not be, however
name: webserver
spec:
selector:
# this HAS to have exactly the same value of one (or more)
# of the labels defined in the pod.
app: webserver
# defines which port(s) we are going to expose
ports:
- name: http
port: 80 # port of the running service
nodePort: 30080 # outside world port. A limitation of NodePorts is that the number of the port has to be greater than 30000.
# the type of service defines to where we want to expose
# type: ClusterIp # exposes the service only internally for kubernetes cluster
type: NodePort # exposes service port to the outside world
# type: LoadBallancer # exposes service using a LoadBallancer. Not supported on clusters that do not have an integrated load ballancer (such as minikube).