-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installation issues: How to add other sub-clusters to the parent cluster #785
Comments
@googs1025 Please apply below step in parent cluster.
|
@googs1025 Also you can follow this Quick Start Guide, which will setup Clusternet locally with 1 parent cluster and 3 child clusters by using kind. |
@dixudx [root@VM-0-13-centos clusternet-agent]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a41a3ba28b2c kindest/node:v1.20.15 "/usr/local/bin/entr…" 4 days ago Up 4 days 0.0.0.0:40080->80/tcp, 0.0.0.0:40443->443/tcp cluster2-worker
ef621726e649 kindest/node:v1.20.15 "/usr/local/bin/entr…" 4 days ago Up 4 days 0.0.0.0:6444->6443/tcp, 0.0.0.0:46443->6444/tcp cluster2-control-plane
e68974e6f705 kindest/node:v1.20.15 "/usr/local/bin/entr…" 4 days ago Up 4 days 0.0.0.0:6443->6443/tcp, 0.0.0.0:30009->30009/tcp, 0.0.0.0:31443->31443/tcp, 0.0.0.0:36443->6443/tcp master-cluster-control-plane
[root@VM-0-13-centos clusternet-agent]# docker exec -it ef621726e649 cat /etc/kubernetes/manifests/kube-apiserver.yaml
apiVersion: v1
kind: Pod
metadata:
annotations:
kubeadm.kubernetes.io/kube-apiserver.advertise-address.endpoint: 172.18.0.4:6443
creationTimestamp: null
labels:
component: kube-apiserver
tier: control-plane
name: kube-apiserver
namespace: kube-system
spec:
containers:
- command:
- kube-apiserver
- --advertise-address=172.18.0.4
- --allow-privileged=true
- --authorization-mode=Node,RBAC
- --client-ca-file=/etc/kubernetes/pki/ca.crt
- --enable-admission-plugins=NodeRestriction
- --enable-bootstrap-token-auth=true
- --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt
- --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt 之前没找到是因为 一直以为 bootstrap-token-07401b 是在 clusternet-system 命名空间中,原来是在 kube-system 。。。 [root@VM-0-13-centos clusternet-agent]# helm install clusternet-agent -n clusternet-system --create-namespace --set parentURL=https://172.18.0.2:6443 --set registrationToken=07401b.f395accd246ae52d \ .
NAME: clusternet-agent
LAST DEPLOYED: Thu Jan 25 11:14:08 2024
NAMESPACE: clusternet-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
[root@VM-0-13-centos clusternet-agent]# kubectl --context kind-cluster2 get pods -nclusternet-system
NAME READY STATUS RESTARTS AGE
clusternet-agent-9d5b74997-c8ptw 1/1 Running 0 6m23s
clusternet-agent-9d5b74997-k2qfx 1/1 Running 0 6m23s
clusternet-agent-9d5b74997-slkpt 1/1 Running 0 6m23s
[root@VM-0-13-centos clusternet-agent]# kubectl --context kind-cluster2 logs clusternet-agent-9d5b74997-slkpt -nclusternet-system
I0125 03:14:10.860952 1 serving.go:348] Generated self-signed cert in-memory
I0125 03:14:10.862457 1 secure_serving.go:210] Serving securely on [::]:10650
I0125 03:14:10.862478 1 agent.go:226] starting agent controller ...
I0125 03:14:10.862524 1 leaderelection.go:248] attempting to acquire leader lease clusternet-system/clusternet-agent...
I0125 03:14:10.862985 1 tlsconfig.go:240] "Starting DynamicServingCertificateController"
I0125 03:14:10.870183 1 agent.go:263] new leader elected: clusternet-agent-9d5b74997-k58w4_cb03fe7c-333e-48c9-b824-793e6b2e6b22
I0125 03:14:26.482229 1 leaderelection.go:258] successfully acquired lease clusternet-system/clusternet-agent
I0125 03:14:26.482420 1 agent.go:326] start registering current cluster as a child cluster...
I0125 03:14:26.482438 1 agent.go:336] retrieving cluster id
I0125 03:14:26.485716 1 agent.go:341] current cluster id is "9add3aec-9faa-42ab-ac76-22228e41f707"
I0125 03:14:26.487410 1 agent.go:443] try to bootstrap cluster registration if needed
I0125 03:14:26.504397 1 agent.go:468] successfully create ClusterRegistrationRequest "clusternet-9add3aec-9faa-42ab-ac76-22228e41f707"
[root@VM-0-13-centos clusternet-agent]# kubectl --context kind-master-cluster get clsrr
NAME CLUSTER ID STATUS AGE
clusternet-9add3aec-9faa-42ab-ac76-22228e41f707 9add3aec-9faa-42ab-ac76-22228e41f707 21s |
不好意思~ [root@VM-0-13-centos .kube]# kubectl get clsrr --context kind-master-cluster
NAME CLUSTER ID STATUS AGE
clusternet-9add3aec-9faa-42ab-ac76-22228e41f707 9add3aec-9faa-42ab-ac76-22228e41f707 21m
[root@VM-0-13-centos .kube]# kubectl get clsrr clusternet-9add3aec-9faa-42ab-ac76-22228e41f707 -o yaml --context kind-master-cluster
apiVersion: clusters.clusternet.io/v1beta1
kind: ClusterRegistrationRequest
metadata:
creationTimestamp: "2024-01-25T03:14:26Z"
generation: 1
labels:
clusters.clusternet.io/cluster-id: 9add3aec-9faa-42ab-ac76-22228e41f707
clusters.clusternet.io/cluster-name: clusternet-cluster-nkxd4
clusters.clusternet.io/registered-by: clusternet-agent
name: clusternet-9add3aec-9faa-42ab-ac76-22228e41f707
resourceVersion: "1960889"
uid: 598053b9-5d93-4df9-870e-a91f408b0aa8
spec:
clusterId: 9add3aec-9faa-42ab-ac76-22228e41f707
clusterName: clusternet-cluster-nkxd4
clusterType: StandardCluster
syncMode: Dual |
Currently Please check whether your |
[root@VM-0-13-centos clusternet]# kubectl get pods -nclusternet-system
NAME READY STATUS RESTARTS AGE
clusternet-controller-manager-594549889-7h5vk 1/1 Running 0 3d21h
clusternet-controller-manager-594549889-cwv7x 1/1 Running 0 3d21h
clusternet-controller-manager-594549889-nv4jb 1/1 Running 0 3d21h
clusternet-hub-5d9f4bd454-5n8n4 1/1 Running 0 3d22h
clusternet-hub-5d9f4bd454-tg78b 1/1 Running 0 3d22h
clusternet-hub-5d9f4bd454-xd75g 1/1 Running 0 3d22h
clusternet-scheduler-bb5b68d5-km9vm 1/1 Running 1 3d21h
clusternet-scheduler-bb5b68d5-pjw7z 1/1 Running 1 3d21h
clusternet-scheduler-bb5b68d5-qn9rk 1/1 Running 1 3d21h
[root@VM-0-13-centos clusternet]# kubectl logs clusternet-controller-manager-594549889-7h5vk -nclusternet-system | tail -20
I0124 04:37:57.508731 1 shared_informer.go:273] Waiting for caches to sync for localization-controller
I0124 04:37:57.508745 1 shared_informer.go:280] Caches are synced for localization-controller
I0124 04:38:00.576304 1 localization.go:139] shutting down localization controller
E0124 04:38:00.583304 1 shared_informer.go:276] unable to sync caches for generic-deployer
I0124 04:38:00.583337 1 generic.go:120] shutting generic deployer
E0124 04:38:00.583363 1 shared_informer.go:276] unable to sync caches for helm-deployer
I0124 04:38:00.583377 1 aggregatestatus.go:126] shutting down aggregatestatus controller
I0124 04:38:00.583399 1 globalization.go:139] shutting down Globalization controller
I0124 04:38:00.583417 1 base.go:129] shutting down base controller
I0124 04:38:00.583436 1 manifest.go:138] shutting down manifest controller
I0124 04:38:00.583454 1 subscription.go:137] shutting down subscription controller
I0124 04:38:00.583468 1 helmchart.go:134] shutting down helmchart controller
I0124 04:38:00.583484 1 feedinventory.go:155] shutting down feedInventory controller
I0124 04:38:00.583601 1 clusterregistrationrequest_controller.go:113] shutting down cluster-registration-requests controller
E0124 04:38:00.583668 1 controllermanager.go:138] leader election got lost
I0124 04:38:00.583711 1 yacht.go:253] shutting down controller cluster-lifecycle
I0124 04:38:00.583731 1 clusterlifecycle_controller.go:129] Shutting down cluster lifecycle controller
I0124 04:38:00.715366 1 helm.go:164] shutting helm deployer
I0124 04:38:00.715515 1 trace.go:219] Trace[2080334431]: "Reflector ListAndWatch" name:pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:169 (24-Jan-2024 04:37:45.822) (total time: 14892ms):
Trace[2080334431]: [14.892781943s] [14.892781943s] END
[root@VM-0-13-centos clusternet]# kubectl logs clusternet-controller-manager-594549889-cwv7x -nclusternet-system | tail -20
I0121 19:09:15.328134 1 leaderelection.go:283] failed to renew lease clusternet-system/clusternet-controller-manager: timed out waiting for the condition
E0121 19:09:22.470954 1 leaderelection.go:306] Failed to release lock: Operation cannot be fulfilled on leases.coordination.k8s.io "clusternet-controller-manager": the object has been modified; please apply your changes to the latest version and try again
E0121 19:09:22.471051 1 controllermanager.go:138] leader election got lost
I0121 19:09:23.076783 1 localization.go:139] shutting down localization controller
I0121 19:09:23.134786 1 secret.go:117] shutting down Secret controller
I0121 19:09:23.248062 1 description.go:140] shutting down description controller
I0121 19:09:23.501757 1 yacht.go:253] shutting down controller cluster-lifecycle
I0121 19:09:23.552565 1 clusterlifecycle_controller.go:129] Shutting down cluster lifecycle controller
I0121 19:09:23.552694 1 clusterregistrationrequest_controller.go:113] shutting down cluster-registration-requests controller
I0121 19:09:23.552805 1 helm.go:173] shutting helm deployer
I0121 19:09:23.552824 1 description.go:140] shutting down description controller
I0121 19:09:23.560357 1 helmrelease.go:117] shutting down helmRelease controller
I0121 19:09:23.560402 1 manifest.go:138] shutting down manifest controller
I0121 19:09:23.560421 1 generic.go:126] shutting generic deployer
I0121 19:09:23.560439 1 base.go:129] shutting down base controller
I0121 19:09:23.560473 1 helmchart.go:134] shutting down helmchart controller
I0121 19:09:23.841026 1 aggregatestatus.go:126] shutting down aggregatestatus controller
I0121 19:09:23.841079 1 subscription.go:137] shutting down subscription controller
I0121 19:09:23.841109 1 feedinventory.go:155] shutting down feedInventory controller
I0121 19:09:23.841257 1 globalization.go:139] shutting down Globalization controller
[root@VM-0-13-centos clusternet]# kubectl logs clusternet-controller-manager-594549889-nv4jb -nclusternet-system | tail -20
Trace[1619064350]: [12.599357237s] [12.599357237s] END
I0124 04:37:44.752633 1 trace.go:219] Trace[1633887607]: "Reflector ListAndWatch" name:pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:169 (24-Jan-2024 04:37:31.579) (total time: 13173ms):
Trace[1633887607]: [13.17356457s] [13.17356457s] END
I0124 04:37:44.752655 1 trace.go:219] Trace[571396356]: "Reflector ListAndWatch" name:pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:169 (24-Jan-2024 04:37:30.978) (total time: 13773ms):
Trace[571396356]: [13.773769936s] [13.773769936s] END
I0124 04:37:44.752681 1 trace.go:219] Trace[676846949]: "Reflector ListAndWatch" name:pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:169 (24-Jan-2024 04:37:30.928) (total time: 13824ms):
Trace[676846949]: [13.824117756s] [13.824117756s] END
I0124 04:37:44.752711 1 description.go:140] shutting down description controller
I0124 04:37:44.822004 1 globalization.go:139] shutting down Globalization controller
I0124 04:37:44.822050 1 secret.go:117] shutting down Secret controller
I0124 04:37:44.822072 1 helm.go:173] shutting helm deployer
I0124 04:37:44.822087 1 description.go:140] shutting down description controller
I0124 04:37:44.822103 1 generic.go:126] shutting generic deployer
I0124 04:37:44.822115 1 localization.go:139] shutting down localization controller
I0124 04:37:44.822142 1 aggregatestatus.go:126] shutting down aggregatestatus controller
I0124 04:37:44.822290 1 subscription.go:137] shutting down subscription controller
I0124 04:37:44.822316 1 base.go:129] shutting down base controller
I0124 04:37:44.822335 1 manifest.go:138] shutting down manifest controller
I0124 04:37:44.822437 1 feedinventory.go:155] shutting down feedInventory controller
I0124 04:37:44.858774 1 helmchart.go:134] shutting down helmchart controller scheduler [root@VM-0-13-centos clusternet]# kubectl get pods -nclusternet-system
NAME READY STATUS RESTARTS AGE
clusternet-controller-manager-594549889-7h5vk 1/1 Running 0 3d21h
clusternet-controller-manager-594549889-cwv7x 1/1 Running 0 3d21h
clusternet-controller-manager-594549889-nv4jb 1/1 Running 0 3d21h
clusternet-hub-5d9f4bd454-5n8n4 1/1 Running 0 3d22h
clusternet-hub-5d9f4bd454-tg78b 1/1 Running 0 3d22h
clusternet-hub-5d9f4bd454-xd75g 1/1 Running 0 3d22h
clusternet-scheduler-bb5b68d5-km9vm 1/1 Running 1 3d21h
clusternet-scheduler-bb5b68d5-pjw7z 1/1 Running 1 3d21h
clusternet-scheduler-bb5b68d5-qn9rk 1/1 Running 1 3d21h
[root@VM-0-13-centos clusternet]# kubectl logs clusternet-scheduler-bb5b68d5-km9vm -nclusternet-system
I0124 04:39:13.411265 1 serving.go:348] Generated self-signed cert in-memory
I0124 04:39:13.612662 1 secure_serving.go:210] Serving securely on [::]:10659
I0124 04:39:13.620972 1 tlsconfig.go:240] "Starting DynamicServingCertificateController"
I0124 04:39:14.029658 1 leaderelection.go:248] attempting to acquire leader lease clusternet-system/clusternet-scheduler...
I0124 04:39:14.092573 1 scheduler.go:269] new leader elected: clusternet-scheduler-bb5b68d5-pjw7z_0362f003-232a-49c2-a86b-1f0533011be5
E0124 06:04:16.679193 1 leaderelection.go:330] error retrieving resource lock clusternet-system/clusternet-scheduler: Get "https://10.96.0.1:443/apis/coordination.k8s.io/v1/namespaces/clusternet-system/leases/clusternet-scheduler": stream error: stream ID 3155; INTERNAL_ERROR; received from peer
I0124 06:04:21.385885 1 leaderelection.go:258] successfully acquired lease clusternet-system/clusternet-scheduler
|
避免来回翻译,以下直接使用中文。
您好,目前正在研究多集群,对 clusternet 项目很有兴趣。
自己使用环境部署了一下,但是发现 clusternet-agent 加入父集群失败。
使用环境:
腾讯云 ECS 4C8G
k8s version: v1.20.15
多集群工具: kind
问题:
目前参考 安装文档 使用 helm 部署。目前使用 kind 创建 mater-cluster cluster2 模拟父集群与子集群
切换 context 后才部署的 在 cluster2 下部署
问题:目前发现 子集群中报 failed to create ClusterRegistrationRequest 请问是哪步骤出问题呢?
感谢抽空回答~~
The text was updated successfully, but these errors were encountered: