Posts

Showing posts from April, 2022

Kubernetes Pod Priority and Preemption

Image
Pod priority indicates the importance of a pod relative to other pods and queues the pods based on that priority. Pod preemption allows the cluster to evict, or preempt, lower-priority pods so that higher-priority pods can be scheduled if there is no available space on a suitable node Pod priority also affects the scheduling order of pods and out-of-resource eviction ordering on the node. Priority classes can help you control the Kubernetes scheduler decisions to favor higher priority pods over lower priority pods. The Kubernetes scheduler can even preempt (remove) lower priority pods that are running so that pending higher priority pods can be scheduled. By setting pod priority, you can help prevent lower priority workloads from impacting critical workloads in your cluster, especially in cases where the cluster starts to reach its resource capacity. root@masterk8s:~# kubectl describe pod kube-scheduler-masterk8s -n kube-system | grep -i priority Priority:        ...

Kubernetes Metric Server

Image
Metrics Server collects resource metrics from Kubelets and exposes them in Kubernetes apiserver through Metrics API for use by Horizontal Pod Autoscaler and Vertical Pod Autoscaler.  Metrics API can also be accessed by kubectl top, making it easier to debug autoscaling pipelines. Metrics Server is not meant for non-autoscaling purposes. For example, don’t use it to forward metrics to monitoring solutions, or as a source of monitoring solution metrics. In such cases please collect metrics from Kubelet /metrics/resource endpoint directly. Metrics Server offers: A single deployment that works on most clusters. Fast autoscaling, collecting metrics every 15 seconds. Resource efficiency, using 1 mili core of CPU and 2 MB of memory for each node in a cluster. Scalable support up to 5,000 node clusters. Requirements: Metrics Server must be reachable from kube-apiserver by container IP address (or node IP if hostNetwork is enabled). The kube-apiserver must enable an aggregation layer. Nodes...