Skip to content

Commit fe9010d

Browse files
authored
chore: add limits to k8s + update redis image (#475)
* chore: add limits to k8s + update redis image * fix: app container port
1 parent 015cdcd commit fe9010d

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

k8s/bib.yaml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
imagePullPolicy: Always
2525
ports:
2626
- name: http
27-
containerPort: 80
27+
containerPort: 8000
2828
protocol: TCP
2929
volumeMounts:
3030
- name: datasets
@@ -36,6 +36,10 @@ spec:
3636
envFrom:
3737
- secretRef:
3838
name: bib-secrets-env
39+
resources:
40+
limits:
41+
memory: "8Gi"
42+
cpu: "1000m"
3943
securityContext:
4044
allowPrivilegeEscalation: false
4145
capabilities:
@@ -67,6 +71,10 @@ spec:
6771
envFrom:
6872
- secretRef:
6973
name: bib-secrets-env
74+
resources:
75+
limits:
76+
memory: "4Gi"
77+
cpu: "1000m"
7078
securityContext:
7179
allowPrivilegeEscalation: false
7280
capabilities:
@@ -81,17 +89,20 @@ spec:
8189
- |
8290
celery -A sources.celery:app worker -B -l info -c 1 --pidfile=/tmp/celery_pid --schedule /tmp/celery-schedule.db
8391
- name: redis
84-
image: "redis:5.0.4"
85-
command:
86-
- redis-server
92+
image: "redis:7"
8793
imagePullPolicy: IfNotPresent
88-
volumeMounts:
89-
- name: redis-data
90-
mountPath: /data
94+
command:
95+
- "redis-server"
96+
- "--max-memory"
97+
- "256mb"
9198
ports:
9299
- name: redis
93100
containerPort: 6379
94101
protocol: TCP
102+
resources:
103+
limits:
104+
memory: "512Mi"
105+
cpu: "500m"
95106
securityContext:
96107
allowPrivilegeEscalation: false
97108
capabilities:
@@ -104,24 +115,21 @@ spec:
104115
- name: datasets
105116
emptyDir:
106117
sizeLimit: 5Gi
107-
- name: redis-data
108-
emptyDir:
109-
sizeLimit: 1Gi
110118
- name: tmp
111119
emptyDir:
112120
sizeLimit: 1Gi
113121
---
114122
apiVersion: v1
115123
kind: Service
116124
metadata:
117-
name: service
125+
name: bibxml
118126
labels:
119-
app: service
127+
app: bibxml
120128
spec:
121129
type: ClusterIP
122130
ports:
123131
- port: 80
124-
targetPort: 8000
132+
targetPort: http
125133
protocol: TCP
126134
name: http
127135
selector:

k8s/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
namespace: bib
2-
namePrefix: bib-
32
resources:
43
- bib.yaml

0 commit comments

Comments
 (0)