Skip to content

Commit 7938e81

Browse files
authored
Merge pull request #1631 from TessaIO/chore-add-resources-limits-and-requests
chore/deployment: add resources requests and limits for helm and Kustomize
2 parents 1696c65 + d02414c commit 7938e81

File tree

6 files changed

+64
-49
lines changed

6 files changed

+64
-49
lines changed

deployment/base/gc/gc.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ spec:
1919
- name: nfd-gc
2020
image: gcr.io/k8s-staging-nfd/node-feature-discovery:master
2121
imagePullPolicy: Always
22+
resources:
23+
limits:
24+
cpu: 20m
25+
memory: 1Gi
26+
requests:
27+
cpu: 10m
28+
memory: 128Mi
2229
command:
2330
- "nfd-gc"
2431
ports:

deployment/base/master/master-deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ spec:
2121
- name: nfd-master
2222
image: gcr.io/k8s-staging-nfd/node-feature-discovery:master
2323
imagePullPolicy: Always
24+
resources:
25+
limits:
26+
cpu: 300m
27+
memory: 4Gi
28+
requests:
29+
cpu: 100m
30+
memory: 128Mi
2431
livenessProbe:
2532
grpc:
2633
port: 8082

deployment/base/topologyupdater-daemonset/topologyupdater-daemonset.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ spec:
2222
command:
2323
- "nfd-topology-updater"
2424
args: []
25+
resources:
26+
limits:
27+
cpu: 100m
28+
memory: 60Mi
29+
requests:
30+
cpu: 50m
31+
memory: 40Mi
2532
ports:
2633
- name: metrics
2734
containerPort: 8081

deployment/base/worker-daemonset/worker-daemonset.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ spec:
3232
failureThreshold: 10
3333
command:
3434
- "nfd-worker"
35+
resources:
36+
limits:
37+
cpu: 200m
38+
memory: 512Mi
39+
requests:
40+
cpu: 5m
41+
memory: 64Mi
3542
args:
3643
- "-server=nfd-master:8080"
3744
ports:

deployment/helm/node-feature-discovery/values.yaml

Lines changed: 28 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,13 @@ master:
9494
type: ClusterIP
9595
port: 8080
9696

97-
resources: {}
98-
# We usually recommend not to specify default resources and to leave this as a conscious
99-
# choice for the user. This also increases chances charts run on environments with little
100-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
101-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
102-
# limits:
103-
# cpu: 100m
104-
# memory: 128Mi
105-
# requests:
106-
# cpu: 100m
107-
# memory: 128Mi
97+
resources:
98+
limits:
99+
cpu: 300m
100+
memory: 4Gi
101+
requests:
102+
cpu: 100m
103+
memory: 128Mi
108104

109105
nodeSelector: {}
110106

@@ -425,17 +421,13 @@ worker:
425421
# Does not work on systems without /usr/src AND a read-only /usr, such as Talos
426422
mountUsrSrc: false
427423

428-
resources: {}
429-
# We usually recommend not to specify default resources and to leave this as a conscious
430-
# choice for the user. This also increases chances charts run on environments with little
431-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
432-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
433-
# limits:
434-
# cpu: 100m
435-
# memory: 128Mi
436-
# requests:
437-
# cpu: 100m
438-
# memory: 128Mi
424+
resources:
425+
limits:
426+
cpu: 200m
427+
memory: 512Mi
428+
requests:
429+
cpu: 5m
430+
memory: 64Mi
439431

440432
nodeSelector: {}
441433

@@ -483,17 +475,13 @@ topologyUpdater:
483475
readOnlyRootFilesystem: true
484476
runAsUser: 0
485477

486-
resources: {}
487-
# We usually recommend not to specify default resources and to leave this as a conscious
488-
# choice for the user. This also increases chances charts run on environments with little
489-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
490-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
491-
# limits:
492-
# cpu: 100m
493-
# memory: 128Mi
494-
# requests:
495-
# cpu: 100m
496-
# memory: 128Mi
478+
resources:
479+
limits:
480+
cpu: 100m
481+
memory: 60Mi
482+
requests:
483+
cpu: 50m
484+
memory: 40Mi
497485

498486
nodeSelector: {}
499487
tolerations: []
@@ -517,17 +505,13 @@ gc:
517505

518506
podSecurityContext: {}
519507

520-
resources: {}
521-
# We usually recommend not to specify default resources and to leave this as a conscious
522-
# choice for the user. This also increases chances charts run on environments with little
523-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
524-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
525-
# limits:
526-
# cpu: 100m
527-
# memory: 128Mi
528-
# requests:
529-
# cpu: 100m
530-
# memory: 128Mi
508+
resources:
509+
limits:
510+
cpu: 20m
511+
memory: 1Gi
512+
requests:
513+
cpu: 10m
514+
memory: 128Mi
531515

