Skip to content

Commit cf9b3c0

Browse files
committed
Bump default memory limit for controller manager to 512Mi
In tests it was seen that the openstack-operator controller manager reaches just bellow the current set limit of 256Mi. This change bumps the default to 512Mi for all controller managers, except the openstack-operator-controller-operator which could be customized using the CSV. It also introduces a MANAGER_MEMORY_LIMIT env var in the CSV which can be used to change the memory limit of all the other controller managers. Jira: OSPRH-16802 Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
1 parent a65506a commit cf9b3c0

8 files changed

Lines changed: 14 additions & 7 deletions

File tree

bindata/operator/managers.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{{ $leaseDuration := .LeaseDuration }}
44
{{ $renewDeadline := .RenewDeadline }}
55
{{ $retryPeriod := .RetryPeriod }}
6+
{{ $managerMemoryLimit := .ManagerMemoryLimit }}
67
{{ range $operatorName, $operatorImage := .OperatorImages }}
78
apiVersion: apps/v1
89
kind: Deployment
@@ -62,7 +63,7 @@ spec:
6263
resources:
6364
limits:
6465
cpu: 500m
65-
memory: 256Mi
66+
memory: '{{ $managerMemoryLimit }}'
6667
requests:
6768
cpu: 10m
6869
memory: 128Mi

bindata/operator/operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ spec:
107107
resources:
108108
limits:
109109
cpu: 500m
110-
memory: 256Mi
110+
memory: '{{ .ManagerMemoryLimit }}'
111111
requests:
112112
cpu: 10m
113113
memory: 128Mi

bindata/operator/rabbit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
resources:
4343
limits:
4444
cpu: 200m
45-
memory: 500Mi
45+
memory: '{{ .ManagerMemoryLimit }}'
4646
requests:
4747
cpu: 5m
4848
memory: 64Mi

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ spec:
7676
resources:
7777
limits:
7878
cpu: 500m
79-
memory: 256Mi
79+
memory: '{{ .ManagerMemoryLimit }}'
8080
requests:
8181
cpu: 10m
8282
memory: 128Mi

config/operator/deployment/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ spec:
7575
value: 20
7676
- name: RETRY_PERIOD
7777
value: 5
78+
- name: MANAGER_MEMORY_LIMIT
79+
value: 512Mi
7880
image: controller:latest
7981
name: operator
8082
securityContext:

config/operator/managers.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{{ $leaseDuration := .LeaseDuration }}
44
{{ $renewDeadline := .RenewDeadline }}
55
{{ $retryPeriod := .RetryPeriod }}
6+
{{ $managerMemoryLimit := .ManagerMemoryLimit }}
67
{{ range $operatorName, $operatorImage := .OperatorImages }}
78
apiVersion: apps/v1
89
kind: Deployment
@@ -62,7 +63,7 @@ spec:
6263
resources:
6364
limits:
6465
cpu: 500m
65-
memory: 256Mi
66+
memory: '{{ $managerMemoryLimit }}'
6667
requests:
6768
cpu: 10m
6869
memory: 128Mi

config/operator/rabbit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
resources:
4343
limits:
4444
cpu: 200m
45-
memory: 500Mi
45+
memory: '{{ .ManagerMemoryLimit }}'
4646
requests:
4747
cpu: 5m
4848
memory: 64Mi

controllers/operator/openstack_controller.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ var (
7474
leaseDuration string
7575
renewDeadline string
7676
retryPeriod string
77+
managerMemoryLimit string
7778
)
7879

7980
// SetupEnv -
@@ -109,8 +110,9 @@ func SetupEnv() {
109110
renewDeadline = envArr[1]
110111
} else if envArr[0] == "RETRY_PERIOD" {
111112
retryPeriod = envArr[1]
113+
} else if envArr[0] == "MANAGER_MEMORY_LIMIT" {
114+
managerMemoryLimit = envArr[1]
112115
}
113-
114116
}
115117
}
116118

@@ -467,6 +469,7 @@ func (r *OpenStackReconciler) applyOperator(ctx context.Context, instance *opera
467469
data.Data["LeaseDuration"] = leaseDuration
468470
data.Data["RenewDeadline"] = renewDeadline
469471
data.Data["RetryPeriod"] = retryPeriod
472+
data.Data["ManagerMemoryLimit"] = managerMemoryLimit
470473
data.Data["OpenStackServiceRelatedImages"] = envRelatedOpenStackServiceImages
471474
return r.renderAndApply(ctx, instance, data, "operator", true)
472475
}

0 commit comments

Comments
 (0)