How to set node allocatable computation on kubernetes?

10/4/2019

I'm reading the Reserve Compute Resources for System Daemons task in Kubernetes docs and it briefly explains how to allocate a compute resource to a node using kubelet command and flags --kube-reserved, --system-reserved and --eviction-hard.

I'm learning on Minikube for masOS and as far as I got, minikube is configured to use command kubectl along with minikube command.

For local learning purposes on minikube I don't need to have it set (maybe it can't be done on minikube) but

How this could be done let's say in K8's development environment on a node?

-- Dominik Krulak
kubernetes

1 Answer

10/8/2019

This could be be done by:

1. Passing config file during cluster initialization or initilize kubelet with additional parameters via config file,

For cluster initialization using config file it should contains at least:

kind: InitConfiguration
kind: ClusterConfiguration
   additional configuratuion types like:
kind: KubeletConfiguration

In order to get basic config file you can use kubeadm config print init-defaults

2. For the live cluster please consider reconfigure current cluster using steps "Generate the configuration file" and "Push the configuration file to the control plane" like described in "Reconfigure a Node's Kubelet in a Live Cluster"

3. I didn't test it but for minikube - please take a look here:

Note:

Minikube has a “configurator” feature that allows users to configure the Kubernetes components with arbitrary values. To use this feature, you can use the --extra-config flag on the minikube start command.

This flag is repeated, so you can pass it several times with several different values to set multiple options.

This flag takes a string of the form component.key=value, where component is one of the strings from the below list, key is a value on the configuration struct and value is the value to set.

Valid keys can be found by examining the documentation for the Kubernetes componentconfigs for each component. Here is the documentation for each supported configuration:

kubelet
apiserver
proxy
controller-manager
etcd
scheduler

Hope this helped:

Additional community resources:

Memory usage in kubernetes cluster

-- Hanx
Source: StackOverflow