Documentation ¶
Index ¶
- Constants
- Variables
- func BuildClient(master string, kubeconfig string) (*kubernetes.Clientset, *rest.Config, error)
- func BuildClientConfig(master string, kubeconfig string) (*rest.Config, *clientcmdapi.Config, error)
- func BuildKubeConfigPath(c manager.ICluster, kubeconfig string) (string, error)
- func ClusterKubeConfigPath(c manager.ICluster) string
- func InitClustersManager(dbManager manager.IClusterManager) error
- type CacheFactory
- func (c *CacheFactory) ClusterRoleBindingLister() rbac.ClusterRoleBindingLister
- func (c *CacheFactory) ClusterRoleLister() rbac.ClusterRoleLister
- func (c *CacheFactory) ConfigMapLister() v1.ConfigMapLister
- func (c *CacheFactory) CronJobLister() cache.GenericLister
- func (c *CacheFactory) DaemonSetLister() apps.DaemonSetLister
- func (c *CacheFactory) DeploymentLister() apps.DeploymentLister
- func (c *CacheFactory) DisableBidirectionalSync()
- func (c *CacheFactory) EnableBidirectionalSync()
- func (c *CacheFactory) EndpointLister() v1.EndpointsLister
- func (c *CacheFactory) EventLister() v1.EventLister
- func (c *CacheFactory) GetGVKR(kindName string) *api.ResourceMap
- func (c *CacheFactory) HPALister() autoscalingv1.HorizontalPodAutoscalerLister
- func (c *CacheFactory) IngressLister() cache.GenericLister
- func (c *CacheFactory) JobLister() batch.JobLister
- func (c *CacheFactory) LimitRangeLister() v1.LimitRangeLister
- func (c *CacheFactory) NamespaceLister() v1.NamespaceLister
- func (c *CacheFactory) NodeLister() v1.NodeLister
- func (c *CacheFactory) PVCLister() v1.PersistentVolumeClaimLister
- func (c *CacheFactory) PVLister() v1.PersistentVolumeLister
- func (c *CacheFactory) PodLister() v1.PodLister
- func (c *CacheFactory) ReplicaSetLister() apps.ReplicaSetLister
- func (c *CacheFactory) ReplicationControllerLister() v1.ReplicationControllerLister
- func (c *CacheFactory) ResourceQuotaLister() v1.ResourceQuotaLister
- func (c *CacheFactory) RoleBindingLister() rbac.RoleBindingLister
- func (c *CacheFactory) RoleLister() rbac.RoleLister
- func (c *CacheFactory) SecretLister() v1.SecretLister
- func (c *CacheFactory) ServiceAccountLister() v1.ServiceAccountLister
- func (c *CacheFactory) ServiceLister() v1.ServiceLister
- func (c *CacheFactory) StatefulSetLister() apps.StatefulSetLister
- func (c *CacheFactory) StorageClassLister() storage.StorageClassLister
- type ClusterManager
- func (c ClusterManager) Close()
- func (c ClusterManager) GetClient() *clientv2.Client
- func (c ClusterManager) GetClientset() kubernetes.Interface
- func (c ClusterManager) GetClusterObject() manager.ICluster
- func (c ClusterManager) GetHandler() ResourceHandler
- func (c ClusterManager) GetId() string
- func (c ClusterManager) GetIndexer() *CacheFactory
- func (c ClusterManager) GetKubeConfigPath() (string, error)
- func (c ClusterManager) GetName() string
- type ClustersManager
- type IClustersManager
- type ResourceHandler
Constants ¶
View Source
const ( ErrClusterAlreadyAdded = errors.Error("Cluster already added") ErrClusterNotRunning = errors.Error("Cluster not running") )
Variables ¶
View Source
var ( ErrNotExist = errors.Error("cluster not exist.") ErrStatus = errors.Error("cluster invalid status, please try again later.") )
Functions ¶
func BuildClient ¶
func BuildClientConfig ¶
func BuildKubeConfigPath ¶
func ClusterKubeConfigPath ¶
func InitClustersManager ¶
func InitClustersManager(dbManager manager.IClusterManager) error
Types ¶
type CacheFactory ¶
type CacheFactory struct {
// contains filtered or unexported fields
}
func (*CacheFactory) ClusterRoleBindingLister ¶
func (c *CacheFactory) ClusterRoleBindingLister() rbac.ClusterRoleBindingLister
func (*CacheFactory) ClusterRoleLister ¶
func (c *CacheFactory) ClusterRoleLister() rbac.ClusterRoleLister
func (*CacheFactory) ConfigMapLister ¶
func (c *CacheFactory) ConfigMapLister() v1.ConfigMapLister
func (*CacheFactory) CronJobLister ¶
func (c *CacheFactory) CronJobLister() cache.GenericLister
func (*CacheFactory) DaemonSetLister ¶
func (c *CacheFactory) DaemonSetLister() apps.DaemonSetLister
func (*CacheFactory) DeploymentLister ¶
func (c *CacheFactory) DeploymentLister() apps.DeploymentLister
func (*CacheFactory) DisableBidirectionalSync ¶
func (c *CacheFactory) DisableBidirectionalSync()
func (*CacheFactory) EnableBidirectionalSync ¶
func (c *CacheFactory) EnableBidirectionalSync()
func (*CacheFactory) EndpointLister ¶
func (c *CacheFactory) EndpointLister() v1.EndpointsLister
func (*CacheFactory) EventLister ¶
func (c *CacheFactory) EventLister() v1.EventLister
func (*CacheFactory) GetGVKR ¶
func (c *CacheFactory) GetGVKR(kindName string) *api.ResourceMap
func (*CacheFactory) HPALister ¶
func (c *CacheFactory) HPALister() autoscalingv1.HorizontalPodAutoscalerLister
func (*CacheFactory) IngressLister ¶
func (c *CacheFactory) IngressLister() cache.GenericLister
func (*CacheFactory) JobLister ¶
func (c *CacheFactory) JobLister() batch.JobLister
func (*CacheFactory) LimitRangeLister ¶
func (c *CacheFactory) LimitRangeLister() v1.LimitRangeLister
func (*CacheFactory) NamespaceLister ¶
func (c *CacheFactory) NamespaceLister() v1.NamespaceLister
func (*CacheFactory) NodeLister ¶
func (c *CacheFactory) NodeLister() v1.NodeLister
func (*CacheFactory) PVCLister ¶
func (c *CacheFactory) PVCLister() v1.PersistentVolumeClaimLister
func (*CacheFactory) PVLister ¶
func (c *CacheFactory) PVLister() v1.PersistentVolumeLister
func (*CacheFactory) PodLister ¶
func (c *CacheFactory) PodLister() v1.PodLister
func (*CacheFactory) ReplicaSetLister ¶
func (c *CacheFactory) ReplicaSetLister() apps.ReplicaSetLister
func (*CacheFactory) ReplicationControllerLister ¶
func (c *CacheFactory) ReplicationControllerLister() v1.ReplicationControllerLister
func (*CacheFactory) ResourceQuotaLister ¶
func (c *CacheFactory) ResourceQuotaLister() v1.ResourceQuotaLister
func (*CacheFactory) RoleBindingLister ¶
func (c *CacheFactory) RoleBindingLister() rbac.RoleBindingLister
func (*CacheFactory) RoleLister ¶
func (c *CacheFactory) RoleLister() rbac.RoleLister
func (*CacheFactory) SecretLister ¶
func (c *CacheFactory) SecretLister() v1.SecretLister
func (*CacheFactory) ServiceAccountLister ¶
func (c *CacheFactory) ServiceAccountLister() v1.ServiceAccountLister
func (*CacheFactory) ServiceLister ¶
func (c *CacheFactory) ServiceLister() v1.ServiceLister
func (*CacheFactory) StatefulSetLister ¶
func (c *CacheFactory) StatefulSetLister() apps.StatefulSetLister
func (*CacheFactory) StorageClassLister ¶
func (c *CacheFactory) StorageClassLister() storage.StorageClassLister
type ClusterManager ¶
type ClusterManager struct { Cluster manager.ICluster Config *rest.Config KubeClient ResourceHandler APIServer string KubeConfig string ClientV2 *clientv2.Client // contains filtered or unexported fields }
func GetManager ¶
func GetManager(cluster string) (*ClusterManager, error)
func GetManagerByCluster ¶
func GetManagerByCluster(c manager.ICluster) (*ClusterManager, error)
func (ClusterManager) Close ¶
func (c ClusterManager) Close()
func (ClusterManager) GetClient ¶
func (c ClusterManager) GetClient() *clientv2.Client
func (ClusterManager) GetClientset ¶
func (c ClusterManager) GetClientset() kubernetes.Interface
func (ClusterManager) GetClusterObject ¶
func (c ClusterManager) GetClusterObject() manager.ICluster
func (ClusterManager) GetHandler ¶
func (c ClusterManager) GetHandler() ResourceHandler
func (ClusterManager) GetId ¶
func (c ClusterManager) GetId() string
func (ClusterManager) GetIndexer ¶
func (c ClusterManager) GetIndexer() *CacheFactory
func (ClusterManager) GetKubeConfigPath ¶
func (c ClusterManager) GetKubeConfigPath() (string, error)
func (ClusterManager) GetName ¶
func (c ClusterManager) GetName() string
type ClustersManager ¶
type ClustersManager struct {
// contains filtered or unexported fields
}
func (*ClustersManager) AddClient ¶
func (m *ClustersManager) AddClient(dbCluster manager.ICluster) error
func (*ClustersManager) RemoveClient ¶
func (m *ClustersManager) RemoveClient(clusterId string) error
func (*ClustersManager) UpdateClient ¶
func (m *ClustersManager) UpdateClient(dbCluster manager.ICluster, ignoreStatus bool) error
type IClustersManager ¶
type IClustersManager interface { AddClient(dbCluster manager.ICluster) error UpdateClient(dbCluster manager.ICluster, ignoreStatus bool) error RemoveClient(clusterId string) error }
func GetClustersManager ¶
func GetClustersManager() IClustersManager
type ResourceHandler ¶
type ResourceHandler interface { Create(kind string, namespace string, object *runtime.Unknown) (*runtime.Unknown, error) CreateV2(kind string, namespace string, object runtime.Object) (runtime.Object, error) Update(kind string, namespace string, name string, object *runtime.Unknown) (*runtime.Unknown, error) UpdateV2(kind string, object runtime.Object) (runtime.Object, error) Get(kind string, namespace string, name string) (runtime.Object, error) List(kind string, namespace string, labelSelector string) ([]runtime.Object, error) Delete(kind string, namespace string, name string, options *metav1.DeleteOptions) error GetIndexer() *CacheFactory GetClientset() *kubernetes.Clientset Close() Dynamic(groupKind schema.GroupKind, versions ...string) (dynamic.NamespaceableResourceInterface, error) DynamicGet(gvr schema.GroupVersionKind, namespace string, name string) (runtime.Object, error) EnableBidirectionalSync() DisableBidirectionalSync() }
func NewResourceHandler ¶
func NewResourceHandler( kubeClient *kubernetes.Clientset, dynamicClient dynamic.Interface, restMapper meta.RESTMapper, cacheFactory *CacheFactory) (ResourceHandler, error)
Click to show internal directories.
Click to hide internal directories.