DNS可以解析群集外部 ETCD正确修改为新的容器,服务,节点部位等DNS解析外部,但不是本地的KUBE集群(按键位于ETCD)
这里有一些细节:
[[email protected] ~]$ kubectl logs kube-dns-v10-q9mlb -c kube2sky --namespace=kube-system
I0118 17:42:24.639508 1 kube2sky.go:436] Etcd server found: http://127.0.0.1:4001
I0118 17:42:25.642366 1 kube2sky.go:503] Using https://10.254.0.1:443 for kubernetes master
I0118 17:42:25.642772 1 kube2sky.go:504] Using kubernetes API
[[email protected] ~]$
显示该ETCD被正确填充:
[[email protected] ~]$ kubectl exec -t busybox -- nslookup kubelab.local
Server: 10.254.0.10
Address 1: 10.254.0.10
nslookup: can't resolve 'kubelab.local'
error: error executing remote command: Error executing command in container: Error executing in Docker Container: 1
[email protected] ~]$ etcdctl ls --recursive
/kubelab.local
/kubelab.local/network
/kubelab.local/network/config
/kubelab.local/network/subnets
/kubelab.local/network/subnets/172.16.46.0-24
/kubelab.local/network/subnets/172.16.12.0-24
/kubelab.local/network/subnets/172.16.70.0-24
/kubelab.local/network/subnets/172.16.21.0-24
/kubelab.local/network/subnets/172.16.54.0-24
/kubelab.local/network/subnets/172.16.71.0-24
为了帮助远一点:
[[email protected] ~]$ kubectl exec --namespace=kube-system kube-dns-v10-6krfm -c skydns ps
PID USER COMMAND
1 root /skydns -machines=http://127.0.0.1:4001 -addr=0.0.0.0:53 -ns-rotate=false -domain=kubelab.local.
11 root ps
[[email protected] ~]$
我确实改变cluster.local到kubelab.local,但我也做之前我kubenodes的变化:
KUBELET_ARGS="--kubeconfig=/etc/kubernetes/kubelet.kubeconfig --config=/etc/kubernetes/manifests --cluster-dns=10.254.0.10 --cluster-domain=kubelab.local"
/etc/resolv.conf中似乎是在testhost OK(以这种情况下,每DNS文档示例busybox的):
[[email protected] ~]$ kubectl exec busybox -c busybox -i -t -- cat /etc/resolv.conf
search default.svc.kubelab.local svc.kubelab.local kubelab.local openstacklocal kubelab.com
nameserver 10.254.0.10
nameserver 192.168.1.70
options ndots:5
[[email protected] ~]$
结果=仍然有点令人沮丧的:
[[email protected] ~]$ kubectl exec -t busybox -- nslookup kubelab.local
Server: 10.254.0.10
Address 1: 10.254.0.10
nslookup: can't resolve 'kubelab.local'
error: error executing remote command: Error executing command in container: Error executing in Docker Container: 1
[[email protected] ~]$
你到底了吗?有同样的问题。 – Alessandro
我做到了。在'kubernetes/contrib/ansible'中,我覆盖了'group_vars/all.yml'中的'kube_master_api_port'标志......这是因为项目处理这个变量的方式。结果是它没有被深入到kubernetes剧本中,所以我不得不做出手动覆盖。实际上,我在这里重新编写了这个项目供我自己使用:https://github.com/v1k0d3n/fansikube 我仍然在编写Fedora /转换轨迹文件,但其余的工作正常。你只需要像在不可用的项目中一样下载kubernetes二进制文件(没有不同)。 – v1k0d3n
我的结果是另一个问题(或者更多的问题),但现在它似乎都粘在了一起。谢谢 – Alessandro