Affinity Official website: https://kubernetes.io/zh/docs/concepts/scheduling-eviction/assign-pod-node/ (1) Node affinity pod.spec.nodeAffinity ●preferredDuringSchedulingIgnoredDuringExecution: soft strategy ●requiredDuringSchedulingIgnoredDuringExecution: hard strategy (2) Pod affinity pod.spec.affinity.podAffinity/podAntiAffinity ●preferredDuringSchedulingIgnoredDuringExecution: soft strategy ●requiredDuringSchedulingIgnoredDuringExecution: hard strategy Simple understanding: Suppose you are a traveler and you plan to travel to a strange city. You can think of yourself as a Pod, and different attractions in the city can […]
Tag: affinity
Part 3 of the DPDK series: CPU affinity and practical applications
Series of articles The first article in the DPDK series: DPDK architecture explanation-CSDN Blog Part 2 of the DPDK series: Detailed explanation of CPU Cache and performance application of DPDK in Cache – CSDN Blog Basic concepts Take the lscpu result shown below as an example to pave the way for some basic concepts. [root@cyber […]
Kubernetes Advanced Scheduling – Affinity
Author:rab Directory Preface 1. Node affinity 1.1 NodeAffinity 1.1.1 Hard Node Affinity 1.1.2 Soft Node Affinity 1.2 NodeAntiAffinity 2. Pod affinity 2.1 PodAffinity 2.1.1 Hard Pod Affinity 2.1.2 Soft Pod Affinity 2.2 PodAntiAffinity Summarize Foreword Affinity and AntiAffinity in Kubernetes are key concepts for Pod scheduling. They allow us to control the distribution of Pods […]
k8s—–24, Affinity
1. Application scenarios The relationship between pods and nodes: Some Pods preferentially select nodes with the ssd=true label, if they are not considered for deployment to other nodes; Some Pods need to be deployed on nodes with ssd=true and type=physical, but are preferred to be deployed on nodes with ssd=true; The relationship between pod and […]
Affinity and anti-affinity of k8s promotion
nodeSelector provides a very simple way to limit Pods to nodes containing specific labels. Affinity/anti-affinity properties greatly expand the expression of limitations. The main enhancements are: Expressions are more efficient (not just an “and” relationship of multiple exact matching expressions) The rule can be marked as “soft” / “preference” instead of hard requirement. At this […]
pod affinity and anti-affinity experiments
pod affinity and anti-affinity experiments Table of contents 1,Environment preparation 2 Affinity + In Test 3 Affinity + NotIn Test 4 Non-Affinity + In Test 5 Non-Affinity + NotIn Test 1, environment preparation Both node01 and node02 have the label test=a, and there is a pod1 running on node01 with the label app=myapp01. #Set node01 […]
6. Kubernetes node and Pod affinity
Kubernetes node and Pod affinity 1. Introduction to node affinity strategy ?pod.spec.nodeAffinity preferredDuringSchedulingIgnoredDuringExecution: soft strategy requiredDuringSchedulingIgnoredDuringExecution: hard policy preferred: preferred, preferred required: required, required Key-value operation relationship: In: The value of label is in a list NotIn: The value of label is not in a list Gt: The value of label is greater than a […]
Kubernetes Scheduler – Scheduling Affinity – Taint, Tolerance, – Fixed Nodes
Kubernetes Scheduler-Scheduling Instructions Introduction Scheduler is the scheduler of kubernetes. Its main task is to allocate defined pods to the nodes of the cluster. It sounds very simple, but there is a lot to consider: Fairness: How to ensure that each node can be allocated resources Efficient resource utilization: all resources in the cluster are […]
Pod anti-affinity (podAntiAffinity) of k8s distributed deployment nodes
Use backgrounds and scenes A key service in the business is configured with multiple replicas. As a result, during deployment, it is found that multiple identical replicas are deployed on the same host at the same time. As a result, when the host fails, all replicas drift at the same time, resulting in intermittent interruption […]
Process affinity of suricata (binding cpu core)
Files: util-affinity.h util-affinity.c #ifndef __UTIL_AFFINITY_H__ #define __UTIL_AFFINITY_H__ #include “suricata-common.h” #include “conf.h” #if definedOS_FREEBSD #include <sched.h> #include <sys/param.h> #include <sys/resource.h> #include <sys/cpuset.h> #include <sys/thr.h> #define cpu_set_t cpuset_t #elif defined __OpenBSD__ #include <sched.h> #include <sys/param.h> #include <sys/resource.h> #elif defined OS_DARWIN #include <mach/mach.h> #include <mach/mach_init.h> #include <mach/thread_policy.h> // thread_affinity_policy_data_t is a data structure used to describe the thread […]