// Module included in the following assemblies:
//
// * networking/metallb/metallb-operator-install.adoc

:_mod-docs-content-type: PROCEDURE
[id="nw-metallb-operator-setting-pod-CPU-limits_{context}"]
= Configuring pod CPU limits in a MetalLB deployment

[role="_abstract"]
To manage compute resources on nodes running MetalLB in {product-title}, you can assign CPU limits to the `controller` and `speaker` pods in the `MetalLB` custom resource. This ensures that all pods on the node have the necessary compute resources to manage workloads and cluster housekeeping.

.Prerequisites

* You are logged in as a user with `cluster-admin` privileges.

* You have installed the MetalLB Operator.

.Procedure

. Create a `MetalLB` custom resource file, such as `CPULimits.yaml`, to specify the `cpu` value for the `controller` and `speaker` pods: 
+
[source,yaml]
----
apiVersion: metallb.io/v1beta1
kind: MetalLB
metadata:
  name: metallb
  namespace: metallb-system
spec:
  logLevel: debug
  controllerConfig:
    resources:
      limits:
        cpu: "200m"
  speakerConfig:
    resources:
      limits:
        cpu: "300m"
----

. Apply the `MetalLB` custom resource configuration:
+
[source,bash]
----
$ oc apply -f CPULimits.yaml
----

.Verification

* To view compute resources for a pod, run the following command, replacing `<pod_name>` with your target pod:
+
[source,bash]
----
$ oc describe pod <pod_name>
----
