spidernet-io / spiderpool

Underlay and RDMA network solution of the Kubernetes, for bare metal, VM and any public cloud
https://spidernet-io.github.io/spiderpool/
Apache License 2.0
535 stars 75 forks source link

The spiderpool installation starts too slowly #799

Closed Aoisop closed 2 years ago

Aoisop commented 2 years ago

Describe the version version about: spiderpool: 0.2.0

Describe the bug The spiderpool installation starts too slowly

Copy-paste the output the test. {"level":"INFO","ts":"2022-09-28T15:21:07.191Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:69","msg":"gops is listening on 127.0.0.1:5724 "} {"level":"INFO","ts":"2022-09-28T15:21:07.191Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:98","msg":"Begin to initialize spiderpool-controller CRD Manager"} {"level":"INFO","ts":"2022-09-28T15:21:08.252Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:105","msg":"Begin to initialize k8s Clientset"} {"level":"INFO","ts":"2022-09-28T15:21:08.252Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:54","msg":"generate server certificate for service kube-system/spiderpool-controller and webhook kube-system/spiderpool-controller, to secret kube-system/spiderpool-controller-server-certs, with ca expire 73000 days and keyBitLength 3072 , cert expire 3650 days "} {"level":"INFO","ts":"2022-09-28T15:21:08.260Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:138","msg":"key bit length","key-bit-length":"3072"} {"level":"INFO","ts":"2022-09-28T15:21:08.261Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:275","msg":"generate received request"} {"level":"INFO","ts":"2022-09-28T15:21:08.261Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:275","msg":"received CSR"} {"level":"INFO","ts":"2022-09-28T15:21:08.261Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:275","msg":"generating key: rsa-3072"} {"level":"INFO","ts":"2022-09-28T15:21:11.822Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:275","msg":"encoded CSR"} {"level":"INFO","ts":"2022-09-28T15:21:11.883Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:275","msg":"signed certificate with serial number 8220863671382316686585570796274905124968145219"} {"level":"INFO","ts":"2022-09-28T15:21:11.883Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:84","msg":"generate csr and private key"} {"level":"INFO","ts":"2022-09-28T15:21:11.883Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:162","msg":"generating Certificate Signing Request"} {"level":"INFO","ts":"2022-09-28T15:21:11.883Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:275","msg":"received CSR"} {"level":"INFO","ts":"2022-09-28T15:21:11.883Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:275","msg":"generating key: rsa-3072"} {"level":"INFO","ts":"2022-09-28T15:21:14.104Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:275","msg":"encoded CSR"} {"level":"INFO","ts":"2022-09-28T15:21:14.104Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:90","msg":"generate server certificate"} {"level":"INFO","ts":"2022-09-28T15:21:14.112Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:275","msg":"signed certificate with serial number 362916668458004818347127416178654397032192925792"} {"level":"INFO","ts":"2022-09-28T15:21:14.112Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:100","msg":"apply server certificate to secret "} {"level":"INFO","ts":"2022-09-28T15:21:24.162Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:191","msg":"check secret"} {"level":"INFO","ts":"2022-09-28T15:21:24.169Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:228","msg":"cert is ready"} {"level":"INFO","ts":"2022-09-28T15:21:24.169Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:119","msg":"update mutating webhook kube-system/spiderpool-controller"} {"level":"INFO","ts":"2022-09-28T15:21:24.186Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:125","msg":"update validating webhook kube-system/spiderpool-controller"} I0928 15:21:24.202747 1 leaderelection.go:248] attempting to acquire leader lease kube-system/spiderpool-controller-leases... {"level":"INFO","ts":"2022-09-28T15:21:24.201Z","logger":"spiderpool-controller.certificate-generator","caller":"cert/gen.go:131","msg":"all resources created successfully"} {"level":"INFO","ts":"2022-09-28T15:21:24.201Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:206","msg":"Begin to initialize spiderpool controller leader election"} {"level":"INFO","ts":"2022-09-28T15:21:24.202Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:209","msg":"Begin to initialize WorkloadEndpoint Manager"} {"level":"INFO","ts":"2022-09-28T15:21:24.202Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:219","msg":"Begin to initialize ReservedIP Manager"} {"level":"INFO","ts":"2022-09-28T15:21:24.202Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:226","msg":"Begin to set up ReservedIP webhook"} {"level":"INFO","ts":"2022-09-28T15:21:24.202Z","logger":"Lease-Lock-Election","caller":"election/lease_election.go:163","msg":"'kube-system/spiderpool-controller-leases/spiderpool-controller-9f5cc5575-dncdp' is trying to elect"} {"level":"INFO","ts":"2022-09-28T15:21:24.202Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:232","msg":"Begin to initialize Node Manager"} {"level":"INFO","ts":"2022-09-28T15:21:24.202Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:239","msg":"Begin to initialize Namespace Manager"} {"level":"INFO","ts":"2022-09-28T15:21:24.202Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:246","msg":"Begin to initialize Pod Manager"} {"level":"INFO","ts":"2022-09-28T15:21:24.202Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:255","msg":"Begin to initialize StatefulSet Manager"} {"level":"INFO","ts":"2022-09-28T15:21:24.202Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:262","msg":"Begin to initialize IPPool Manager"} {"level":"INFO","ts":"2022-09-28T15:21:24.203Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:275","msg":"Begin to set up SpiderIPPool informer"} {"level":"INFO","ts":"2022-09-28T15:21:24.203Z","logger":"SpiderIPPool-Informer","caller":"ippoolmanager/ippool_informer.go:36","msg":"try to register SpiderIPPool informer"} {"level":"INFO","ts":"2022-09-28T15:21:24.203Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:286","msg":"Begin to set up SpiderIPPool webhook"} {"level":"INFO","ts":"2022-09-28T15:21:24.203Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:293","msg":"Begin to initialize Subnet Manager"} {"level":"INFO","ts":"2022-09-28T15:21:24.203Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:305","msg":"Begin to set up SpiderSubnet informer"} {"level":"INFO","ts":"2022-09-28T15:21:24.203Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:311","msg":"Begin to set up Subnet webhook"} {"level":"INFO","ts":"2022-09-28T15:21:24.204Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:139","msg":"Begin to initialize http server"} {"level":"INFO","ts":"2022-09-28T15:21:24.205Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:133","msg":"Starting spiderpool-controller CRD Manager"} {"level":"INFO","ts":"2022-09-28T15:21:24.209Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:157","msg":"Begin to initialize spiderpool-controller metrics http server"} {"level":"INFO","ts":"2022-09-28T15:21:24.209Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:161","msg":"Begin to initialize IP GC Manager"} {"level":"INFO","ts":"2022-09-28T15:21:24.222Z","logger":"IP-GarbageCollection","caller":"gcmanager/gc_manager.go:141","msg":"running IP garbage collection"} {"level":"INFO","ts":"2022-09-28T15:21:24.223Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:165","msg":"Set spiderpool-controller Startup probe ready"} {"level":"INFO","ts":"2022-09-28T15:21:24.223Z","logger":"IP-GarbageCollection","caller":"gcmanager/tracePod_worker.go:66","msg":"Starting running 'releaseIPPoolIPExecutor'","IPPoolIP_Worker":2} {"level":"INFO","ts":"2022-09-28T15:21:24.223Z","logger":"spiderpool-controller","caller":"cmd/http_server.go:28","msg":"Serving spiderpool controller API at http://[[::]:5720]"} {"level":"DEBUG","ts":"2022-09-28T15:21:24.223Z","logger":"IP-GarbageCollection","caller":"gcmanager/scanAll_IPPool.go:23","msg":"start to monitor gc signal for CLI or default GC interval"} {"level":"INFO","ts":"2022-09-28T15:21:24.223Z","logger":"IP-GarbageCollection","caller":"gcmanager/tracePod_worker.go:66","msg":"Starting running 'releaseIPPoolIPExecutor'","IPPoolIP_Worker":0} {"level":"DEBUG","ts":"2022-09-28T15:21:24.223Z","logger":"IP-GarbageCollection","caller":"gcmanager/scanAll_IPPool.go:28","msg":"initial scan all for cluster firstly"} {"level":"INFO","ts":"2022-09-28T15:21:24.223Z","logger":"IP-GarbageCollection","caller":"gcmanager/scanAll_IPPool.go:49","msg":"receive CLI GC request, execute scan all right now!"} {"level":"INFO","ts":"2022-09-28T15:21:24.223Z","logger":"IP-GarbageCollection","caller":"gcmanager/tracePod_worker.go:66","msg":"Starting running 'releaseIPPoolIPExecutor'","IPPoolIP_Worker":1} {"level":"INFO","ts":"2022-09-28T15:21:24.223Z","logger":"IP-GarbageCollection","caller":"gcmanager/pod_informer.go:14","msg":"register pod informer"} {"level":"INFO","ts":"2022-09-28T15:21:24.223Z","logger":"IP-GarbageCollection","caller":"gcmanager/pod_informer.go:17","msg":"create Pod informer"} {"level":"INFO","ts":"2022-09-28T15:21:24.223Z","logger":"IP-GarbageCollection","caller":"gcmanager/tracePod_worker.go:19","msg":"starting trace pod worker"} {"level":"INFO","ts":"2022-09-28T15:21:25.752Z","logger":"Subnet-Webhook.Mutating","caller":"subnetmanager/subnet_webhook.go:49","msg":"Start to mutate Subnet","SubnetName":"default-v4-subnet","Operation":"DEFAULT"} {"level":"DEBUG","ts":"2022-09-28T15:21:25.752Z","logger":"Subnet-Webhook.Mutating","caller":"subnetmanager/subnet_webhook.go:50","msg":"Request Subnet: {TypeMeta:{Kind:SpiderSubnet APIVersion:spiderpool.spidernet.io/v1} ObjectMeta:{Name:default-v4-subnet GenerateName: Namespace: SelfLink: UID: ResourceVersion: Generation:0 CreationTimestamp:0001-01-01 00:00:00 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[] ZZZ_DeprecatedClusterName: ManagedFields:[{Manager:spiderpool-init Operation:Update APIVersion:spiderpool.spidernet.io/v1 Time:2022-09-28 15:22:01 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:spec\":{\".\":{},\"f:gateway\":{},\"f:ips\":{},\"f:subnet\":{},\"f:vlan\":{}}} Subresource:}]} Spec:{IPVersion:<nil> Subnet:10.6.0.0/16 IPs:[10.6.185.170-10.6.185.199] ExcludeIPs:[] Gateway:0xc000349ca0 Vlan:0xc0005c34a8 Routes:[]} Status:{FreeIPs:[] TotalIPCount:<nil> FreeIPCount:<nil>}}","SubnetName":"default-v4-subnet","Operation":"DEFAULT"} {"level":"INFO","ts":"2022-09-28T15:21:25.752Z","logger":"Subnet-Webhook.Mutating","caller":"subnetmanager/subnet_webhook.go:70","msg":"Set 'spec.ipVersion' to 4","SubnetName":"default-v4-subnet","Operation":"DEFAULT"} {"level":"DEBUG","ts":"2022-09-28T15:21:25.817Z","logger":"Subnet-Webhook.Validating","caller":"subnetmanager/subnet_webhook.go:109","msg":"Request Subnet: {TypeMeta:{Kind:SpiderSubnet APIVersion:spiderpool.spidernet.io/v1} ObjectMeta:{Name:default-v4-subnet GenerateName: Namespace: SelfLink: UID:dca0c723-c723-4893-b29d-5d71a08e9fab ResourceVersion: Generation:1 CreationTimestamp:2022-09-28 15:22:01 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[] ZZZ_DeprecatedClusterName: ManagedFields:[{Manager:spiderpool-init Operation:Update APIVersion:spiderpool.spidernet.io/v1 Time:2022-09-28 15:22:01 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:spec\":{\".\":{},\"f:gateway\":{},\"f:ips\":{},\"f:subnet\":{},\"f:vlan\":{}}} Subresource:}]} Spec:{IPVersion:0xc000843020 Subnet:10.6.0.0/16 IPs:[10.6.185.170-10.6.185.199] ExcludeIPs:[] Gateway:0xc00099ead0 Vlan:0xc000843028 Routes:[]} Status:{FreeIPs:[] TotalIPCount:<nil> FreeIPCount:<nil>}}","SubnetName":"default-v4-subnet","Operation":"CREATE"} {"level":"INFO","ts":"2022-09-28T15:21:26.075Z","logger":"IPPool-Webhook.Mutating","caller":"ippoolmanager/ippool_webhook.go:51","msg":"Start to mutate IPPool","IPPoolName":"default-v4-ippool","Operation":"DEFAULT"} {"level":"DEBUG","ts":"2022-09-28T15:21:26.075Z","logger":"IPPool-Webhook.Mutating","caller":"ippoolmanager/ippool_webhook.go:52","msg":"Request IPPool: {TypeMeta:{Kind:SpiderIPPool APIVersion:spiderpool.spidernet.io/v1} ObjectMeta:{Name:default-v4-ippool GenerateName: Namespace: SelfLink: UID: ResourceVersion: Generation:0 CreationTimestamp:0001-01-01 00:00:00 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[] ZZZ_DeprecatedClusterName: ManagedFields:[{Manager:spiderpool-init Operation:Update APIVersion:spiderpool.spidernet.io/v1 Time:2022-09-28 15:22:01 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:spec\":{\".\":{},\"f:disable\":{},\"f:gateway\":{},\"f:ips\":{},\"f:subnet\":{},\"f:vlan\":{}}} Subresource:}]} Spec:{IPVersion:<nil> Subnet:10.6.0.0/16 IPs:[10.6.185.170-10.6.185.199] Disable:0xc0005a3ad6 ExcludeIPs:[] Gateway:0xc0015a8d90 Vlan:0xc0005a3af0 Routes:[] PodAffinity:nil NamespaceAffinity:nil NodeAffinity:nil} Status:{AllocatedIPs:map[] TotalIPCount:<nil> AllocatedIPCount:<nil>}}","IPPoolName":"default-v4-ippool","Operation":"DEFAULT"} {"level":"INFO","ts":"2022-09-28T15:21:26.075Z","logger":"IPPool-Webhook.Mutating","caller":"ippoolmanager/ippool_webhook.go:72","msg":"Set 'spec.ipVersion' to 4","IPPoolName":"default-v4-ippool","Operation":"DEFAULT"} {"level":"INFO","ts":"2022-09-28T15:21:26.075Z","logger":"IPPool-Webhook.Mutating","caller":"ippoolmanager/ippool_webhook.go:97","msg":"Add finalizer spiderpool.spidernet.io","IPPoolName":"default-v4-ippool","Operation":"DEFAULT"} {"level":"DEBUG","ts":"2022-09-28T15:21:26.102Z","logger":"IPPool-Webhook.Validating","caller":"ippoolmanager/ippool_webhook.go:119","msg":"Request IPPool: {TypeMeta:{Kind:SpiderIPPool APIVersion:spiderpool.spidernet.io/v1} ObjectMeta:{Name:default-v4-ippool GenerateName: Namespace: SelfLink: UID:3a7a202c-de63-4903-ba7e-f1113e378e4f ResourceVersion: Generation:1 CreationTimestamp:2022-09-28 15:22:01 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[spiderpool.spidernet.io] ZZZ_DeprecatedClusterName: ManagedFields:[{Manager:spiderpool-init Operation:Update APIVersion:spiderpool.spidernet.io/v1 Time:2022-09-28 15:22:01 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:spec\":{\".\":{},\"f:disable\":{},\"f:gateway\":{},\"f:ips\":{},\"f:subnet\":{},\"f:vlan\":{}}} Subresource:}]} Spec:{IPVersion:0xc0016fe010 Subnet:10.6.0.0/16 IPs:[10.6.185.170-10.6.185.199] Disable:0xc0016fe006 ExcludeIPs:[] Gateway:0xc00099ede0 Vlan:0xc0016fe018 Routes:[] PodAffinity:nil NamespaceAffinity:nil NodeAffinity:nil} Status:{AllocatedIPs:map[] TotalIPCount:<nil> AllocatedIPCount:<nil>}}","IPPoolName":"default-v4-ippool","Operation":"CREATE"} {"level":"ERROR","ts":"2022-09-28T15:21:26.130Z","logger":"IPPool-Webhook.Validating","caller":"ippoolmanager/ippool_webhook.go:122","msg":"Failed to create IPPool: spec.ips: Forbidden: add some IP ranges [10.6.185.170-10.6.185.199] that are not free in controller Subnet default-v4-subnet, total IP addresses of an IPPool are jointly determined by 'spec.ips' and 'spec.excludeIPs'","IPPoolName":"default-v4-ippool","Operation":"CREATE"} {"level":"INFO","ts":"2022-09-28T15:21:28.164Z","logger":"IPPool-Webhook.Mutating","caller":"ippoolmanager/ippool_webhook.go:51","msg":"Start to mutate IPPool","IPPoolName":"default-v4-ippool","Operation":"DEFAULT"} {"level":"DEBUG","ts":"2022-09-28T15:21:28.164Z","logger":"IPPool-Webhook.Mutating","caller":"ippoolmanager/ippool_webhook.go:52","msg":"Request IPPool: {TypeMeta:{Kind:SpiderIPPool APIVersion:spiderpool.spidernet.io/v1} ObjectMeta:{Name:default-v4-ippool GenerateName: Namespace: SelfLink: UID: ResourceVersion: Generation:0 CreationTimestamp:0001-01-01 00:00:00 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[] ZZZ_DeprecatedClusterName: ManagedFields:[{Manager:spiderpool-init Operation:Update APIVersion:spiderpool.spidernet.io/v1 Time:2022-09-28 15:22:03 +0000 UTC FieldsType:FieldsV1 FieldsV1:{\"f:spec\":{\".\":{},\"f:disable\":{},\"f:gateway\":{},\"f:ips\":{},\"f:subnet\":{},\"f:vlan\":{}}} Subresource:}]} Spec:{IPVersion:<nil> Subnet:10.6.0.0/16 IPs:[10.6.185.170-10.6.185.199] Disable:0xc0008d8996 ExcludeIPs:[] Gateway:0xc0015a9770 Vlan:0xc0008d89b0 Routes:[] PodAffinity:nil NamespaceAffinity:nil NodeAffinity:nil} Status:{AllocatedIPs:map[] TotalIPCount:<nil> AllocatedIPCount:<nil>}}","IPPoolName":"default-v4-ippool","Operation":"DEFAULT"}

weizhoublue commented 2 years ago

fix https://github.com/spidernet-io/spiderpool/commit/9e133964b503e10244bf08e03485b6716b701342