Kubernetes,联邦,kubectl get clusters找不到资源

时间:2018-04-13 18:05:06

标签: kubernetes kubectl

我正在尝试通过kubernetes网络在联盟群集环境中配置放置策略 https://kubernetes.io/docs/tasks/federation/set-up-placement-policies-federation/

当我在Federation API服务器中配置Admission Controller并输入命令时:

kubectl create -f scheduling-policy-admission.yaml

当我进入时:

kubectl -n federation-system edit deployment apiserver

并添加标志

--enable-admission-plugins=SchedulingPolicy
--admission-control-config-file=/etc/kubernetes/admission/config.yml

和volumeMount:

volumeMounts:
- name: admission-config
  mountPath: /etc/kubernetes/admission

和音量

- name: admission-config
  configMap:
    name: admission

配置了apiserver

但之后,当我输入属于联合用户的任何命令时 像:

kubectl get nameespaces

kubectl get clusters

我得到了:

找不到资源。

以下的commads来自user_master(我创建了控制平面和联盟用户的那个),来自联合用户我得到了相同的: 找不到资源

root@master:~# kubectl get deployments --context=<cluster_name> --all-namespaces
NAMESPACE           NAME                                                DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
federation-system   apiserver                                           1         1         1            1           1d
federation-system   controller-manager                                  1         1         1            1           1d
federation-system   opa                                                 1         1         1            0           5h
kube-system         calico-kube-controllers                             1         1         1            1           4d
kube-system         kube-dns                                            1         1         1            1           4d
kube-system         tiller-deploy                                       1         1         1            1           4d
my-namespace        coredns-coredns                                     1         1         1            1           3d
my-namespace        etcd-operator-etcd-operator-etcd-backup-operator    1         1         1            1           4d
my-namespace        etcd-operator-etcd-operator-etcd-operator           1         1         1            1           4d
my-namespace        etcd-operator-etcd-operator-etcd-restore-operator   1         1         1            1           4d


root@master:~# kubectl get rs --context=cluster-66n3 --all-namespaces
NAMESPACE           NAME                                                           DESIRED   CURRENT   READY     AGE
default             nginx-pci                                                      0         0         0         1d
federation-system   apiserver-54897c9759                                           0         0         0         12h
federation-system   apiserver-55754fbb96                                           0         0         0         12h
federation-system   apiserver-58fbbb9ddf                                           1         1         1         12h
federation-system   apiserver-59d847fbb9                                           0         0         0         12h
federation-system   apiserver-6dd8d967f6                                           0         0         0         12h
federation-system   apiserver-79f49d6db                                            0         0         0         12h
federation-system   apiserver-7b67bcccf5                                           0         0         0         12h
federation-system   apiserver-855b8f6887                                           0         0         0         12h
federation-system   apiserver-86685c4c8f                                           0         0         0         12h
federation-system   apiserver-889c85867                                            0         0         0         12h
federation-system   apiserver-c8bb586f4                                            0         0         0         12h
federation-system   controller-manager-5c4f955cc4                                  1         1         1         13h
federation-system   controller-manager-5d8577fd8b                                  0         0         0         1d
federation-system   opa-5c545ff6df                                                 1         1         0         5h
kube-system         calico-kube-controllers-5449fdfcd                              1         1         1         4d
kube-system         kube-dns-86f4d74b45                                            1         1         1         4d
kube-system         tiller-deploy-df4fdf55d                                        1         1         1         4d
my-namespace        coredns-coredns-b7574b7dd                                      1         1         1         3d
my-namespace        etcd-operator-etcd-operator-etcd-backup-operator-687bb97bfd    1         1         1         4d
my-namespace        etcd-operator-etcd-operator-etcd-operator-cdd58665b            1         1         1         4d
my-namespace        etcd-operator-etcd-operator-etcd-restore-operator-65585cb577   1         1         1         4d

和versuin:

root@master:~# kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:55:54Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.0-alpha.3", GitCommit:"85c06145286da663755b140efa2b65f793cce9ec", GitTreeState:"clean", BuildDate:"2018-02-14T12:54:40Z", GoVersion:"go1.9.1", Compiler:"gc", Platform:"linux/amd64"}

有人可能知道为什么?

0 个答案:

没有答案