Posts

Showing posts from May, 2024

KB: Kubernetes Affinity

Affinity rules in Kubernetes are constraints that influence the scheduling of pods based on certain conditions. These rules help you control the placement of pods on nodes or in relation to other pods, ensuring optimal performance, resource utilization, and reliability. Affinity rules come in three main types: node affinity , pod affinity , and pod anti-affinity . Practical Use Cases Node Affinity: Ensuring pods with high memory requirements are scheduled on nodes with high memory capacity. Pod Affinity: Scheduling web servers close to caching servers to reduce latency. Pod Anti-Affinity: Spreading replicas of a service across different nodes to ensure high availability. By using affinity and anti-affinity rules, Kubernetes administrators can fine-tune pod scheduling to meet specific application requirements and optimize the cluster's overall performance. Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector

KB:Kubernetes Taints and Tolerations

How Taints and Tolerations Work Together:  Taint: Applied to nodes to indicate that they should repel certain pods. Toleration: Applied to pods to indicate that they can be scheduled on nodes with matching taints. Importance of Matching Effects The effect in the toleration must exactly match the effect in the taint for the toleration to work. If they do not match, the toleration will not counteract the taint, and the pod will be treated as if it has no toleration for that taint. For a toleration to work, the effect field in the toleration must match the effect field in the taint on the node. If they do not match, the toleration will not counteract the taint, and the pod will not be scheduled on the node. When you exclude the effect field in a toleration, the toleration matches any taint with the specified key and value, regardless of the effect. This is a shorthand way of writing a toleration that matches taints with any effect. Ref: https://kubernetes.io/docs/concepts/sche...

KB:Linux lsof - list open files

man: lsof - list open files lsof -n | grep rundeck |wc -l lsof -n | grep rundeck | grep deleted | wc -l lsof -n | grep rundeck | grep deleted lsof -p 21601 | wc -l lsof -p 21601 | grep deleted | wc -l #Find out proc limits ps -aux|grep java cat /proc/1208/limits #ps -aux|grep java root      5718  0.0  0.0 182020  2172 ?        S    May02   0:00 runuser -s /bin/bash -l rundeck -c java -Drundeck.jaaslogin=true            -Djava.security.auth.login.config=/etc/rundeck/jaas-ldap.conf            -Dloginmodule.name=ldap            -Drdeck.config=/etc/rundeck            -Drundeck.server.configDir=/etc/rundeck            -Dserver.datastore.path=/var/lib/rundeck/data/rundeck     # cat /proc/ 5718 /limits Limit               ...