Closed antoniomerlin closed 4 weeks ago
Looks like you might be changing your default route with the macvlan config?
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
name: macvlan
spec:
config: >-
{ "cniVersion": "0.3.1", "name": "macvlan", "type": "macvlan", "mode":
"bridge", "master": "ens18", "ipam": { "type": "host-local", "subnet":
"193.169.1.0/24", "rangeStart": "193.169.1.100", "rangeEnd":
"193.169.1.150", "routes": [ { "dst": "0.0.0.0/0" } ], "gateway":
"193.169.1.1" } }
Maybe try instead without the gateway change? that's probably making it so you don't hit the DNS server.
also try a ip route
from inside the pod (e.g. kubectl exec ...
)
updated the NetworkAttachedDefinition still same error
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
name: macvlan
spec:
config: >-
{ "cniVersion": "0.3.1", "name": "macvlan", "type": "macvlan", "mode":
"bridge", "master": "ens18", "ipam": { "type": "host-local", "subnet":
"193.169.1.0/24", "rangeStart": "193.169.1.100", "rangeEnd":
"193.169.1.150", "routes": [ { "dst": "0.0.0.0/0" } ] } }
Able to resolve it using #847 manually adding route to pod of k3s service CIDR.
When i add multus specific annotation to a pod then those pods unable to resolve kubernetes internal dns resulution, so those pods are not able to directly access kubernetes defined services and endpoints. But that application is accessible through the multus defined IP on external network but unable to access coredns.
Is something i am missing regarding this multus config, i basically want to setup that applications inside cluster use kubernetes dns resulution for interpod communication and that application is also accessible to external network using multus macvlan provided IP.
I basically do not want application inside cluster to depend on external network for interpod communication.
Pod using defualt dnspolicy ClusterFirst.
Installed multus thin plugin using this link
Calico config:
Pod Template before adding annotations
NetworkAttachmentDefinition
Pod template after adding annotations:
Environment