admiral

package
v0.0.0-...-f496b69 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdmiralCrdClientFromConfig

func AdmiralCrdClientFromConfig(config *rest.Config) (clientset.Interface, error)

func AdmiralCrdClientFromPath

func AdmiralCrdClientFromPath(kubeConfigPath string) (clientset.Interface, error)

retrieve the Kubernetes cluster client from outside of the cluster

func HandleAddUpdateDeployment

func HandleAddUpdateDeployment(ctx context.Context, ojb interface{}, d *DeploymentController)

func HandleAddUpdateRollout

func HandleAddUpdateRollout(ctx context.Context, ojb interface{}, roc *RolloutController)

func K8sClientFromConfig

func K8sClientFromConfig(config *rest.Config) (kubernetes.Interface, error)

func K8sClientFromPath

func K8sClientFromPath(kubeConfigPath string) (kubernetes.Interface, error)

Types

type ConfigMapController

type ConfigMapController struct {
	K8sClient            kubernetes.Interface
	ConfigmapNamespace   string
	ServiceEntryIPPrefix string
}

func NewConfigMapController

func NewConfigMapController(seIPPrefix string) (*ConfigMapController, error)

func (*ConfigMapController) GetConfigMap

func (c *ConfigMapController) GetConfigMap(ctx context.Context) (*v1.ConfigMap, error)

func (*ConfigMapController) GetIPPrefixForServiceEntries

func (c *ConfigMapController) GetIPPrefixForServiceEntries() string

func (*ConfigMapController) PutConfigMap

func (c *ConfigMapController) PutConfigMap(ctx context.Context, newMap *v1.ConfigMap) error

type ConfigMapControllerInterface

type ConfigMapControllerInterface interface {
	GetConfigMap(ctx context.Context) (*v1.ConfigMap, error)
	PutConfigMap(ctx context.Context, newMap *v1.ConfigMap) error
	GetIPPrefixForServiceEntries() (seIPPrefix string)
}

type Controller

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

func NewController

func NewController(name string, stopCh <-chan struct{}, delegator Delegator, informer cache.SharedIndexInformer) Controller

func (*Controller) Run

func (c *Controller) Run(stopCh <-chan struct{})

Run starts the controller until it receives a message over stopCh

type Delegator

type Delegator interface {
	Added(context.Context, interface{})
	Updated(context.Context, interface{}, interface{})
	Deleted(context.Context, interface{})
}

Delegator interface contains the methods that are required

type DepHandler

type DepHandler interface {
	Added(ctx context.Context, obj *v1.Dependency)
	Updated(ctx context.Context, obj *v1.Dependency)
	Deleted(ctx context.Context, obj *v1.Dependency)
}

DepHandler interface contains the methods that are required

type DependencyController

type DependencyController struct {
	K8sClient    kubernetes.Interface
	DepCrdClient clientset.Interface
	DepHandler   DepHandler
	Cache        *depCache
	// contains filtered or unexported fields
}

func NewDependencyController

func NewDependencyController(stopCh <-chan struct{}, handler DepHandler, configPath string, namespace string, resyncPeriod time.Duration) (*DependencyController, error)

func (*DependencyController) Added

func (d *DependencyController) Added(ctx context.Context, ojb interface{})

func (*DependencyController) Deleted

func (d *DependencyController) Deleted(ctx context.Context, ojb interface{})

func (*DependencyController) Updated

func (d *DependencyController) Updated(ctx context.Context, obj interface{}, oldObj interface{})

type DependencyProxyController

type DependencyProxyController struct {
	K8sClient kubernetes.Interface

	DependencyProxyHandler DependencyProxyHandler
	Cache                  *dependencyProxyCache
	// contains filtered or unexported fields
}

func NewDependencyProxyController

func NewDependencyProxyController(stopCh <-chan struct{}, handler DependencyProxyHandler, configPath string, namespace string, resyncPeriod time.Duration) (*DependencyProxyController, error)

func (*DependencyProxyController) Added

func (d *DependencyProxyController) Added(ctx context.Context, ojb interface{})

func (*DependencyProxyController) Deleted

func (d *DependencyProxyController) Deleted(ctx context.Context, ojb interface{})

func (*DependencyProxyController) Updated

func (d *DependencyProxyController) Updated(ctx context.Context, obj interface{}, oldObj interface{})

type DependencyProxyHandler

