Skip to content

Commit 5b3b1d5

Browse files
authored
Merge pull request #117 from weaveworks/memory-requirements
Increase memory and CPU limits. Add docs on memory and CPU consumption.
2 parents 5445f2a + a4e5064 commit 5b3b1d5

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

config/manager/manager.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,11 @@ spec:
5858
# - linux
5959
securityContext:
6060
runAsNonRoot: true
61-
# TODO(user): For common cases that do not require escalating privileges
62-
# it is recommended to ensure that all your Pods/Containers are restrictive.
6361
# More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
6462
# Please uncomment the following code if your project does NOT have to work on old Kubernetes
6563
# versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ).
66-
# seccompProfile:
67-
# type: RuntimeDefault
64+
seccompProfile:
65+
type: RuntimeDefault
6866
containers:
6967
- command:
7068
- /manager
@@ -77,6 +75,8 @@ spec:
7775
capabilities:
7876
drop:
7977
- "ALL"
78+
seccompProfile:
79+
type: RuntimeDefault
8080
livenessProbe:
8181
httpGet:
8282
path: /healthz
@@ -89,14 +89,12 @@ spec:
8989
port: 8081
9090
initialDelaySeconds: 5
9191
periodSeconds: 10
92-
# TODO(user): Configure the resources accordingly based on the project requirements.
93-
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
9492
resources:
9593
limits:
96-
cpu: 500m
97-
memory: 128Mi
94+
cpu: 1000m
95+
memory: 1Gi
9896
requests:
99-
cpu: 10m
97+
cpu: 100m
10098
memory: 64Mi
10199
serviceAccountName: controller-manager
102100
terminationGracePeriodSeconds: 10

docs/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,28 @@ For example to enable only the `List` and `GitRepository` generators:
14091409

14101410
When a GitOpsSet that uses disabled generators is created, the disabled generators will be silently ignored.
14111411

1412+
## Kubernetes Process Limits
1413+
1414+
GitOpsSets can be memory-hungry, for example, the Matrix generator will generate a cartesian result with multiple copies of data.
1415+
1416+
The OCI and GitRepository generators will extract tarballs, the API Generator queries upstream APIs and parses the JSON, and the Config generators will load `Secret` and `ConfigMap` resources, all these can lead to using significant amounts of memory.
1417+
1418+
Extracting tarballs can also prove to be CPU intensive, especially where there are lots of files, and you have a very frequent regeneration period.
1419+
1420+
To this end, you will need to monitor the controller metrics, and maybe increase the limits available to the controller.
1421+
1422+
For example, to increase the amount of memory available to the controller:
1423+
1424+
```yaml
1425+
resources:
1426+
limits:
1427+
cpu: 1000m
1428+
memory: 2Gi
1429+
requests:
1430+
cpu: 100m
1431+
memory: 64Mi
1432+
```
1433+
14121434
## Notifications
14131435

14141436
Events are enabled which will trigger Kubernetes events when successful reconciliation occurs with a `Normal` event or when reconciliation fails with an `Error` event. Fluxcd's [Events](https://pkg.go.dev/github.com/fluxcd/pkg/runtime/events) package is used including the `EventRecorder` to record these events.

0 commit comments

Comments
 (0)