No easy way to retrieve pod fqdn
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Low
|
Unassigned |
Bug Description
For stateful services it is important to expose the individual pod hostnames to clients. Pod IPs could change, while hostnames remain the same. At the same time, in order for pods hostnames to be used across models, they need to be fully qualified domain names:
Manual steps to get the pod hostname involve running network-get to retrieve the bind-address, and then running a reverse dns resolution via socket.
$ juju status
Model Controller Cloud/Region Version SLA Timestamp
test microk8s-localhost microk8s/localhost 2.7.3 unsupported 16:57:59+01:00
App Version Status Scale Charm Store Rev OS Address Notes
mongodb-k8s mongo:bionic active 1 mongodb-k8s jujucharms 26 kubernetes 10.152.183.207
Unit Workload Agent Address Ports Message
mongodb-k8s/1* active idle 10.1.81.163 27017/TCP ready
$ microk8s.kubectl -n test exec -it mongodb-
root@mongodb-
bind-addresses:
- macaddress: ""
interfacename: ""
addresses:
- hostname: ""
address: 10.1.81.163
cidr: ""
egress-subnets:
- 10.152.183.207/32
ingress-addresses:
- 10.152.183.207
root@mongodb-
>>> import socket
>>> socket.
'mongodb-
Hi David,
Thanks for the bug report. This is correct we currently do no expose FQDN of pods through juju. This would obviously take the form of pod.namespace. svc.cluster- domain. Before we dig into this any further are you able to supply the exact use case of what is trying to be achieved with all the actors involved?
Ta
tlm