type DependencyProxyHandler interface {
	Added(ctx context.Context, obj *v1.DependencyProxy)
	Updated(ctx context.Context, obj *v1.DependencyProxy)
	Deleted(ctx context.Context, obj *v1.DependencyProxy)
}

DependencyProxyHandler interface contains the methods that are required

type DeploymentClusterEntry

type DeploymentClusterEntry struct {
	Identity    string
	Deployments map[string]*k8sAppsV1.Deployment
}

type DeploymentController

type DeploymentController struct {
	K8sClient         kubernetes.Interface
	DeploymentHandler DeploymentHandler
	Cache             *deploymentCache
	// contains filtered or unexported fields
}

func NewDeploymentController

func NewDeploymentController(clusterID string, stopCh <-chan struct{}, handler DeploymentHandler, config *rest.Config, resyncPeriod time.Duration) (*DeploymentController, error)

func (*DeploymentController) Added

func (d *DeploymentController) Added(ctx context.Context, obj interface{})

func (*DeploymentController) Deleted

func (d *DeploymentController) Deleted(ctx context.Context, ojb interface{})

func (*DeploymentController) GetDeploymentBySelectorInNamespace

func (d *DeploymentController) GetDeploymentBySelectorInNamespace(ctx context.Context, serviceSelector map[string]string, namespace string) []k8sAppsV1.Deployment

func (*DeploymentController) Updated

func (d *DeploymentController) Updated(ctx context.Context, obj interface{}, oldObj interface{})

type DeploymentHandler

type DeploymentHandler interface {
	Added(ctx context.Context, obj *k8sAppsV1.Deployment)
	Deleted(ctx context.Context, obj *k8sAppsV1.Deployment)
}

DeploymentHandler interface contains the methods that are required

type EventType

type EventType string
const (
	Add    EventType = "Add"
	Update EventType = "Update"
	Delete EventType = "Delete"
)

type GlobalTrafficController

type GlobalTrafficController struct {
	CrdClient            clientset.Interface
	GlobalTrafficHandler GlobalTrafficHandler
	Cache                *gtpCache
	// contains filtered or unexported fields
}

func NewGlobalTrafficController

func NewGlobalTrafficController(clusterID string, stopCh <-chan struct{}, handler GlobalTrafficHandler, configPath *rest.Config, resyncPeriod time.Duration) (*GlobalTrafficController, error)

func (*GlobalTrafficController) Added

func (d *GlobalTrafficController) Added(ctx context.Context, ojb interface{})

func (*GlobalTrafficController) Deleted

func (d *GlobalTrafficController) Deleted(ctx context.Context, ojb interface{})

func (*GlobalTrafficController) Updated

func (d *GlobalTrafficController) Updated(ctx context.Context, ojb interface{}, oldObj interface{})

type GlobalTrafficHandler

type GlobalTrafficHandler interface {
	Added(ctx context.Context, obj *v1.GlobalTrafficPolicy)
	Updated(ctx context.Context, obj *v1.GlobalTrafficPolicy)
	Deleted(ctx context.Context, obj *v1.GlobalTrafficPolicy)
}

GlobalTrafficHandler interface contains the methods that are required

type InformerCacheObj

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

type Locality

type Locality struct {
	Region string
}

type MonitoredDelegator

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

func NewMonitoredDelegator

func NewMonitoredDelegator(d Delegator, clusterID string, objectType string) *MonitoredDelegator

func (*MonitoredDelegator) Added

func (s *MonitoredDelegator) Added(ctx context.Context, obj interface{})

func (*MonitoredDelegator) Deleted

func (s *MonitoredDelegator) Deleted(ctx context.Context, obj interface{})

func (*MonitoredDelegator) Updated

func (s *MonitoredDelegator) Updated(ctx context.Context, obj interface{}, oldObj interface{})

type NodeController

type NodeController struct {
	K8sClient   kubernetes.Interface
	NodeHandler NodeHandler
	Locality    *Locality
	// contains filtered or unexported fields
}

func NewNodeController

func NewNodeController(clusterID string, stopCh <-chan struct{}, handler NodeHandler, config *rest.Config) (*NodeController, error)

func (*NodeController) Added

func (p *NodeController) Added(ctx context.Context, obj interface{})

func (*NodeController) Deleted

func (p *NodeController) Deleted(ctx context.Context, obj interface{})

func (*NodeController) Updated

func (p *NodeController) Updated(ctx context.Context, obj interface{}, oldObj interface{})

type NodeHandler

type NodeHandler interface {
}

NodeHandler interface contains the methods that are required

