store

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MasterNodeAnnotationKey = "node-role.kubernetes.io/master"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Informer

func (*Informer) Run

func (i *Informer) Run(stopCh chan struct{})

Run initiates the synchronization of the informers against the API server.

type IngressLister

type IngressLister struct {
	cache.Store
}

IngressLister makes a Store that lists Ingress.

func (IngressLister) ByKey

func (l IngressLister) ByKey(key string) (*networkv1.Ingress, error)

ByKey returns the Ingress matching key in the local Ingress Store.

func (IngressLister) ListIngress

func (l IngressLister) ListIngress() []*networkv1.Ingress

ListIngress returns a list of ingresses.

type Lister

type Lister struct {
	Ingress IngressLister
	Service ServiceLister
	Secret  SecretLister
	Node    NodeLister
}

type NodeLister

type NodeLister struct {
	cache.Store
}

SecretLister makes a Store that lists Secrets.

func (*NodeLister) NodesIpList

func (l *NodeLister) NodesIpList() []string

NodesIpList returns nodes ips

type NotExistsError

type NotExistsError string

NotExistsError is returned when an object does not exist in a local store.

func (NotExistsError) Error

func (e NotExistsError) Error() string

Error implements the error interface.

type SecretLister

type SecretLister struct {
	cache.Store
}

SecretLister makes a Store that lists Secrets.

func (*SecretLister) ByKey

func (l *SecretLister) ByKey(key string) (*corev1.Secret, error)

ByKey returns the Secret matching key in the local Secret Store.

type ServiceInfo

type ServiceInfo struct {
	Hosts       []string
	NodeIps     []string
	NodePort    int
	Annotations map[string]string
}

ServiceInfo represents helper struct for ingress service

type ServiceLister

type ServiceLister struct {
	cache.Store
}

ServiceLister makes a Store that lists Services.

func (*ServiceLister) ByKey

func (l *ServiceLister) ByKey(key string) (*corev1.Service, error)

ByKey returns the Service matching key in the local Service Store.

type Store

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

Store represents cache store, implements Storer

func New

func New(
	namespace string,
	resyncPeriod time.Duration,
	client *kubernetes.Clientset,
	ingressClass string,
	recorder record.EventRecorder,
	queue workqueue.RateLimitingInterface,
) *Store

New creates a new store. Add informers and it handlers.

func (*Store) GetIngress

func (s *Store) GetIngress(key string) (*networkv1.Ingress, error)

GetIngress returns the Ingress matching key.

func (*Store) GetIngressServiceInfo

func (s *Store) GetIngressServiceInfo(ingress *networkv1.Ingress) (map[string]ServiceInfo, error)

GetSecret returns the Secret matching key.

func (*Store) GetNodesIpList

func (s *Store) GetNodesIpList() []string

GetNodesIpList returns nodes ips

func (*Store) GetSecret

func (s *Store) GetSecret(key string) (*corev1.Secret, error)

GetSecret returns the Secret matching key.

func (*Store) GetService

func (s *Store) GetService(key string) (*corev1.Service, error)

GetService returns the Service matching key.

func (*Store) ListIngress

func (s *Store) ListIngress() []*networkv1.Ingress

ListIngress returns a list of ingresses.

func (*Store) Run

func (s *Store) Run(stopCh chan struct{})

Run initiates the synchronization of the informers

type Storer

type Storer interface {
	Run(chan struct{})
	GetSecret(key string) (*corev1.Secret, error)
	GetIngress(key string) (*networkv1.Ingress, error)
	ListIngress() []*networkv1.Ingress
	GetService(key string) (*corev1.Service, error)
	GetNodesIpList() []string
	GetIngressServiceInfo(ingress *networkv1.Ingress) (map[string]ServiceInfo, error)
}

Storer is the interface that wraps the required methods to gather information about ingresses, services, secrets and ingress annotations.

Jump to

Keyboard shortcuts

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