- I have 2 pods running on 2 nodes, each pod runs in different node.
- These nodes are on the same subnet and can TCP/UDP/ICMP themselves.
These pods got some hostnames, ie:
- drill-staging-75cddd789-kbzsq
- drill-staging-75cddd789-amsrj
From pod drill-staging-75cddd789-kbzsq I cannot resolve host name for drill-staging-75cddd789-amsrj and vice versa. Resolving self pod's name works.
I tried setting various dnsPolicies:
- ClusterFirst: no luck
- Default: no luck
- ClusterFirstWithHostNet: no luck and it event couldn't resolve hostname of it's own node
- None: not tried (I don't think it's a good way)
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "app.name" . }}
namespace: {{ .Values.global.namespace }}
spec:
replicas: 2
selector:
matchLabels:
app: {{ include "app.name" . }}
template:
metadata:
labels:
app: {{ include "app.name" . }}
spec:
containers:
- name: {{ include "app.name" . }}
image: ...
resources:
...
ports:
...
imagePullPolicy: Always
restartPolicy: Always
podname.namespace.pod.cluster.local
. In most cases going through a Service is better practice. – Tisatisane