Dr I Asked: 2015-11-21 00:21:56 +0800 CST2015-11-21 00:21:56 +0800 CST 2015-11-21 00:21:56 +0800 CST Kubernetes 服务 etcd 参考 772 如果对 kubernetes 服务有相当了解的人可以向我证实,一旦你需要创建一个新服务,kubernetes 就会在 etcd 数据库上推送它的引用,以及请求它的 URL 是什么,那就太好了!!! coreos 1 个回答 Voted Best Answer cristi 2015-11-22T11:52:00+08:002015-11-22T11:52:00+08:00 所有数据都由 apiserver 保存在 etcd 中。 您可以通过以下方式获取服务列表: kubectl get services 如果你想从 etcd 获取定义: # etcdctl --peers http://$(hostname):2379 ls /coreos.com /registry # etcdctl --peers http://$(hostname):2379 ls /registry /registry/namespaces /registry/pods /registry/ranges /registry/serviceaccounts /registry/services /registry/controllers /registry/events /registry/minions # etcdctl --peers http://$(hostname):2379 ls /registry/services /registry/services/endpoints /registry/services/specs # etcdctl --peers http://$(hostname):2379 ls /registry/services/endpoints /registry/services/endpoints/default # etcdctl --peers http://$(hostname):2379 ls /registry/services/endpoints/default /registry/services/endpoints/default/kube-dns /registry/services/endpoints/default/kubernetes # etcdctl --peers http://$(hostname):2379 get /registry/services/endpoints/default/kube-dns {"kind":"Endpoints","apiVersion":"v1","metadata":{"name":"kube-dns","namespace":"default","selfLink":"/api/v1/namespaces/default/endpoints/kube-dns","uid":"194eacb0-8465-11e5-ab8c-005056a3274a","resourceVersion":"4787638","creationTimestamp":"2015-11-06T09:02:25Z","labels":{"k8s-app":"kube-dns","kubernetes.io/cluster-service":"true","kubernetes.io/name":"KubeDNS"}},"subsets":[]}
所有数据都由 apiserver 保存在 etcd 中。
您可以通过以下方式获取服务列表:
如果你想从 etcd 获取定义: