I've got an odd problem; pods fail to connect to k...
# k3s
p
I've got an odd problem; pods fail to connect to kubeapi 10.43.0.1 on first attempt due to connection refused. I can connect from a pod I've created to test but, the pods that access the api seem to fail first time with
Copy code
dial tcp 10.43.0.1:443: connect: connection refused"
then work on restart/retry, any ideas?
My suspicion is (as we're on an old k3s) the firewall rule isn't getting put in place in time so first attempt fails, then works but short lived pods that don't retry just fail once
I've got a workaround which I suspect will be negated when we have time to upgrade k3s:
Copy code
spec:
          containers:
          - args:
            - >-
              /bin/sleep 2 && longhorn-manager -d recurring-job snapshot
              --manager-url <http://longhorn-backend:9500/v1>
            command:
            - /bin/sh
            - "-c"
            env:
            - name: POD_NAMESPACE
the
sleep
gives enough time for iptables to be updated before the pod tries to connect to kubeapi