Important: Changing CRI-O ulimits through a MachineConfig is technically possible but is not supported without a Red Hat Support Exception. The only supported container runtime customization is the ContainerRuntimeConfig custom resource, which does not expose ulimits (as of at least OpenShift 4.21). Feature request: RFE-8904.
Configure CRI-O to supply the required limits to newly created containers, following How to increase open files limits in RHOCP 4.
The intended drop-in content is:
[crio.runtime]
default_ulimits = ["nofile=4096:1048576"]
Preserve other existing default_ulimits entries and check competing drop-ins before adding this setting.
A hard limit of 1048576 equals the default kernel fs.nr_open ceiling, so no sysctl change is needed. To configure a value above 1048576, also raise fs.nr_open with a second MachineConfig, as described in the Red Hat article.
Example worker MachineConfig
Save the following as 96-worker-crio-limit-files.yaml. Confirm the Ignition version against the target OCP release.
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
name: 96-worker-crio-limit-files
labels:
machineconfiguration.openshift.io/role: worker
spec:
config:
ignition:
version: 3.2.0
storage:
files:
- path: /etc/crio/crio.conf.d/99-eic-nofile.conf
mode: 420
overwrite: true
contents:
source: "data:,%5Bcrio.runtime%5D%0Adefault_ulimits%20%3D%20%5B%22nofile%3D4096%3A1048576%22%5D%0A"
The data URL encodes the TOML shown above. Mode 420 is decimal for file permissions 0644.
This example targets the worker configuration and can also be inherited by custom worker pools. It changes container defaults on the selected nodes, beyond the Solace pods. If limiting the change to an EIC pool, verify that pool's MachineConfig selector and workload placement.
Apply to an existing cluster
Plan the worker rollout, including draining and rebooting, then apply the reviewed configuration. When applying more than one MachineConfig, pause the pool first so that the nodes reboot only once, as shown in the Red Hat article.
oc apply -f 96-worker-crio-limit-files.yaml
oc get machineconfigpools
Wait until the affected pool reports UPDATED=True, UPDATING=False, and DEGRADED=False. Recreate affected Solace pods if they were not recreated during the rollout, preserving broker availability and persistent volumes.
Include during cluster provisioning
For a new cluster, add the MachineConfig to the openshift directory generated by openshift-install create manifests before creating the cluster.