practice of Karmada as cluster resource synchronization in disaster recovery systems
Research the principle of metadata.generation value increase
1 Background
Use kubebuilder to develop a vpa-related operator. This operator will watch all vpa creation, deletion and update in the cluster. controller-runtime provides predict to filter out unnecessary events, and use predicate.GenerationChangedPredicate to filter out vpa update status. However, it was found that the status update of vpa (recommended value updated by vpa-recommender) also triggered Reconcile.
The pod always scheduling to the same node
Encountered Strange Phenomenon: Spark-generated job pods are consistently scheduled on the same node, meaning that pods from different jobs are all being scheduled to the same node. This results in an uneven distribution of pods, even though the nodes have no taints, and their resource availability is similar. The jobs do not have any nodeSelector
, nodeAffinity
, nodeName
, or PodTopologySpread
.
Resource Recommendation Algorithms for Crane and VPA
modify the contents of /etc/resolv.conf when the pod is running
Kubernetes provides a method to modify the configuration of the /etc/resolv.conf
file for pods using the spec.dnsConfig
and spec.dnsPolicy
fields. You can find specific information on this in the Customizing DNS Service documentation. However, this approach leads to the recreation of pods.
In our specific business scenario, we need pods to use local DNS instead of the centralized CoreDNS, even for pods created before the change in cluster DNS configuration. We need to update the nameserver for these existing pods to point to the local DNS server. However, we cannot actively delete pods or restart containers. This practice is not considered ideal in container usage, but it aligns with our company culture, as the business application doesn’t support graceful termination.