github.com/cilium/cilium@v1.16.2/clustermesh-apiserver/kvstoremesh/cells.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright Authors of Cilium 3 4 package kvstoremesh 5 6 import ( 7 "github.com/cilium/hive/cell" 8 9 "github.com/cilium/cilium/clustermesh-apiserver/health" 10 cmmetrics "github.com/cilium/cilium/clustermesh-apiserver/metrics" 11 "github.com/cilium/cilium/clustermesh-apiserver/option" 12 "github.com/cilium/cilium/clustermesh-apiserver/syncstate" 13 "github.com/cilium/cilium/pkg/clustermesh/kvstoremesh" 14 cmtypes "github.com/cilium/cilium/pkg/clustermesh/types" 15 "github.com/cilium/cilium/pkg/controller" 16 "github.com/cilium/cilium/pkg/defaults" 17 "github.com/cilium/cilium/pkg/gops" 18 "github.com/cilium/cilium/pkg/kvstore" 19 "github.com/cilium/cilium/pkg/pprof" 20 ) 21 22 var Cell = cell.Module( 23 "kvstoremesh", 24 "Cilium KVStoreMesh", 25 26 cell.Config(option.DefaultLegacyKVStoreMeshConfig), 27 cell.Config(kvstoremesh.DefaultConfig), 28 29 cell.Config(cmtypes.DefaultClusterInfo), 30 cell.Invoke(registerClusterInfoValidator), 31 32 pprof.Cell, 33 cell.Config(pprof.Config{ 34 PprofAddress: option.PprofAddress, 35 PprofPort: option.PprofPortKVStoreMesh, 36 }), 37 controller.Cell, 38 39 gops.Cell(defaults.GopsPortKVStoreMesh), 40 cmmetrics.Cell, 41 42 HealthAPIEndpointsCell, 43 health.HealthAPIServerCell, 44 45 APIServerCell, 46 47 kvstore.Cell(kvstore.EtcdBackendName), 48 cell.Provide(func(ss syncstate.SyncState) *kvstore.ExtraOptions { 49 return &kvstore.ExtraOptions{ 50 BootstrapComplete: ss.WaitChannel(), 51 } 52 }), 53 kvstoremesh.Cell, 54 55 cell.Invoke(kvstoremesh.RegisterSyncWaiter), 56 57 cell.Invoke(func(*kvstoremesh.KVStoreMesh) {}), 58 )