github.com/cilium/cilium@v1.16.2/operator/endpointgc/cell.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright Authors of Cilium
     3  
     4  package endpointgc
     5  
     6  import (
     7  	"time"
     8  
     9  	"github.com/cilium/hive/cell"
    10  
    11  	"github.com/cilium/cilium/pkg/metrics"
    12  )
    13  
    14  // Cell is a cell that implements a periodic and one-off Cilium endpoints
    15  // garbage collector.
    16  // The GC loops through all the Cilium Endpoints in the cluster and validates
    17  // which one of them should be deleted. Then deleting all that should be
    18  // deleted.
    19  var Cell = cell.Module(
    20  	"k8s-endpoints-gc",
    21  	"Cilium endpoints garbage collector",
    22  
    23  	// Invoke forces the instantiation of the endpoint gc
    24  	cell.Invoke(registerGC),
    25  
    26  	metrics.Metric(NewMetrics),
    27  )
    28  
    29  // SharedConfig contains the configuration that is shared between
    30  // this module and others.
    31  // It is a temporary solution meant to avoid polluting this module with a direct
    32  // dependency on global operator and daemon configurations.
    33  type SharedConfig struct {
    34  	// Interval is the interval between attempts of the CEP GC controller.
    35  	// Note that only one node per cluster should run this, and most iterations
    36  	// will simply return.
    37  	Interval time.Duration
    38  
    39  	// DisableCiliumEndpointCRD disables the use of CiliumEndpoint CRD
    40  	DisableCiliumEndpointCRD bool
    41  }