-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservices.yaml
52 lines (49 loc) · 1.41 KB
/
services.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# note: YAML definitions for multiple components/resources can be bundled together into one YAML file
# '---' is used to separate the definitions of the components/resources
# define a service for the mongodb server
apiVersion: v1
kind: Service
metadata:
name: mongodb-service
spec:
selector:
app: mongodb
ports:
- protocol: TCP
port: 27017
targetPort: 27017
---
# define a service for mongo-express
# set the type to LoadBalancer and configure the ports
# don't forget to specify a nodePort as well! a nodePort exposes the pod to applications outside the cluster. this will allow you to access the frontend admin interface from your host system
apiVersion: v1
kind: Service
metadata:
name: mongo-express
spec:
selector:
app: mongo-express
type: LoadBalancer
ports:
- protocol: TCP
port: 8081
targetPort: 8081
nodePort: 30001
---
# define a `Service` for flask-app
# set the type to LoadBalancer and configure the ports
# don't forget to specify a nodePort as well! a nodePort exposes the pod to applications outside the cluster. this will allow you to access the frontend admin interface from your host system
apiVersion: v1
kind: Service
metadata:
name: flaskapi
spec:
ports:
- port: 5001
protocol: TCP
targetPort: 5001
selector:
app: flaskapi
type: LoadBalancer
# contain permanent ip address that can be attached for each pod
# Also act as load balancer