manager

package
v0.3.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachePod

type CachePod struct {
	metav1.ObjectMeta
	Spec v1.PodSpec
}

CachePod is the struct save pod data for check pod is really changed

type CommonResourceEventHandler

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

CommonResourceEventHandler can be used by configmapManager and podManager

func NewCommonResourceEventHandler

func NewCommonResourceEventHandler(events chan watch.Event) *CommonResourceEventHandler

NewCommonResourceEventHandler create CommonResourceEventHandler used by configmapManager and podManager

func (*CommonResourceEventHandler) OnAdd

func (c *CommonResourceEventHandler) OnAdd(obj interface{})

OnAdd handle Add event

func (*CommonResourceEventHandler) OnDelete

func (c *CommonResourceEventHandler) OnDelete(obj interface{})

OnDelete handle Delete event

func (*CommonResourceEventHandler) OnUpdate

func (c *CommonResourceEventHandler) OnUpdate(oldObj, newObj interface{})

OnUpdate handle Update event

type ConfigMapManager

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

ConfigMapManager manage all events of configmap by SharedInformer

func NewConfigMapManager

func NewConfigMapManager(kubeClient *kubernetes.Clientset, namespace string) (*ConfigMapManager, error)

NewConfigMapManager create ConfigMapManager by kube clientset and namespace

func (*ConfigMapManager) Events

func (cmm *ConfigMapManager) Events() chan watch.Event

Events return the channel save events from watch configmap change

type LocationCache

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

LocationCache cache the map of node, pod, configmap, secret

func (*LocationCache) AddOrUpdatePod

func (lc *LocationCache) AddOrUpdatePod(pod v1.Pod)

AddOrUpdatePod add pod to node, pod to configmap, configmap to pod, pod to secret, secret to pod relation

func (*LocationCache) ConfigMapNodes

func (lc *LocationCache) ConfigMapNodes(namespace, name string) (nodes []string)

ConfigMapNodes return all nodes which deploy pod on with configmap

func (*LocationCache) DeleteConfigMap

func (lc *LocationCache) DeleteConfigMap(namespace, name string)

DeleteConfigMap from cache

func (*LocationCache) DeleteSecret

func (lc *LocationCache) DeleteSecret(namespace, name string)

DeleteSecret from cache

func (*LocationCache) PodConfigMapsAndSecrets

func (lc *LocationCache) PodConfigMapsAndSecrets(pod v1.Pod) (configMaps, secrets []string)

PodConfigMapsAndSecrets return configmaps and secrets used by pod

func (*LocationCache) SecretNodes

func (lc *LocationCache) SecretNodes(namespace, name string) (nodes []string)

SecretNodes return all nodes which deploy pod on with secret

type Manager

type Manager interface {
	Events() chan watch.Event
}

Manager define the interface of a Manager, configmapManager and podManager implement it

type PodManager

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

PodManager is a manager watch pod change event

func NewPodManager

func NewPodManager(kubeClient *kubernetes.Clientset, namespace string) (*PodManager, error)

NewPodManager create PodManager from config

func (*PodManager) Events

func (pm *PodManager) Events() chan watch.Event

Events return a channel, can receive all pod event

type SecretManager

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

SecretManager manage all events of secret by SharedInformer

func NewSecretManager

func NewSecretManager(kubeClient *kubernetes.Clientset, namespace string) (*SecretManager, error)

NewSecretManager create SecretManager by kube clientset and namespace

func (*SecretManager) Events

func (sm *SecretManager) Events() chan watch.Event

Events return the channel save events from watch secret change

Jump to

Keyboard shortcuts

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