-
Notifications
You must be signed in to change notification settings - Fork 240
Azure NPM troubleshooting guide
Hunter Gregory edited this page May 3, 2022
·
12 revisions
NOTE: When NPM boots up, it will reset the kernel for you. Only step #6 is necessary to upgrade NPM; there's no need to delete network policies or iptables rules, but this document describes how to do so anyways.
mkdir -p networkpolicies
kubectl get networkpolicy --no-headers=true --all-namespaces | sed -r 's/(\S+)\s+(\S+).*/kubectl --namespace \1 get networkpolicy \2 -o yaml --export > networkpolicies\/\2.yaml/e'
kubectl get networkpolicy --no-headers=true --all-namespaces | sed -r 's/(\S+)\s+(\S+).*/kubectl --namespace \1 delete networkpolicy \2/e'
iptables-save > iptables_backup
ipset save > ipset_backup
iptables -D FORWARD -j AZURE-NPM || sudo iptables -w 30 -D FORWARD -j AZURE-NPM -m conntrack --ctstate NEW
iptables -vnL | grep 'Chain AZURE-NPM' | awk '{print \$2}' | xargs -n 1 iptables -w 30 -F
iptables -vnL | grep 'Chain AZURE-NPM' | awk '{print \$2}' | xargs -n 1 iptables -w 30 -X
iptables -vnL | grep 'Chain AZURE-NPM'" | wc -l # should return 0 (make sure there are no more npm chains)
ipset -L --name | grep azure-npm- | awk '{print \"-F \"\$1}' | ipset restore
ipset -L --name | grep azure-npm- | awk '{print \"-X \"\$1}' | ipset restore
ipset -L --name | grep azure-npm-" | wc -l # should return 0 (make sure there are no more npm sets)
kubectl delete ds azure-npm -n kube-system --grace-period=0 --force && \
kubectl apply -f https://raw.githubusercontent.com/Azure/azure-container-networking/master/npm/azure-npm.yaml
Azure Container Networking