Skip to content

Commit ec202c5

Browse files
Merge pull request #15 from daniel-learns-with-coursera/add-kubernetes
Added Kubernetes support
2 parents bb38754 + 0b9cb51 commit ec202c5

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

deploy/deployment.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
creationTimestamp: null
5+
labels:
6+
app: accounts
7+
name: accounts
8+
spec:
9+
replicas: 3
10+
selector:
11+
matchLabels:
12+
app: accounts
13+
strategy: {}
14+
template:
15+
metadata:
16+
creationTimestamp: null
17+
labels:
18+
app: accounts
19+
spec:
20+
containers:
21+
- image: us.icr.io/sn-labs-coursera1308/accounts:1
22+
name: accounts
23+
resources: {}
24+
25+
env:
26+
- name: DATABASE_HOST
27+
value: postgresql
28+
- name: DATABASE_NAME
29+
valueFrom:
30+
secretKeyRef:
31+
name: postgresql
32+
key: database-name
33+
- name: DATABASE_PASSWORD
34+
valueFrom:
35+
secretKeyRef:
36+
name: postgresql
37+
key: database-password
38+
- name: DATABASE_USER
39+
valueFrom:
40+
secretKeyRef:
41+
name: postgresql
42+
key: database-user
43+
44+
status: {}

deploy/service.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
creationTimestamp: null
5+
labels:
6+
app: accounts
7+
name: accounts
8+
spec:
9+
ports:
10+
- port: 8080
11+
protocol: TCP
12+
targetPort: 8080
13+
selector:
14+
app: accounts
15+
type: ClusterIP
16+
status:
17+
loadBalancer: {}

0 commit comments

Comments
 (0)