Machine Config Operator docs on applying configuration
-
Find the machine MachineConfigurationPools that refer to the worker/master pools:
oc get mcp --show-labels -
Create a MachineConfig object with
machineconfiguration.openshift.io/role=<MachineConfigPool Name> -
The MCO will render a new
rendered-worker-...MachineConfig and apply a rolling update of the configuration.
Watch it happen with something like: watch -n 2 oc get mcp,nodes,machines -n openshift-machine-api
This example creates a file on each worker with the path /etc/sysctl.d/99-elasticsearch.conf with the contents: vm.max_map_count = 262144.
The data is encoded in base64 using the data URI scheme.
# This example MachineConfig replaces /etc/chrony.conf
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: worker
name: 01-elesticsearch-worker
spec:
config:
ignition:
version: 2.2.0
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,dm0ubWF4X21hcF9jb3VudCA9IDI2MjE0NA==
filesystem: root
mode: 0644
path: /etc/sysctl.d/99-elasticsearch.conf