Skip to content

Commit f5ffcf2

Browse files
committed
removed postgres db from backend deploy
1 parent 62a5ee1 commit f5ffcf2

1 file changed

Lines changed: 11 additions & 28 deletions

File tree

kubernetes/backend-deployment.yaml

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,51 +21,34 @@ spec:
2121
image: docker0y4sh/todo-backend:latest
2222
imagePullPolicy: Always
2323

24-
# --- Environment variables to connect to the database ---
25-
# This whole section is specific to the backend.
26-
env:
27-
- name: DB_USERNAME
28-
valueFrom:
29-
secretKeyRef:
30-
# IMPORTANT: Ensure this is the correct name of your secret!
31-
# In previous messages, it was 'postgresql-credentials'.
32-
name: my-postgresql-credentials
33-
key: username
34-
- name: DB_PASSWORD
35-
valueFrom:
36-
secretKeyRef:
37-
name: my-postgresql-credentials
38-
key: password
39-
- name: DB_HOST
40-
value: my-postgresql-rw.default.svc.cluster.local
41-
- name: DB_PORT
42-
value: "5432"
43-
- name: DB_NAME
44-
value: goals_database # Or whatever your DB is named
45-
24+
# --- The 'env' section for the database can be added in future ---
25+
4626
ports:
4727
# The port your Go Gin application listens on.
4828
- containerPort: 8080
4929

5030
# --- Health Checks for the Go Application ---
31+
# It's good practice to keep these. Your Go app should have a
32+
# simple /health endpoint that just returns a 200 OK status.
5133
readinessProbe:
5234
httpGet:
53-
path: /health # Your Go app must have a GET /health endpoint
35+
path: /api/health # You should create this simple endpoint in Go
5436
port: 8080
5537
initialDelaySeconds: 5
5638
periodSeconds: 10
5739
livenessProbe:
5840
httpGet:
59-
path: /health
41+
path: /api/health
6042
port: 8080
6143
initialDelaySeconds: 15
6244
periodSeconds: 20
6345

6446
# --- Resource allocation for the Go backend ---
47+
# The resource requests can be lower now since there is no database connection pool.
6548
resources:
6649
requests:
67-
memory: "350Mi"
68-
cpu: "250m"
50+
memory: "128Mi"
51+
cpu: "100m"
6952
limits:
70-
memory: "500Mi"
71-
cpu: "500m"
53+
memory: "256Mi"
54+
cpu: "250m"

0 commit comments

Comments
 (0)