kubectl config use-context <Mgmt Cluster context> kubectl get kubeadmconfigtemplate -n <namespace> NAME AGE workload-md-0 4d23h
kubectl edit kubeadmconfigtemplate workload-md-0 - sysctl -w vm.max_map_count=262144 - sysctl -w vm.nr_hugepages=0
In order to make this change in effect, patch the machine deployment which will roll out the new machines with the required set of changes.
kubectl get md -n <namespace> kubectl patch machinedeployments.cluster.x-k8s.io <your_cluster>-md-0 -n <your_namespace> --type merge -p "{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"date\":\"`date +'%s'`\"}}}}}"
This will patch the machine deployment and will rollout new machine in the cluster with the required set of configuration for vm.max count.
Note: The kubectl patch command is ran only for worker nodes after editing kubeadmconfigtemplate to rollout changes to vms.
Note: Replace <your_cluster> with the name of your cluster and <your_namespace> with the namespace where the cluster is deployed.