-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_deployment.yaml
More file actions
55 lines (53 loc) · 1.21 KB
/
app_deployment.yaml
File metadata and controls
55 lines (53 loc) · 1.21 KB
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: springboot-k8s-deployment
spec:
selector:
matchLabels:
app: springboot-k8s-mysql
replicas: 4
template:
metadata:
labels:
app: springboot-k8s-mysql
spec:
containers:
- name: springboot-k8s-deployment
image: spring-k8s-deployment:1.0
ports:
- containerPort: 8080
env:
- name: DB_HOST
valueFrom:
configMapKeyRef:
name: db-config
key: host
- name: DB_NAME
valueFrom:
configMapKeyRef:
key: dbName
name: db-config
- name: DB_USERNAME
valueFrom:
secretKeyRef:
name: mysql-secrets
key: username
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: mysql-secrets
---
apiVersion: v1
kind: Service
metadata:
name: springboot-k8s-svc
spec:
selector:
app: springboot-k8s-mysql
ports:
- protocol: "TCP"
port: 8080
targetPort: 8080
type: NodePort