- Spread pods across nodes with topologySpreadConstraints
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: demo
- Spread pods across nodes with topologySpreadConstraints
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- demo
topologyKey: kubernetes.io/hostname
kubectl get pods -A -o custom-columns=PodName:.metadata.name,PodUID:.metadata.uid
kubectl get pods,svc,deploy,sts -o name | xargs -n1 -I{} kubectl patch {} --type=merge -p '{"metadata":{"finalizers":[]}}'
kga | grep -v NAME | awk '{ print $1 }' | xargs kubectl delete --force
- Change storage class default
kubectl patch sc openebs-device -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
kubectl patch sc openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'