type RolloutClusterEntry

type RolloutClusterEntry struct {
	Identity string
	Rollouts map[string]*argo.Rollout
}

type RolloutController

type RolloutController struct {
	K8sClient      kubernetes.Interface
	RolloutClient  argoprojv1alpha1.ArgoprojV1alpha1Interface
	RolloutHandler RolloutHandler

	Cache *rolloutCache
	// contains filtered or unexported fields
}

func NewRolloutsController

func NewRolloutsController(clusterID string, stopCh <-chan struct{}, handler RolloutHandler, config *rest.Config, resyncPeriod time.Duration) (*RolloutController, error)

func (*RolloutController) Added

func (roc *RolloutController) Added(ctx context.Context, ojb interface{})

func (*RolloutController) Deleted

func (roc *RolloutController) Deleted(ctx context.Context, ojb interface{})

func (*RolloutController) GetRolloutBySelectorInNamespace

func (d *RolloutController) GetRolloutBySelectorInNamespace(ctx context.Context, serviceSelector map[string]string, namespace string) []argo.Rollout

func (*RolloutController) Updated

func (roc *RolloutController) Updated(ctx context.Context, ojb interface{}, oldObj interface{})

type RolloutHandler

type RolloutHandler interface {
	Added(ctx context.Context, obj *argo.Rollout)
	Updated(ctx context.Context, obj *argo.Rollout)
	Deleted(ctx context.Context, obj *argo.Rollout)
}

Handler interface contains the methods that are required

type RolloutsEntry

type RolloutsEntry struct {
	Identity string
	Rollout  *argo.Rollout
}

type RoutingPolicyClusterEntry

type RoutingPolicyClusterEntry struct {
	Identity        string
	RoutingPolicies map[string]*v1.RoutingPolicy
}

type RoutingPolicyController

type RoutingPolicyController struct {
	K8sClient            kubernetes.Interface
	CrdClient            clientset.Interface
	IstioClient          versioned.Interface
	RoutingPolicyHandler RoutingPolicyHandler
	// contains filtered or unexported fields
}

func NewRoutingPoliciesController

func NewRoutingPoliciesController(stopCh <-chan struct{}, handler RoutingPolicyHandler, configPath *rest.Config, resyncPeriod time.Duration) (*RoutingPolicyController, error)

func (*RoutingPolicyController) Added

func (r *RoutingPolicyController) Added(ctx context.Context, obj interface{})

func (*RoutingPolicyController) Deleted

func (r *RoutingPolicyController) Deleted(ctx context.Context, obj interface{})

func (*RoutingPolicyController) Updated

func (r *RoutingPolicyController) Updated(ctx context.Context, obj interface{}, oldObj interface{})

type RoutingPolicyEntry

type RoutingPolicyEntry struct {
	Identity      string
	RoutingPolicy *v1.RoutingPolicy
}

type RoutingPolicyHandler

type RoutingPolicyHandler interface {
	Added(ctx context.Context, obj *v1.RoutingPolicy)
	Updated(ctx context.Context, obj *v1.RoutingPolicy)
	Deleted(ctx context.Context, obj *v1.RoutingPolicy)
}

RoutingPolicyHandler interface contains the methods that are required

type ServiceClusterEntry

type ServiceClusterEntry struct {
	Identity string
	Service  map[string]map[string]*k8sV1.Service //maps namespace to a map of service name:service object
}

type ServiceController

type ServiceController struct {
	K8sClient      kubernetes.Interface
	ServiceHandler ServiceHandler
	Cache          *serviceCache
	// contains filtered or unexported fields
}

func NewServiceController

func NewServiceController(clusterID string, stopCh <-chan struct{}, handler ServiceHandler, config *rest.Config, resyncPeriod time.Duration) (*ServiceController, error)

func (*ServiceController) Added

func (s *ServiceController) Added(ctx context.Context, obj interface{})

func (*ServiceController) Deleted

func (s *ServiceController) Deleted(ctx context.Context, obj interface{})

func (*ServiceController) Updated

func (s *ServiceController) Updated(ctx context.Context, obj interface{}, oldObj interface{})

type ServiceHandler

type ServiceHandler interface {
	Added(ctx context.Context, obj *k8sV1.Service)
	Updated(ctx context.Context, obj *k8sV1.Service)
	Deleted(ctx context.Context, obj *k8sV1.Service)
}

ServiceHandler interface contains the methods that are required

Jump to

Keyboard shortcuts

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