With a Service called "myservice" backed onto a Statefulset called "mypods" you can curl
mypods-0.myservice to direct traffic to the first pod in the Statefulset.
How can I accomplish something similar with a Daemonset?
With a Service called "myservice" backed onto a Statefulset called "mypods" you can curl
mypods-0.myservice to direct traffic to the first pod in the Statefulset.
How can I accomplish something similar with a Daemonset?
According to kubernetes documentation, In general a pod has the following DNS resolution:
pod-ip-address.my-namespace.pod.cluster-domain.exampleAny pods created by a Deployment or DaemonSet exposed by a Service have the following DNS resolution available:
pod-ip-address.deployment-name.my-namespace.svc.cluster-domain.examplepod-ip-address.daemonset-name.my-namespace.svc.cluster-domain.exampleBut instead of using pod-ip-address you can set hostname for pod in its yaml description. The Pod spec has an optional
hostnamefield, which can be used to specify the Pod's hostname. So setpod.pec.hostnameThen following DNS resolution will available:pod-hostname.my-namespace.svc.cluster-domain.example