Skip to content

Commit 83bbcc4

Browse files
Add CPU limit to PostgreSQL container
The PostgreSQL container was missing a CPU limit while having memory limits set. Add CPU limit of 500m to match the approach of ensuring all containers have both CPU and memory limits defined.
1 parent 0948bd9 commit 83bbcc4

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

internal/controller/postgres_deployment.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ func buildPostgresPodTemplateSpec() corev1.PodTemplateSpec {
149149
corev1.ResourceMemory: resource.MustParse("300Mi"),
150150
},
151151
Limits: corev1.ResourceList{
152+
corev1.ResourceCPU: resource.MustParse("500m"),
152153
corev1.ResourceMemory: resource.MustParse("2Gi"),
153154
},
154155
},

test/kuttl/common/openstack-lightspeed-instance/assert-openstack-lightspeed-instance.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ kind: Deployment
4141
metadata:
4242
name: lightspeed-postgres-server
4343
namespace: openstack-lightspeed
44+
spec:
45+
template:
46+
spec:
47+
containers:
48+
- name: lightspeed-postgres-server
49+
resources:
50+
requests:
51+
cpu: 30m
52+
memory: 300Mi
53+
limits:
54+
cpu: 500m
55+
memory: 2Gi
4456
status:
4557
replicas: 1
4658
readyReplicas: 1

test/kuttl/tests/update-openstacklightspeed/08-assert-openstacklightspeed-update.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ kind: Deployment
2323
metadata:
2424
name: lightspeed-postgres-server
2525
namespace: openstack-lightspeed
26+
spec:
27+
template:
28+
spec:
29+
containers:
30+
- name: lightspeed-postgres-server
31+
resources:
32+
requests:
33+
cpu: 30m
34+
memory: 300Mi
35+
limits:
36+
cpu: 500m
37+
memory: 2Gi
2638
status:
2739
replicas: 1
2840
readyReplicas: 1

0 commit comments

Comments
 (0)