September
22
Kubernetes Musings
Pod Affinity
To prevent the control plane nodes from being loaded by user deployments, you can configure a Deployment or StatefulSet so that it will not place pods on control plane nodes.
The following is placed under spec.template.spec section:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: DoesNotExist
Do this for your app and database pods, and then apply the YAML file to stop and restart the pod(s).
Determining pod location
To see where a pod is running, use:
kubectl get pods {-A | -n NAMESPACE} -o wide
To see what pods are running on a node, use:
kubectl get pods -A -o wide --field-selector spec.nodeName=NODE-NAME
Temperature (Raspberry PI)
To find out the temperature, and see if there is/was throttling, you can run these commands on a Raspberry PI 4B:
vcgencmd measure_temp
vcgencmd get_throttled
The temperature is in Celsius, and the throttling is a bit map. Some definitions I found, are:
Value Meaning relevant here
0x0 No current/historical throttling flags
0xe0000 Historical thermal/throttling-related flags, but no current under-voltage bit
0xe0008 Same historical flags plus current under-voltage