<p>I am using kubernetes cluster with 1 master node and 2 worker with 4 core cpu and 256mb ram. I wanted to know how much cpu and ram is needed for kubelet.</p>

<p>Is there any way to set limit (cpu, memory) for kubelet?. I searched for documentation but i found only worker node requirements.</p>

<p>I think you should understand what <code>kubelet</code> does. This can be found in <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/" rel="nofollow noreferrer">kubelet documentation</a>.</p>

<blockquote>
  <p>The kubelet is the primary “node agent” that runs on each node. It can register the node with the apiserver using one of: the hostname; a flag to override the hostname; or specific logic for a cloud provider.</p>
  
  <p>The kubelet works in terms of a PodSpec. A PodSpec is a YAML or JSON object that describes a pod. The kubelet takes a set of PodSpecs that are provided through various mechanisms (primarily through the apiserver) and ensures that the containers described in those PodSpecs are running and healthy. The kubelet doesn’t manage containers which were not created by Kubernetes.</p>
  
  <p>Other than from an PodSpec from the apiserver, there are three ways that a container manifest can be provided to the Kubelet.</p>
  
  <p>File: Path passed as a flag on the command line. Files under this path will be monitored periodically for updates. The monitoring period is 20s by default and is configurable via a flag.</p>
  
  <p>HTTP endpoint: HTTP endpoint passed as a parameter on the command line. This endpoint is checked every 20 seconds (also configurable with a flag).</p>
  
  <p>HTTP server: The kubelet can also listen for HTTP and respond to a simple API (underspec’d currently) to submit a new manifest.</p>
</blockquote>

<p>There is several flags that you could use with kubelet, but they mostly are <strong>DEPRECATED</strong> and parameter should be set via config file specified by Kubelet's --config flag. This is explain on <a href="https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/" rel="nofollow noreferrer">Set Kubelet parameters via a config file</a>.</p>

<p>The flags that might be interesting for you are:</p>

<p><code>--application-metrics-count-limit int</code></p>

<blockquote>
  <p>Max number of application metrics to store (per container) (default 100) (DEPRECATED)</p>
</blockquote>

<p><code>--cpu-cfs-quota</code></p>

<blockquote>
  <p>Enable CPU CFS quota enforcement for containers that specify CPU limits (default true) (DEPRECATED)</p>
</blockquote>

<p><code>--event-qps int32</code></p>

<blockquote>
  <p>If > 0, limit event creations per second to this value. If 0, unlimited. (default 5) (DEPRECATED)</p>
</blockquote>

<p><code>--event-storage-age-limit string</code></p>

<blockquote>
  <p>Max length of time for which to store events (per type). Value is a comma separated list of key values, where the keys are event types (e.g.: creation, oom) or "default" and the value is a duration. Default is applied to all non-specified event types (default "default=0") (DEPRECATED)</p>
</blockquote>

<p><code>--event-storage-event-limit string</code></p>

<blockquote>
  <p>Max number of events to store (per type). Value is a comma separated list of key values, where the keys are event types (e.g.: creation, oom) or "default" and the value is an integer. Default is applied to all non-specified event types (default "default=0") (DEPRECATED)</p>
</blockquote>

<p><code>--log-file-max-size uint</code></p>

<blockquote>
  <p>Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)</p>
</blockquote>

<p><code>--pods-per-core int32</code></p>

<blockquote>
  <p>Number of Pods per core that can run on this Kubelet. The total number of Pods on this Kubelet cannot exceed max-pods, so max-pods will be used if this calculation results in a larger number of Pods allowed on the Kubelet. A value of 0 disables this limit. (DEPRECATED)</p>
</blockquote>

<p><code>--registry-qps int32</code></p>

<blockquote>
  <p>If > 0, limit registry pull QPS to this value. If 0, unlimited. (default 5) (DEPRECATED)</p>
</blockquote>
