Documentation ¶
Index ¶
Constants ¶
View Source
const (
// EnvClusterCacheResyncDuration is the env variable that holds cluster cache re-sync duration
EnvClusterCacheResyncDuration = "ARGOCD_CLUSTER_CACHE_RESYNC_DURATION"
)
Variables ¶
View Source
var ( // K8SClusterResyncDuration controls the duration of cluster cache refresh K8SClusterResyncDuration = 12 * time.Hour )
Functions ¶
This section is empty.
Types ¶
type LiveStateCache ¶
type LiveStateCache interface { // Returns k8s server version GetVersionsInfo(serverURL string) (string, []kube.APIResourceInfo, error) // Returns true of given group kind is a namespaced resource IsNamespaced(server string, gk schema.GroupKind) (bool, error) // Returns synced cluster cache GetClusterCache(server string) (clustercache.ClusterCache, error) // Executes give callback against resource specified by the key and all its children IterateHierarchy(server string, key kube.ResourceKey, action func(child appv1.ResourceNode, appName string)) error // Returns state of live nodes which correspond for target nodes of specified application. GetManagedLiveObjs(a *appv1.Application, targetObjs []*unstructured.Unstructured) (map[kube.ResourceKey]*unstructured.Unstructured, error) // IterateResources iterates all resource stored in cache IterateResources(server string, callback func(res *clustercache.Resource, info *ResourceInfo)) error // Returns all top level resources (resources without owner references) of a specified namespace GetNamespaceTopLevelResources(server string, namespace string) (map[kube.ResourceKey]appv1.ResourceNode, error) // Starts watching resources of each controlled cluster. Run(ctx context.Context) error // Returns information about monitored clusters GetClustersInfo() []clustercache.ClusterInfo // Init must be executed before cache can be used Init() error }
func NewLiveStateCache ¶
func NewLiveStateCache( db db.ArgoDB, appInformer cache.SharedIndexInformer, settingsMgr *settings.SettingsManager, kubectl kube.Kubectl, metricsServer *metrics.MetricsServer, onObjectUpdated ObjectUpdatedHandler, clusterFilter func(cluster *appv1.Cluster) bool, resourceTracking argo.ResourceTracking) LiveStateCache
type NodeInfo ¶
type NodeInfo struct { Name string Capacity v1.ResourceList SystemInfo v1.NodeSystemInfo }
type ObjectUpdatedHandler ¶
type ObjectUpdatedHandler = func(managedByApp map[string]bool, ref v1.ObjectReference)
type PodInfo ¶
type PodInfo struct { NodeName string ResourceRequests v1.ResourceList Phase v1.PodPhase }
type ResourceInfo ¶
type ResourceInfo struct { Info []appv1.InfoItem AppName string Images []string Health *health.HealthStatus // NetworkingInfo are available only for known types involved into networking: Ingress, Service, Pod NetworkingInfo *appv1.ResourceNetworkingInfo // PodInfo is available for pods only PodInfo *PodInfo // NodeInfo is available for nodes only NodeInfo *NodeInfo }
Click to show internal directories.
Click to hide internal directories.