532516
metricsPort: 8081
533517

docs/deployment/helm.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ API's you need to install the prometheus operator in your cluster.
131131
| `master.rbac.create` | bool | true | Specifies whether to create [RBAC][rbac] configuration for nfd-master |
132132
| `master.service.type` | string | ClusterIP | NFD master service type. **NOTE**: this parameter is related to the deprecated gRPC API and will be removed with it in a future release |
133133
| `master.service.port` | integer | 8080 | NFD master service port. **NOTE**: this parameter is related to the deprecated gRPC API and will be removed with it in a future release |
134-
| `master.resources` | dict | {} | NFD master pod [resources management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
135-
| `master.nodeSelector` | dict | {} | NFD master pod [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) |
134+
| `master.resources.limits` | dict | {cpu: 300m, memory: 4Gi} | NFD master pod [resources limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) |
135+
| `master.resources.requests`| dict | {cpu: 100m, memory: 128Mi} | NFD master pod [resources requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) |
136136
| `master.tolerations` | dict | _Scheduling to master node is disabled_ | NFD master pod [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
137137
| `master.annotations` | dict | {} | NFD master pod [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) |
138138
| `master.affinity` | dict | | NFD master pod required [node affinity](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/) |
@@ -155,7 +155,8 @@ API's you need to install the prometheus operator in your cluster.
155155
| `worker.serviceAccount.name` | string | | The name of the service account to use for nfd-worker. If not set and create is true, a name is generated using the fullname template (suffixed with `-worker`) |
156156
| `worker.rbac.create` | bool | true | Specifies whether to create [RBAC][rbac] configuration for nfd-worker |
157157
| `worker.mountUsrSrc` | bool | false | Specifies whether to allow users to mount the hostpath /user/src. Does not work on systems without /usr/src AND a read-only /usr |
158-
| `worker.resources` | dict | {} | NFD worker pod [resources management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
158+
| `worker.resources.limits` | dict | {cpu: 200m, memory: 512Mi} | NFD worker pod [resources limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) |
159+
| `worker.resources.requests` | dict | {cpu: 5m, memory: 64Mi} | NFD worker pod [resources requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) |
159160
| `worker.nodeSelector` | dict | {} | NFD worker pod [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) |
160161
| `worker.tolerations` | dict | {} | NFD worker pod [node tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
161162
| `worker.priorityClassName` | string | | NFD worker pod [priority class](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/) |
@@ -180,7 +181,8 @@ API's you need to install the prometheus operator in your cluster.
180181
| `topologyUpdater.watchNamespace` | string | `*` | Namespace to watch pods, `*` for all namespaces |
181182
| `topologyUpdater.podSecurityContext` | dict | {} | [PodSecurityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) holds pod-level security attributes and common container settings |
182183
| `topologyUpdater.securityContext` | dict | {} | Container [security settings](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) |
183-
| `topologyUpdater.resources` | dict | {} | Topology updater pod [resources management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
184+
| `topologyUpdater.resources.limits` | dict | {cpu: 100m, memory: 60Mi} | NFD Topology Updater pod [resources limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) |
185+
| `topologyUpdater.resources.requests` | dict | {cpu: 50m, memory: 40Mi} | NFD Topology Updater pod [resources requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) |
184186
| `topologyUpdater.nodeSelector` | dict | {} | Topology updater pod [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) |
185187
| `topologyUpdater.tolerations` | dict | {} | Topology updater pod [node tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
186188
| `topologyUpdater.annotations` | dict | {} | Topology updater pod [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) |
@@ -202,7 +204,8 @@ API's you need to install the prometheus operator in your cluster.
202204
| `gc.rbac.create` | bool | true | Specifies whether to create [RBAC][rbac] configuration for garbage collector |
203205
| `gc.interval` | string | 1h | Time between periodic garbage collector runs |
204206
| `gc.podSecurityContext` | dict | {} | [PodSecurityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) holds pod-level security attributes and common container settings |
205-
| `gc.resources` | dict | {} | Garbage collector pod [resources management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
207+
| `gc.resources.limits` | dict | {cpu: 20m, memory: 1Gi} | NFD Garbage Collector pod [resources limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) |
208+
| `gc.resources.requests` | dict | {cpu: 10m, memory: 128Mi} | NFD Garbage Collector pod [resources requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) |
206209
| `gc.metricsPort` | integer | 8081 | Port on which to serve Prometheus metrics |
207210
| `gc.nodeSelector` | dict | {} | Garbage collector pod [node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) |
208211
| `gc.tolerations` | dict | {} | Garbage collector pod [node tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |

0 commit comments

Comments
 (0)