kubernetes: kube2sky can not resolve kubernetes service DNS name
There seem to be a chicken and egg problem with the current kube-dns replication controller (v3).
As I mentioned there removing the -kube_master_url
flag forces kube2sky to use the kubeconfig file to find the address of the master, but this file contains the DNS name of the service, which can not be resolved:
clusters:
- name: local
cluster:
server: https://kubernetes
insecure-skip-tls-verify: true
As a result kube2sky fails with the error:
I0623 22:22:32.315145 1 kube2sky.go:451] Using https://kubernetes for kubernetes master
I0623 22:22:32.315168 1 kube2sky.go:452] Using kubernetes API
E0623 22:22:32.322136 1 reflector.go:136] Failed to list *api.Endpoints: Get https://kubernetes/api/v1beta3/endpoints: dial tcp: lookup kubernetes: no such host
This happens in a k8s 0.19.3 cluster powered by CoreOS, on AWS. Surprisingly, running the exact same replication controller with the same secret in a cluster started via kube-up.sh, also on AWS, works perfectly fine:
I0623 22:38:36.231746 1 kube2sky.go:451] Using https://10.0.0.1:443 for kubernetes master
I0623 22:38:36.231760 1 kube2sky.go:452] Using kubernetes API v1beta3
This behaviour feels pretty random and I can’t figure out the reason why in the second scenario https://kubernetes
is converted to https://10.0.0.1:443
, where is the magic?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 81 (49 by maintainers)
I updated both master and nodes to Kubernetes v0.20.1 and removed the
kube_master_url
argument to kube2sky fromskydns-rc.yml
- the problem is back.