k8s

package
v0.0.2-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClusterSet

func NewClusterSet()

func NewCoreV1Store

func NewCoreV1Store(clusterSet IClusterSet)

Types

type ClientSets

type ClientSets struct {
	K8sClient      kubernetes.Interface
	MetricsClient  versioned.Interface
	InformerClient informer.Storer
}

func NewClientSets

func NewClientSets(ctx context.Context, kubeConfigPath string, stop chan struct{}) (*ClientSets, error)

type ClusterSet

type ClusterSet struct {
	// contains filtered or unexported fields
}

func (*ClusterSet) Add

func (c *ClusterSet) Add(clusterName string, clientSets *ClientSets)

func (*ClusterSet) Delete

func (c *ClusterSet) Delete(clusterName string)

func (*ClusterSet) Get

func (c *ClusterSet) Get(clusterName string) *ClientSets

func (*ClusterSet) List

func (c *ClusterSet) List() map[string]*ClientSets

func (*ClusterSet) Update

func (c *ClusterSet) Update(clusterName string, clientSets *ClientSets)

type IClusterSet

type IClusterSet interface {
	Add(clusterName string, clientSets *ClientSets)
	Update(clusterName string, clientSets *ClientSets)
	Delete(clusterName string)
	Get(clusterName string) *ClientSets
	List() map[string]*ClientSets
}

func GetClusterSets

func GetClusterSets() IClusterSet

type ICoreV1Store

type ICoreV1Store interface {
	IPod
	IDeployment
	IService
	IStatefulSet
	IJob
	IEvent
	INode
	INamespace
}

func GetClient

func GetClient() ICoreV1Store

type IDeployment

type IDeployment interface {
	Deployments(clusterName string) IDeploymentAction
}

type IDeploymentAction

type IDeploymentAction interface {
	Create(ctx context.Context, deployment *v1.Deployment, options meta.CreateOptions) error
	Update(ctx context.Context, deployment *v1.Deployment, options meta.UpdateOptions) error
	Delete(ctx context.Context, options meta.DeleteOptions) error
	List(ctx context.Context, options meta.ListOptions) ([]*v1.Deployment, error)
	Get(ctx context.Context, options meta.GetOptions) (*v1.Deployment, error)
	Restart(ctx context.Context, options meta.RestartOptions) error
}

type IEvent

type IEvent interface {
	Events(clusterName string) IEventAction
}

type IEventAction

type IEventAction interface {
	List(ctx context.Context, options meta.ListOptions) ([]v1.Event, error)
	Get(ctx context.Context, args apiv1.Event, options meta.GetOptions) ([]v1.Event, error)
}

type IJob

type IJob interface {
	Jobs(clusterName string) IJobAction
}

type IJobAction

type IJobAction interface {
	Create(ctx context.Context, job *batchv1.Job, createOptions meta.CreateOptions) error
	Delete(ctx context.Context, deleteOptions meta.DeleteOptions) error
	Get(ctx context.Context, getOptions meta.GetOptions) (*batchv1.Job, error)
	List(ctx context.Context, listOptions meta.ListOptions) ([]*batchv1.Job, error)
}

type INamespace

type INamespace interface {
	Namespaces(clusterName string) INamespaceAction
}

type INamespaceAction

type INamespaceAction interface {
	List(ctx context.Context) ([]*v1.Namespace, error)
}

type INode

type INode interface {
	Nodes(clusterName string) INodeAction
}

type INodeAction

type INodeAction interface {
	Get(ctx context.Context, getOptions meta.GetOptions) (*v1.Node, error)
	List(ctx context.Context, listOptions meta.ListOptions) ([]*v1.Node, error)
}

type IPod

type IPod interface {
	Pods(clusterName string) IPodAction
}

type IPodAction

type IPodAction interface {
	Get(ctx context.Context, options meta.GetOptions) (*v1.Pod, error)
	List(ctx context.Context, options meta.ListOptions) ([]*v1.Pod, error)
	Top(ctx context.Context, options meta.TopOptions) (*apiv1.TopPod, error)
	Logs(ctx context.Context, w http.ResponseWriter, r *http.Request, options meta.LogOptions) error
	Command(ctx context.Context, w http.ResponseWriter, r *http.Request, options *meta.TerminalOptions, kubeconfigPath string) error
}

type IService

type IService interface {
	Services(clusterName string) IServiceAction
}

type IServiceAction

type IServiceAction interface {
	Create(ctx context.Context, service *v1.Service, options meta.CreateOptions) error
	Update(ctx context.Context, service *v1.Service, options meta.UpdateOptions) error
	Delete(ctx context.Context, options meta.DeleteOptions) error
	Get(ctx context.Context, options meta.GetOptions) (*v1.Service, error)
	List(ctx context.Context, options meta.ListOptions) ([]*v1.Service, error)
}

type IStatefulSet

type IStatefulSet interface {
	StatefulSets(clusterName string) IStatefulSetAction
}

type IStatefulSetAction

type IStatefulSetAction interface {
	Create(ctx context.Context, statefulSet *v1.StatefulSet, options meta.CreateOptions) error
	Update(ctx context.Context, statefulSet *v1.StatefulSet, options meta.UpdateOptions) error
	Delete(ctx context.Context, options meta.DeleteOptions) error
	Get(ctx context.Context, options meta.GetOptions) (*v1.StatefulSet, error)
	List(ctx context.Context, options meta.ListOptions) ([]*v1.StatefulSet, error)
}

Directories

Path Synopsis
api
v1

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL