forked from arunksingh16/istio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkubernetes.yaml
99 lines (96 loc) · 1.75 KB
/
kubernetes.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
apiVersion: apps/v1
kind: Deployment
metadata:
name: flaskfrontend
labels:
app: flaskfrontend
version: v1
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: flaskfrontend
version: v1
template:
metadata:
labels:
app: flaskfrontend
version: v1
spec:
containers:
- name: flaskfrontend
image: "singharunk/flaskfrontend:latest"
imagePullPolicy: "Always"
env:
- name: nspace
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: SERVICE_X
value: "flaskbackend.$(nspace).svc.cluster.local"
- name: SERVICE_X_PORT
value: "6000"
ports:
- containerPort: 5000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: flaskbackend
labels:
app: flaskbackend
version: v1
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: flaskbackend
version: v1
template:
metadata:
labels:
app: flaskbackend
version: v1
spec:
containers:
- name: flaskbackend
image: "singharunk/flaskbackend:latest"
imagePullPolicy: "Always"
ports:
- containerPort: 6000
---
apiVersion: v1
kind: Service
metadata:
name: flaskfrontend
labels:
app: flaskfrontend
spec:
type: ClusterIP
ports:
- port: 5000
protocol: TCP
name: http
targetPort: 5000
selector:
app: flaskfrontend
---
apiVersion: v1
kind: Service
metadata:
name: flaskbackend
labels:
app: flaskbackend
spec:
type: ClusterIP
ports:
- port: 6000
protocol: TCP
name: http
targetPort: 6000
selector:
app: flaskbackend