-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.k8s.yaml
87 lines (87 loc) · 2 KB
/
app.k8s.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
kind: Service
apiVersion: v1
metadata:
name: database-service
namespace: default
spec:
type: ExternalName
externalName: 10.0.2.2
ports:
- port: 5432
targetPort: 5432
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: spring-rest-base-app
labels:
app: spring-rest-base-app
tier: back-end
spec:
selector:
app: spring-rest-base-app
type: NodePort
ports:
- name: spring-rest-base-app
port: 8080
protocol: TCP
targetPort: 8080
nodePort: 30080
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: spring-rest-base-app
spec:
replicas: 1
template:
metadata:
labels:
app: spring-rest-base-app
tier: backend
spec:
containers:
- name: spring-rest-base-app
image: fabiosoaza/spring-rest-base-app
env:
- name: DB_HOST
value: database-service
- name: DB_NAME
valueFrom:
configMapKeyRef:
name: properties
key: db_name
- name: DB_PORT
valueFrom:
configMapKeyRef:
name: properties
key: db_port
- name: DB_USER
valueFrom:
configMapKeyRef:
name: properties
key: db_user
- name: DB_PASS
valueFrom:
configMapKeyRef:
name: properties
key: db_pass
- name: SSL_MODE
valueFrom:
configMapKeyRef:
name: properties
key: ssl_mode
- name: MANAGEMENT_USER
valueFrom:
configMapKeyRef:
name: properties
key: management_user
- name: MANAGEMENT_PASS
valueFrom:
configMapKeyRef:
name: properties
key: management_pass
ports:
- containerPort: 8080
imagePullPolicy: IfNotPresent