I am using traefik 2.x to do a auth middleware, this is the middleware config look like:
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: jwt-token-auth
namespace: reddwarf-pro
spec:
forwardAuth:
address: http://infra-server-service.reddwarf-pro.svc.cluster.local:8081/infra/auth/access_token/verify
trustForwardHeader: true
When I want to access the kubernetes service in cluster, shows error:
time="2024-07-11T11:56:59Z" level=debug msg="Error calling http://infra-server-service.reddwarf-pro.svc.cluster.local:8081/infra/auth/access_token/verify. Cause: Get "http://infra-server-service.reddwarf-pro.svc.cluster.local:8081/infra/auth/access_token/verify": dial tcp: lookup infra-server-service.reddwarf-pro.svc.cluster.local on 100.100.2.136:53: no such host" middlewareType=ForwardedAuthType middlewareName=reddwarf-pro-jwt-token-auth@kubernetescrd
I have checked the coredns log:
[INFO] plugin/ready: Still waiting on: "kubernetes"
.:53
[INFO] plugin/reload: Running configuration SHA512 = 591cf328cccc12bc490481273e738df59329c62c0b729d94e8b61db9961c2fa5f046dd37f1cf888b953814040d180f52594972691cd6ff41be96639138a43908
CoreDNS-1.11.1
linux/amd64, go1.20.7, ae2bbc2
it looks like this kubernetes cluster dns resolve facing some issue. What should I do to fixed this issue? This is the service output:
➜ ~ kubectl --kubeconfig=./.kube/admin.conf get svc -n reddwarf-pro|grep "infra"
infra-server-service ClusterIP 10.100.155.34 <none> 8081/TCP 7d20h