-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNS resolution for services managed by Svc Watcher #203
Comments
your Service is headless, but not selectorless as it should be. that being said Pod-identity based service discovery might not be supported at the moment, I will look into that. but please retry first with a proper Service definition |
so, this is an Endpoint subset record the default in-built service controller creates for the SSET:
This is what we create:
as you can see, there are some differences, mainly hostName vs. nodeName, and missin UID. |
@navjotsingh83 Name: vnf-internal-processor-sset-danm.default.svc.nokia.net [cloudadmin@controller-1 ~]$ nslookup internal-processor-set-0.vnf-internal-processor-sset-danm.default.svc.nokia.net Name: internal-processor-set-0.vnf-internal-processor-sset-danm.default.svc.nokia.net |
Is this a BUG REPORT or FEATURE REQUEST?:
bug
What happened:
Unable to do a DNS lookup on the identity of a POD (deployed as a stateful set) when service discovery is via SvcWatcher
What you expected to happen:
SvcWatcher claims parity with K8s service discovery and adds much more, so this use case should be supported
How to reproduce it:
My application is deployed as a stateful set with TWO PODs say pod-0 and pod-1 as the hostnames/podnames. The pods has two interfaces, eth0 as external and eth1 as internal. Since I wanted a service discovery for eth1, I defined a headless service with danm annotations, something like:
apiVersion: v1
kind: Service
metadata:
name: svcname
annotations:
danm.k8s.io/selector: '{"app.kubernetes.io/name":"xxxx"}'
danm.k8s.io/network: default (Here default means internal calico network)
spec:
clusterIP: None
selector:
app.kubernetes.io/name: xxxx
ports:
- port: {{ .Values.service.port }}
protocol: TCP
name: someport
Now, once if I log into another pod and do nslookup on the service name, it works.
_>>nslookup svcname
Server: 172.16.1.5
Address: 172.16.1.5#53
Name: svcname.default.svc.cluster.local
Address: 192.168.89.138
Name: svcname.default.svc.cluster.local
Address: 192.168.89.135_
However, if I want to access the individual PODs (that's the use-case of my application), then it fails:
** server can't find svcname.pod-0: NXDOMAIN
Anything else we need to know?:
This use case works perfectly when using the default K8s service discovery(obviously on eth0) as for stateful sets we can do a DNS on the individual PODs.
Environment:
danm -version
):kubectl version
):uname -a
):The text was updated successfully, but these errors were encountered: