Documentation ¶
Index ¶
- Constants
- func AddEventHandlersToClusterInformers(numWorkers uint32)
- func BuildContextConfig(kubeconfigPath, context string) (*restclient.Config, error)
- func GenerateKubeConfig(kubeConfigData string) error
- func GetClusterListFromSharedClusters() []string
- func GetClusterListStr(clist []*K8sClusterConfig) []string
- func GetClustersetKubeConfig(kubeClient *kubernetes.Clientset, secretName string) (string, error)
- func GetNodeIP(nodeStatus corev1.NodeStatus) (string, error)
- func GetNodeInfoFromSharedClusters(cname, nodeName string) (string, error)
- func GetSvcInfoFromSharedClusters(cname, ns, svc string) (*corev1.Service, error)
- func GetWorkqueueForCluster(cname string) []workqueue.RateLimitingInterface
- func InformersToRegister(kclient *kubernetes.Clientset, cname string) ([]string, error)
- func InitSharedClusterList(clusterConfigs []*K8sClusterConfig)
- func IsErrorTypeNotFound(err error) bool
- func IsKubePathSet() bool
- func NodeEventHandlers(numWorkers uint32, c *K8sClusterConfig) cache.ResourceEventHandler
- func RunSharedClusterInformers(stopCh <-chan struct{})
- func SvcEventHandlers(numWorkers uint32, c *K8sClusterConfig) cache.ResourceEventHandler
- type ClusterNodeCache
- func (cnc *ClusterNodeCache) AddCluster(cname string)
- func (cnc *ClusterNodeCache) AddNode(cname, node, nodeIP string)
- func (cnc *ClusterNodeCache) DeleteNode(cname, node string)
- func (cnc *ClusterNodeCache) GetNodeCache(cname string) *NodeCache
- func (cnc *ClusterNodeCache) GetNodeInfo(cname, node string) (string, error)
- func (cnc *ClusterNodeCache) GetNodeList(cname string) ([]string, error)
- type K8sClusterConfig
- func (k8sCluster *K8sClusterConfig) ClientSet() kubernetes.Interface
- func (k8sCluster *K8sClusterConfig) GetNodeFromInformer(nodeName string) (string, error)
- func (k8sCluster *K8sClusterConfig) GetNodes() (*corev1.NodeList, error)
- func (k8sCluster *K8sClusterConfig) GetSvcFromInformer(ns, svcName string) (*corev1.Service, error)
- func (k8sCluster *K8sClusterConfig) GetWorkqueue() []workqueue.RateLimitingInterface
- func (k8sCluster *K8sClusterConfig) Name() string
- func (k8sCluster *K8sClusterConfig) ServiceInformer() coreinformers.ServiceInformer
- type K8sServiceDiscoveryConfig
- type NodeCache
Constants ¶
View Source
const ( ServiceImportFullIndexer = "clusterNameNamespaceIndex" ServiceImportClusterIndexer = "clusterIndex" )
View Source
const ( // SDKubePath is to be used for initializing member cluster clients, this constant // must not be used directly, IsKubePathSet() must be checked before using the below // constant SDKubePath = "/tmp/sd-kubeconfig" )
Variables ¶
This section is empty.
Functions ¶
func AddEventHandlersToClusterInformers ¶
func AddEventHandlersToClusterInformers(numWorkers uint32)
func BuildContextConfig ¶
func BuildContextConfig(kubeconfigPath, context string) (*restclient.Config, error)
BuildContextConfig builds the kubernetes/openshift context config
func GenerateKubeConfig ¶
func GetClusterListFromSharedClusters ¶
func GetClusterListFromSharedClusters() []string
func GetClusterListStr ¶
func GetClusterListStr(clist []*K8sClusterConfig) []string
func GetClustersetKubeConfig ¶
func GetClustersetKubeConfig(kubeClient *kubernetes.Clientset, secretName string) (string, error)
GetClustersetKubeConfig fetches the clusterset's secret, validates the secret and returns the kubeconfig for the clusters in the clusterset
func GetWorkqueueForCluster ¶
func GetWorkqueueForCluster(cname string) []workqueue.RateLimitingInterface
func InformersToRegister ¶
func InformersToRegister(kclient *kubernetes.Clientset, cname string) ([]string, error)
func InitSharedClusterList ¶
func InitSharedClusterList(clusterConfigs []*K8sClusterConfig)
func IsErrorTypeNotFound ¶
func IsKubePathSet ¶
func IsKubePathSet() bool
IsKubePathSet returns true if the kubeconfig exists in the SDKubePath
func NodeEventHandlers ¶
func NodeEventHandlers(numWorkers uint32, c *K8sClusterConfig) cache.ResourceEventHandler
func RunSharedClusterInformers ¶
func RunSharedClusterInformers(stopCh <-chan struct{})
func SvcEventHandlers ¶
func SvcEventHandlers(numWorkers uint32, c *K8sClusterConfig) cache.ResourceEventHandler
Types ¶
type ClusterNodeCache ¶
type ClusterNodeCache struct {
// contains filtered or unexported fields
}
func GetClusterNodeCache ¶
func GetClusterNodeCache() *ClusterNodeCache
func (*ClusterNodeCache) AddCluster ¶
func (cnc *ClusterNodeCache) AddCluster(cname string)
func (*ClusterNodeCache) AddNode ¶
func (cnc *ClusterNodeCache) AddNode(cname, node, nodeIP string)
func (*ClusterNodeCache) DeleteNode ¶
func (cnc *ClusterNodeCache) DeleteNode(cname, node string)
func (*ClusterNodeCache) GetNodeCache ¶
func (cnc *ClusterNodeCache) GetNodeCache(cname string) *NodeCache
func (*ClusterNodeCache) GetNodeInfo ¶
func (cnc *ClusterNodeCache) GetNodeInfo(cname, node string) (string, error)
func (*ClusterNodeCache) GetNodeList ¶
func (cnc *ClusterNodeCache) GetNodeList(cname string) ([]string, error)
type K8sClusterConfig ¶
type K8sClusterConfig struct {
// contains filtered or unexported fields
}
func InitK8sClusterConfig ¶
func InitK8sClusterConfig(cname string) (*K8sClusterConfig, error)
InitK8sClusterConfig initializes a kubernetes cluster client and informers. "name" must have the cluster context name.
func (*K8sClusterConfig) ClientSet ¶
func (k8sCluster *K8sClusterConfig) ClientSet() kubernetes.Interface
func (*K8sClusterConfig) GetNodeFromInformer ¶
func (k8sCluster *K8sClusterConfig) GetNodeFromInformer(nodeName string) (string, error)
GetNodeFromInformer returns the IP of the node and the error (if any)
func (*K8sClusterConfig) GetNodes ¶
func (k8sCluster *K8sClusterConfig) GetNodes() (*corev1.NodeList, error)
func (*K8sClusterConfig) GetSvcFromInformer ¶
func (k8sCluster *K8sClusterConfig) GetSvcFromInformer(ns, svcName string) (*corev1.Service, error)
func (*K8sClusterConfig) GetWorkqueue ¶
func (k8sCluster *K8sClusterConfig) GetWorkqueue() []workqueue.RateLimitingInterface
func (*K8sClusterConfig) Name ¶
func (k8sCluster *K8sClusterConfig) Name() string
func (*K8sClusterConfig) ServiceInformer ¶
func (k8sCluster *K8sClusterConfig) ServiceInformer() coreinformers.ServiceInformer
type K8sServiceDiscoveryConfig ¶
type K8sServiceDiscoveryConfig struct {
// contains filtered or unexported fields
}
func InitK8sServiceDiscoveryConfig ¶
func InitK8sServiceDiscoveryConfig(cfg *rest.Config) (*K8sServiceDiscoveryConfig, error)
func (*K8sServiceDiscoveryConfig) GetAmkoV1Clientset ¶
func (sdc *K8sServiceDiscoveryConfig) GetAmkoV1Clientset() *akov1.Clientset
func (*K8sServiceDiscoveryConfig) GetClientset ¶
func (sdc *K8sServiceDiscoveryConfig) GetClientset() *kubernetes.Clientset
func (*K8sServiceDiscoveryConfig) SetClusterConfigs ¶
func (sdc *K8sServiceDiscoveryConfig) SetClusterConfigs(cc []*K8sClusterConfig)
type NodeCache ¶
type NodeCache struct {
// contains filtered or unexported fields
}
func GetNodeCache ¶
func GetNodeCache() *NodeCache
func (*NodeCache) GetAllNodeIPs ¶
Click to show internal directories.
Click to hide internal directories.