~/manifests-w2r4s9/market-web.yaml was applied to anatomy-w2r4s9 this morning. Since then someone ran kubectl scale by hand. The file and the cluster now disagree.
Find the drift
Read the live value:
sh
kubectl get deploy market-web -n anatomy-w2r4s9 -o jsonpath='{.spec.replicas}'Read the recorded value:
sh
grep replicas ~/manifests-w2r4s9/market-web.yamlThey differ. Write one line describing the drift to ~/drift-w2r4s9.txt. It must name the field and the live value, for example replicas drifted to 5:
sh
echo "replicas drifted to 5" > ~/drift-w2r4s9.txtMake the file win
sh
kubectl apply -f ~/manifests-w2r4s9/market-web.yaml -n anatomy-w2r4s9
kubectl get deploy market-web -n anatomy-w2r4s9apply reports configured and the replica count returns to what the file says. The extra Pods terminate.