Skip to content

Commit d02414c

Browse files
committed
chore/deployment: add resources requests and limits for helm and Kustomize
Signed-off-by: TessaIO <[email protected]>
1 parent 0132544 commit d02414c

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
@@ -21,6 +21,13 @@ spec:
2121
imagePullPolicy: Always
2222
command:
2323
- "nfd-worker"
24+
resources:
25+
limits:
26+
cpu: 200m
27+
memory: 512Mi
28+
requests:
29+
cpu: 5m
30+
memory: 64Mi
2431
args:
2532
- "-server=nfd-master:8080"
2633
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

@@ -411,17 +407,13 @@ worker:
411407
# Does not work on systems without /usr/src AND a read-only /usr, such as Talos
412408
mountUsrSrc: false
413409

414-
resources: {}
415-
# We usually recommend not to specify default resources and to leave this as a conscious
416-
# choice for the user. This also increases chances charts run on environments with little
417-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
418-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
419-
# limits:
420-
# cpu: 100m
421-
# memory: 128Mi
422-
# requests:
423-
# cpu: 100m
424-
# memory: 128Mi
410+
resources:
411+
limits:
412+
cpu: 200m
413+
memory: 512Mi
414+
requests:
415+
cpu: 5m
416+
memory: 64Mi
425417

426418
nodeSelector: {}
427419

@@ -469,17 +461,13 @@ topologyUpdater:
469461
readOnlyRootFilesystem: true
470462
runAsUser: 0
471463

472-
resources: {}
473-
# We usually recommend not to specify default resources and to leave this as a conscious
474-
# choice for the user. This also increases chances charts run on environments with little
475-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
476-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
477-
# limits:
478-
# cpu: 100m
479-
# memory: 128Mi
480-
# requests:
481-
# cpu: 100m
482-
# memory: 128Mi
464+
resources:
465+
limits:
466+
cpu: 100m
467+
memory: 60Mi
468+
requests:
469+
cpu: 50m
470+
memory: 40Mi
483471

484472
nodeSelector: {}
485473
tolerations: []
@@ -503,17 +491,13 @@ gc:
503491

504492
podSecurityContext: {}
505493

506-
resources: {}
507-
# We usually recommend not to specify default resources and to leave this as a conscious
508-
# choice for the user. This also increases chances charts run on environments with little
509-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
510-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
511-
# limits:
512-
# cpu: 100m
513-
# memory: 128Mi
514-
# requests:
515-
# cpu: 100m
516-
# memory: 128Mi
494+
resources:
495+
limits:
496+
cpu: 20m
497+
memory: 1Gi
498+
requests:
499+
cpu: 10m
500+
memory: 128Mi
517501

518502
metricsPort: 8081
519503

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)