Skip to content

Instantly share code, notes, and snippets.

@rohantmp
Last active August 26, 2019 06:53
Show Gist options
  • Save rohantmp/113d6b18d5e6fee385e9738e90383246 to your computer and use it in GitHub Desktop.
Save rohantmp/113d6b18d5e6fee385e9738e90383246 to your computer and use it in GitHub Desktop.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment