Skip to content

Commit

Permalink
docs(resources): clarifies where resources (requests and limits) are …
Browse files Browse the repository at this point in the history
…configured (#10299)

Signed-off-by: prmellor <[email protected]>
  • Loading branch information
PaulRMellor authored Jul 4, 2024
1 parent 506fd29 commit f82cf3d
Showing 1 changed file with 44 additions and 10 deletions.
54 changes: 44 additions & 10 deletions documentation/modules/con-common-configuration-properties.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -158,25 +158,61 @@ If you set limits without requests or vice versa, Kubernetes uses the same value
Setting equal requests and limits for resources guarantees quality of service, as
Kubernetes will not kill containers unless they exceed their limits.

You can configure resource requests and limits for one or more supported resources.
Configure resource requests and limits for components using `resources` properties in the `spec` of following custom resources:

.Example resource configuration
Use the `KafkaNodePool` custom resource for the following components:

* KRaft-based Kafka nodes (`spec.resources`)
* ZooKeeper-based Kafka nodes using node pools (`spec.resources`)

Use the `Kafka` custom resource for the following components:

* Kafka for ZooKeeper-based clusters without node pools (`spec.kafka.resources`)
* ZooKeeper (`spec.zookeeper.resources`)
* Topic Operator (`spec.entityOperator.topicOperator.resources`)
* User Operator (`spec.entityOperator.userOperator.resources`)
* Cruise Control (`spec.cruiseControl.resources`)
* Kafka Exporter (`spec.kafkaExporter.resources`)

For other components, resources are configured in the corresponding custom resource.
For example:

* `KafkaConnect` resource for Kafka Connect (`spec.resources`)
* `KafkaMirrorMaker2` resource for MirrorMaker (`spec.resources`)
* `KafkaBridge` resource for Kafka Bridge (`spec.resources`)

.Example resource configuration for a node pool
[source,yaml,subs="+attributes"]
----
apiVersion: {KafkaApiVersion}
kind: Kafka
apiVersion: {KafkaNodePoolApiVersion}
kind: KafkaNodePool
metadata:
name: my-cluster
name: pool-a
labels:
strimzi.io/cluster: my-cluster
spec:
kafka:
#...
resources:
replicas: 3
roles:
- broker
resources:
requests:
memory: 64Gi
cpu: "8"
limits:
memory: 64Gi
cpu: "12"
# ...
----

.Example resource configuration for the Topic Operator
[source,yaml,subs="+attributes"]
----
apiVersion: {KafkaApiVersion}
kind: Kafka
metadata:
name: my-cluster
spec:
# ..
entityOperator:
#...
topicOperator:
Expand All @@ -190,8 +226,6 @@ spec:
cpu: "1"
----

Resource requests and limits for the Topic Operator and User Operator are set in the `Kafka` resource.

If the resource request is for more than the available free resources in the Kubernetes cluster, the pod is not scheduled.

NOTE: Strimzi uses the Kubernetes syntax for specifying `memory` and `cpu` resources.
Expand Down

0 comments on commit f82cf3d

Please sign in to comment.