Configuring HugePages

About this task

OpenShift requires special configuration to enable HugePages on VMs. Do the following:

Procedure

  1. If you are deploying containers in an OpenShift on vSphere VM environment, configure HugePages on the VM.
    1. Use ssh to log on to the VM:
      $ ssh -i ssh_private_key_path core@VM_IP_address
    2. Edit the /etc/sysctl.conf file to contain the following line:
      vm.nr_hugepages = number_of_pages
      Where number_of_pages is the number of HugePages to allocate on the VM.
  2. Configure the OpenShift cluster to label all the nodes that require HugePages:
    $ oc label node node_using_hugepages node-role.kubernetes.io/worker-hp=
    $ oc create -f deployment/hugepages-tuned-boottime.yaml
    $ oc create -f deployment/hugepages-mcp.yaml