The customer would like to know how to enable HugePages on TKGi clusters.
TKGi comes with a pre-built OS image that is tuned for kubernetes workloads. The supported method of modifying the OS is using Bosh Addons https://bosh.io/docs/addons-common/ and https://github.com/cloudfoundry/os-conf-release. There is an existing Addon (https://github.com/cloudfoundry/os-conf-release/tree/master/jobs/sysctl) that can be used for enabling huge pages.
Below is an example for setting up the reserved Huge Pages -
Step 1. Upload the latest version 23.0.0 of os-conf release via bosh command:
$ bosh upload-release --sha1 d20772d8ce6e781ceb13cac7df5950bfa4330ba1 "https://bosh.io/d/github.com/cloudfoundry/os-conf-release?v=23.0.0"
Note: If you have the restricted network, you may download the latest version of os-conf release via https://bosh.io/releases/github.com/cloudfoundry/os-conf-release?all=1 and upload the release via bosh command "bosh upload-release os-conf-release-23.0.0.tgz".
Step 2. Create a new runtime config tkgi-runtime.yml file:
releases:
- name: os-conf
version: 23.0.0
addons:
- name: tkgi-sysctl-config
jobs:
- name: sysctl
release: os-conf
properties:
sysctl:
- vm.nr_hugepages = 1024
include:
deployments:
- <tkgi-deployment-name_service-instance_####>
- <tkgi-deployment-name_service-instance_####>
Step 3. Update runtime config:
$ bosh update-runtime-config --name=tkgi-sysctl-config ./tkgi-runtime.yml
Step 4. Upgrade related TKGi clusters via tkgi command:
tkgi upgrade-cluster <tkgi_cluster_name>
Notice: The responsibility of creating and validating these addons lies with the customer. Modifying the OS can have a significant or no impact on the behaviour and performance of the VM so its important the customer validate it.