k8sclient

package
v1.247349.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Get func() *K8sClient

Functions

This section is empty.

Types

type EpClient

type EpClient interface {
	PodKeyToServiceNames() map[string][]string
	ServiceToPodNum() map[Service]int

	Init()
	Shutdown()
}

type JobClient

type JobClient interface {
	JobToCronJob() map[string]string

	Init()
	Shutdown()
}

type K8sClient

type K8sClient struct {
	sync.Mutex

	ClientSet *kubernetes.Clientset

	Ep   EpClient
	Pod  PodClient
	Node NodeClient

	Job        JobClient
	ReplicaSet ReplicaSetClient
	// contains filtered or unexported fields
}

type NodeClient

type NodeClient interface {
	ClusterFailedNodeCount() int
	ClusterNodeCount() int

	Init()
	Shutdown()
}

type ObjStore

type ObjStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewObjStore

func NewObjStore(transformFunc func(interface{}) (interface{}, error)) *ObjStore

func (*ObjStore) Add

func (s *ObjStore) Add(obj interface{}) error

func (*ObjStore) Delete

func (s *ObjStore) Delete(obj interface{}) error

Delete deletes an existing entry in the ObjStore.

func (*ObjStore) Get

func (s *ObjStore) Get(obj interface{}) (item interface{}, exists bool, err error)

Get implements the Get method of the store interface.

func (*ObjStore) GetByKey

func (s *ObjStore) GetByKey(key string) (item interface{}, exists bool, err error)

GetByKey implements the GetByKey method of the store interface.

func (*ObjStore) List

func (s *ObjStore) List() []interface{}

List implements the List method of the store interface.

func (*ObjStore) ListKeys

func (s *ObjStore) ListKeys() []string

ListKeys implements the ListKeys method of the store interface.

func (*ObjStore) Refreshed

func (s *ObjStore) Refreshed() bool

Track whether the underlying data store is refreshed or not. Calling this func itself will reset the state to false.

func (*ObjStore) Replace

func (s *ObjStore) Replace(list []interface{}, _ string) error

Replace will delete the contents of the store, using instead the given list.

func (*ObjStore) Resync

func (s *ObjStore) Resync() error

Resync implements the Resync method of the store interface.

func (*ObjStore) Update

func (s *ObjStore) Update(obj interface{}) error

Update updates the existing entry in the ObjStore.

type PodClient

type PodClient interface {
	NamespaceToRunningPodNum() map[string]int

	Init()
	Shutdown()
}

type ReplicaSetClient

type ReplicaSetClient interface {
	ReplicaSetToDeployment() map[string]string

	Init()
	Shutdown()
}

type Service

type Service struct {
	ServiceName string
	Namespace   string
}

func NewService

func NewService(name, namespace string) Service

Jump to

Keyboard shortcuts

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