-
Notifications
You must be signed in to change notification settings - Fork 2
/
web-app.yaml
59 lines (59 loc) · 1.37 KB
/
web-app.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
# Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: spring-deployment
labels:
app: spring
spec:
replicas: 2
selector:
matchLabels:
app: spring
template:
metadata:
labels:
app: spring
spec:
containers:
- name: spring
image: spring-app:1.0
imagePullPolicy: Never
ports:
- containerPort: 8080
env:
- name: DB_USR
valueFrom:
secretKeyRef:
name: postgres-secret
key: psql-user
- name: DB_PSW
valueFrom:
secretKeyRef:
name: postgres-secret
key: psql-password
- name: POSTGRES_HOST
valueFrom:
configMapKeyRef:
name: postgres-config
key: postgres-service-url
- name: SPRING_PROFILES_ACTIVE
valueFrom:
configMapKeyRef:
name: web-app-config
key: active-profile
---
# Service
apiVersion: v1
kind: Service
metadata:
name: spring-service
spec:
type: ClusterIP # Internal Service (NodePort => external service)
selector:
app: spring
ports:
- protocol: TCP
port: 8080
targetPort: 8080
# nodePort: 30100 # only for external services (not recommended)