-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathk8s-quickstart.yml
114 lines (110 loc) · 2.04 KB
/
k8s-quickstart.yml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql5
namespace: ase-ns-00
spec:
selector:
matchLabels:
app: mysql5
replicas: 1
template:
metadata:
labels:
app: mysql5
spec:
containers:
- name: mysql5
image: registry.cn-shanghai.aliyuncs.com/xywu/mysql5:demo
imagePullPolicy: IfNotPresent
env:
- name: MYSQL_ROOT_PASSWORD
value: "password"
ports:
- containerPort: 3306
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: student-server
namespace: ase-ns-00
spec:
selector:
matchLabels:
app: student-server
template:
metadata:
labels:
app: student-server
spec:
containers:
- name: student-server
image: registry.cn-shanghai.aliyuncs.com/xywu/student-server:demo
imagePullPolicy: Always
env:
- name: USERNAME
value: "root"
- name: PASSWORD
value: "password"
- name: DB_URL
value: "mysql5:3306/student"
ports:
- containerPort: 9999
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
namespace: ase-ns-00
spec:
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
containers:
- name: frontend
image: registry.cn-shanghai.aliyuncs.com/xywu/frontend:demo
imagePullPolicy: Always
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: mysql5
namespace: ase-ns-00
spec:
ports:
- port: 3306
selector:
app: mysql5
---
apiVersion: v1
kind: Service
metadata:
name: student-server
namespace: ase-ns-00
spec:
ports:
- port: 9999
selector:
app: student-server
---
apiVersion: v1
kind: Service
metadata:
name: frontend
namespace: ase-ns-00
spec:
type: LoadBalancer
selector:
app: frontend
ports:
- protocol: TCP
port: 1024
targetPort: 80