:_mod-docs-content-type: PROCEDURE
[id="compliance-operator-apply-remediation-for-customized-mcp"]
= Applying remediation when using customized machine config pools

[role="_abstract"]
When you create a custom `MachineConfigPool`, add a label to the `MachineConfigPool` so that `machineConfigPoolSelector` present in the `KubeletConfig` can match the label with `MachineConfigPool`.

[IMPORTANT]
====
Do not set `protectKernelDefaults: false` in the `KubeletConfig` file, because the `MachineConfigPool` object might fail to unpause unexpectedly after the Compliance Operator finishes applying remediation.
====

.Procedure

. List the nodes.
+
[source,terminal]
----
$ oc get nodes -n openshift-compliance
----
+
.Example output
+
[source,terminal]
----
NAME                                       STATUS  ROLES  AGE    VERSION
ip-10-0-128-92.us-east-2.compute.internal  Ready   master 5h21m  v1.35.4
ip-10-0-158-32.us-east-2.compute.internal  Ready   worker 5h17m  v1.35.4
ip-10-0-166-81.us-east-2.compute.internal  Ready   worker 5h17m  v1.35.4
ip-10-0-171-170.us-east-2.compute.internal Ready   master 5h21m  v1.35.4
ip-10-0-197-35.us-east-2.compute.internal  Ready   master 5h22m  v1.35.4
----

. Add a label to nodes.
+
[source,terminal]
----
$ oc -n openshift-compliance \
label node ip-10-0-166-81.us-east-2.compute.internal \
node-role.kubernetes.io/<machine_config_pool_name>=
----
+
.Example output
[source,terminal]
----
node/ip-10-0-166-81.us-east-2.compute.internal labeled
----

. Create custom `MachineConfigPool` CR.
+
[source,yaml]
----
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
metadata:
  name: <machine_config_pool_name>
  labels:
    pools.operator.machineconfiguration.openshift.io/<machine_config_pool_name>: ''
spec:
  machineConfigSelector:
  matchExpressions:
  - {key: machineconfiguration.openshift.io/role, operator: In, values: [worker,<machine_config_pool_name>]}
  nodeSelector:
  matchLabels:
    node-role.kubernetes.io/<machine_config_pool_name>: ""
----
+
where:

`metadata.labels.pools.operator.machineconfiguration.openshift.io/<machine_config_pool_name>`:: The `labels` field defines the label name to add for the machine config pool (MCP).

. Verify MCP created successfully.
+
[source,terminal]
----
$ oc get mcp -w
----
