-
Notifications
You must be signed in to change notification settings - Fork 6
/
ecommerce-kubernet.yaml
61 lines (61 loc) · 1.43 KB
/
ecommerce-kubernet.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: ecommerce-app
labels:
app: ecommerce-app
spec:
replicas: 1
selector:
matchLabels:
app: ecommerce-app
template:
metadata:
labels:
app: ecommerce-app
spec:
containers:
- name: ecommerce-app
image: nikhil382/ecommerce-gin-clean-arch
ports:
- containerPort: 8000
env:
- name: DB_USER
valueFrom:
secretKeyRef:
name: postgres-secret
key: postgres-user
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-secret
key: postgres-password
- name: DB_NAME
valueFrom:
secretKeyRef:
name: postgres-secret
key: postgres-db
- name: DB_HOST
valueFrom:
configMapKeyRef:
name: ecommerce-config
key: postgres-host
- name: DB_PORT
valueFrom:
configMapKeyRef:
name: ecommerce-config
key: postgres-port
---
apiVersion: v1
kind: Service
metadata:
name: ecommerce-service
spec:
selector:
app: ecommerce-app
type: LoadBalancer
ports:
- protocol: TCP
port: 8000
targetPort: 8000
nodePort: 30001