Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ All notable changes to this project will be documented in this file.
### Added

- Support for in-place Nifi cluster upgrades ([#323])
- Added default resource requests (memory and cpu) for Nifi pods ([#353])

[#323]: https://github.com/stackabletech/nifi-operator/pull/323
[#353]: https://github.com/stackabletech/nifi-operator/pull/353

## [0.7.0] - 2022-09-06

Expand Down
47 changes: 21 additions & 26 deletions docs/modules/ROOT/pages/usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -245,30 +245,14 @@ nodes:

In the above example, all nodes in the default group will request `12Gi` of storage the various folders.

=== Memory requests
=== Resource Requests

You can request a certain amount of memory for each individual role group as shown below:
// The "nightly" version is needed because the "include" directive searches for
// files in the "stable" version by default.
// TODO: remove the "nightly" version after the next platform release (current: 22.09)
include::nightly@home:concepts:stackable_resource_requests.adoc[]

[source,yaml]
----
nodes:
roleGroups:
default:
config:
resources:
memory:
limit: '2Gi'
----

In this example, each node container in the "default" group will have a maximum of `2Gi` of memory.

Setting this property will automatically also set the maximum Java heap size for the corresponding process to 80% of the available memory. Be aware that if the memory constraint is too low, the cluster might fail to start. If pods terminate with an 'OOMKilled' status and the cluster doesn't start, try increasing the memory limit.

For more details regarding Kubernetes memory requests and limits see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/[Assign Memory Resources to Containers and Pods].

=== CPU requests

Similarly to memory resources, you can also configure CPU limits, as shown below:
If no resource requests are configured explicitly, the Nifi operator uses the following defaults:

[source,yaml]
----
Expand All @@ -278,8 +262,19 @@ nodes:
config:
resources:
cpu:
max: '500m'
min: '250m'
min: "500m"
max: "4"
memory:
limit: '2Gi'
storage:
flowfile_repo:
capacity: 2Gi
provenance_repo:
capacity: 2Gi
database_repo:
capacity: 2Gi
content_repo:
capacity: 2Gi
state_repo:
capacity: 2Gi
----

For more details regarding Kubernetes CPU limits see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/[Assign CPU Resources to Containers and Pods].
6 changes: 3 additions & 3 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ impl NifiConfig {
pub fn default_resources() -> Resources<NifiStorageConfig, NoRuntimeLimits> {
Resources {
memory: MemoryLimits {
limit: None,
limit: Some(Quantity("2Gi".to_string())),
runtime_limits: NoRuntimeLimits {},
},
cpu: CpuLimits {
min: None,
max: None,
min: Some(Quantity("500m".to_string())),
max: Some(Quantity("4".to_string())),
},
storage: NifiStorageConfig {
flowfile_repo: PvcConfig {
Expand Down