Skip to content

Commit

Permalink
Request basic memory for antrea-controller (#6233)
Browse files Browse the repository at this point in the history
Starting with K8s v1.22, system-cluster-critical Pods no longer get low
OOM score like system-node-critical Pods. antrea-controller's OOM score
adjustment was changed from -997 to 999 passively, which made it just
have a bit higher chance of survival over best-effort Pods (OOM score
adjustment: 1000). While it's hard to say how much memory it can use as
it's highly related to the scale of the cluster, we can add a basic
memory request which can decrease the score a bit according to the
formula for burstable Pods:

  oomScoreAdjust := 1000 - (1000*memoryRequest)/memoryCapacity

It should also be a bit helpful to avoid antrea-controller to be
scheduled on a Node with very few available memory.

Signed-off-by: Quan Tian <[email protected]>
  • Loading branch information
tnqn committed Apr 17, 2024
1 parent f684c2d commit 4bc74d2
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/charts/antrea/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Kubernetes: `>= 1.16.0-0`
| controller.antreaController.extraEnv | object | `{}` | Extra environment variables to be injected into antrea-controller. |
| controller.antreaController.logFileMaxNum | int | `4` | Max number of log files. |
| controller.antreaController.logFileMaxSize | int | `100` | Max size in MBs of any single log file. |
| controller.antreaController.resources | object | `{"requests":{"cpu":"200m"}}` | Resource requests and limits for the antrea-controller container. |
| controller.antreaController.resources | object | `{"requests":{"cpu":"200m","memory":"100Mi"}}` | Resource requests and limits for the antrea-controller container. |
| controller.apiNodePort | int | `0` | NodePort for the antrea-controller APIServer to server on. |
| controller.apiPort | int | `10349` | Port for the antrea-controller APIServer to serve on. |
| controller.enablePrometheusMetrics | bool | `true` | Enable metrics exposure via Prometheus. |
Expand Down
1 change: 1 addition & 0 deletions build/charts/antrea/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ controller:
resources:
requests:
cpu: "200m"
memory: "100Mi"

flowExporter:
# -- Enable the flow exporter feature.
Expand Down
1 change: 1 addition & 0 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7044,6 +7044,7 @@ spec:
resources:
requests:
cpu: 200m
memory: 100Mi
command: ["antrea-controller"]
# Log to both "/var/log/antrea/" and stderr (so "kubectl logs" can work).
args:
Expand Down
1 change: 1 addition & 0 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7045,6 +7045,7 @@ spec:
resources:
requests:
cpu: 200m
memory: 100Mi
command: ["antrea-controller"]
# Log to both "/var/log/antrea/" and stderr (so "kubectl logs" can work).
args:
Expand Down
1 change: 1 addition & 0 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7042,6 +7042,7 @@ spec:
resources:
requests:
cpu: 200m
memory: 100Mi
command: ["antrea-controller"]
# Log to both "/var/log/antrea/" and stderr (so "kubectl logs" can work).
args:
Expand Down
1 change: 1 addition & 0 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7101,6 +7101,7 @@ spec:
resources:
requests:
cpu: 200m
memory: 100Mi
command: ["antrea-controller"]
# Log to both "/var/log/antrea/" and stderr (so "kubectl logs" can work).
args:
Expand Down
1 change: 1 addition & 0 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7042,6 +7042,7 @@ spec:
resources:
requests:
cpu: 200m
memory: 100Mi
command: ["antrea-controller"]
# Log to both "/var/log/antrea/" and stderr (so "kubectl logs" can work).
args:
Expand Down

0 comments on commit 4bc74d2

Please sign in to comment.