Skip to content

Fix DNS and sync faults on the ticketing cluster

Most faults on the ticketing cluster so far came from the node DNS servers failing. Find your symptom below. Run kubectl on ticket-node-1; run the netplan steps on each node.

Symptom Section
ImagePullBackOff, lookup registry.nexus.castis.io: Try again DNS outage
Argo CD app Unknown, lookup mashup.castis.io ... server misbehaving Argo CD shows Unknown
Routes look wrong after DNS flakes APISIX routes look wrong
A ConfigMap or Secret change has no effect Config changes don't apply
Argo CD sync fails on a value Typos that broke things

DNS outage (ImagePullBackOff)

The node's DNS servers don't answer. Add 8.8.8.8 as a fallback. The change only adds a server; the internal servers stay.

  1. On each node, write the fallback file:

    sudo tee /etc/netplan/60-dns-fallback.yaml >/dev/null <<'YAML'
    network:
      version: 2
      ethernets:
        ens192:
          nameservers:
            addresses: [8.8.8.8]
    YAML
    sudo chmod 600 /etc/netplan/60-dns-fallback.yaml
    

    ens192 is the node's network interface; check it with ip -br link. 2. Apply it with automatic rollback if the node loses its connection:

    sudo netplan try
    

    Press Enter to keep the change when asked. 3. Check the node's DNS:

    resolvectl status | head -20
    

    Expected: 8.8.8.8 is listed next to the internal servers. 4. Restart CoreDNS. Pods keep the resolv.conf they started with, so CoreDNS still uses the dead servers until it restarts:

    kubectl -n kube-system rollout restart deployment coredns
    

    Expected: deployment.apps/coredns restarted, and failing pods pull their images within a few minutes. 5. Run CoreDNS on 2 replicas, so one node failing doesn't stop name lookups:

    kubectl -n kube-system scale deployment coredns --replicas=2
    

    Expected: kubectl -n kube-system get pods -l k8s-app=kube-dns shows 2 pods Running.

The fallback is a workaround. The internal DNS servers (listed by resolvectl status) still need fixing by their owner. Once they answer again, you can remove the fallback on each node and restart CoreDNS (step 4):

sudo rm /etc/netplan/60-dns-fallback.yaml && sudo netplan apply

Argo CD shows Unknown

  1. Fix DNS and restart CoreDNS (above).
  2. Force a refresh:

    kubectl -n argocd annotate application <APP> argocd.argoproj.io/refresh=hard --overwrite
    

    <APP> is the app name from kubectl get application -n argocd. 3. If a sync keeps retrying an old revision, cancel it, then refresh again (step 2) so automated sync starts on the latest revision:

    kubectl -n argocd patch application <APP> --type merge -p '{"operation":null}'
    

Expected: kubectl get application -n argocd shows the app Synced and Healthy.

APISIX routes look wrong

The APISIX ingress controller can lose sync after DNS flakes. Restart it:

kubectl rollout restart deployment apisix-ingress-controller -n ingress-apisix

Expected: deployment.apps/apisix-ingress-controller restarted; routes are correct again within a minute.

Config changes don't apply

A pod reads its ConfigMap and Secret values when it starts. After you change one, restart the Deployment:

kubectl -n production rollout restart deployment/<NAME>

<NAME> is the Deployment, for example spatio. Expected: new pods start and the old ones end.

Typos that broke things

All are fixed. Check for the same mistakes when you edit these values:

Where Wrong Right Effect
Postgres cluster CPU request 300Mi 300m Blocked Argo CD sync
coreapi CORS_ORIGIN johor.jov.my johor.gov.my Wrong allowed origin
authapi-stg COREAPI_BASE_URL coreapi coreapi-service authapi-stg couldn't reach coreapi (commit 2553762)
spatio AUTHAPI_URL authapi authapi-stg spatio used the old AuthAPI (commit 6b1c45d)