linkerd / linkerd-examples

Examples of how to configure and run linkerd
https://linkerd.io
Apache License 2.0
432 stars 221 forks source link

Need dnsPolicy: ClusterFirstWithHostNet when deploying for CNI + zipkin #161

Closed turchanov closed 7 years ago

turchanov commented 7 years ago

At least for kubernetes 1.7 one has to specifically request dnsPolicy: ClusterFirstWithHostNet for linkerd container in deployment config linkerd-cni.yml if one wants to use zipkin telemetry

...
    telemetry:
    - kind: io.l5d.zipkin
      host: zipkin-collector.default.svc.cluster.local
      port: 9410
      sampleRate: 1.0
...

Otherwise due to hostNetwork: true Pod specifier (for CNI deployment) the dnsPolicy: default is applied so that "cluster" addresses (....svc.cluster.local) are not resolved because default dns policy is to use node's host /etc/resolv.conf which may or may not (as it is in my case) refer to kube-dns for name resolution, at least this kind (the latter) of resolv.conf setup is done by kubeadm. Anyways this clarification must be stated somewhere (https://discourse.linkerd.io/t/flavors-of-kubernetes/53 ?)

P.S. I do not know since what kubernetes version dns policy ClusterFirstWithHostNet is available.

esbie commented 7 years ago

First available in 1.6 Should we just add dnsPolicy: ClusterFirstWithHostNet to the linkerd-cni.yml? thoughts @klingerf?

klingerf commented 7 years ago

@esbie Yeah, that sounds like the right fix to me, but am also worried it will make the configs backwards incompatible with earlier Kubernetes versions. Hmm, maybe we need a separate linkerd-cni.yml config file for 1.6+.

esbie commented 7 years ago

OK let's do that. As soon as linkerd-cni.yml is split into linkerd-cni.yml and linkerd-cni-legacy.yml, I'll update the k8s flavor page to reflect it

mancej commented 7 years ago

OMG thank you for this. I couldn't get the new service_mesh.yml to work with CNI and Zipkin and this solved it!!!

esbie commented 7 years ago

oh snap! we should def add this to the config then!