Documentation ¶
Index ¶
- type Callbacks
- type Cluster
- func (kc *Cluster) ActualNamespace(namespace string) string
- func (kc *Cluster) AddLocalOnlyIntercept(c context.Context, spec *manager.InterceptSpec) (*rpc.InterceptResult, error)
- func (kc *Cluster) Client() *kates.Client
- func (kc *Cluster) Deployments(c context.Context, namespace string) ([]kates.Object, error)
- func (kc *Cluster) DetectIngressBehavior(c context.Context) ([]*manager.IngressInfo, error)
- func (kc *Cluster) FindAgain(c context.Context, obj kates.Object) (kates.Object, error)
- func (kc *Cluster) FindDeployment(c context.Context, namespace, name string) (*kates.Deployment, error)
- func (kc *Cluster) FindPod(c context.Context, namespace, name string) (*kates.Pod, error)
- func (kc *Cluster) FindPodFromSelector(c context.Context, namespace string, selector map[string]string) (*kates.Pod, error)
- func (kc *Cluster) FindSvc(c context.Context, namespace, name string) (*kates.Service, error)
- func (kc *Cluster) FindWorkload(c context.Context, namespace, name string) (kates.Object, error)
- func (kc *Cluster) GetClusterId(ctx context.Context) string
- func (kc *Cluster) Pods(c context.Context, namespace string) ([]*kates.Pod, error)
- func (kc *Cluster) RemoveLocalOnlyIntercept(c context.Context, name, namespace string) error
- func (kc *Cluster) ReplicaSets(c context.Context, namespace string) ([]kates.Object, error)
- func (kc *Cluster) RunWatchers(c context.Context) (err error)
- func (kc *Cluster) SetInterceptedNamespaces(c context.Context, interceptedNamespaces map[string]struct{})
- func (kc *Cluster) SetMappedNamespaces(c context.Context, namespaces []string)
- func (kc *Cluster) StatefulSets(c context.Context, namespace string) ([]kates.Object, error)
- func (kc *Cluster) WaitUntilReady(ctx context.Context) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { *Config LocalIntercepts map[string]string // contains filtered or unexported fields }
k8sCluster is a Kubernetes cluster reference
func NewCluster ¶
func (*Cluster) ActualNamespace ¶
func (*Cluster) AddLocalOnlyIntercept ¶
func (kc *Cluster) AddLocalOnlyIntercept(c context.Context, spec *manager.InterceptSpec) (*rpc.InterceptResult, error)
AddLocalOnlyIntercept adds a local-only intercept
func (*Cluster) Deployments ¶ added in v2.3.7
Deployments returns all deployments found in the given Namespace
func (*Cluster) DetectIngressBehavior ¶
TOOO: Move this to traffic-manager
func (*Cluster) FindDeployment ¶
func (kc *Cluster) FindDeployment(c context.Context, namespace, name string) (*kates.Deployment, error)
FindDeployment returns a deployment with the given name in the given namespace or nil if no such deployment could be found.
func (*Cluster) FindPod ¶
FindPod returns a pod with the given name in the given namespace or nil if no such replica set could be found.
func (*Cluster) FindPodFromSelector ¶ added in v2.4.4
func (kc *Cluster) FindPodFromSelector(c context.Context, namespace string, selector map[string]string) (*kates.Pod, error)
FindPodFromSelector returns a pod with the given name-hex-hex
func (*Cluster) FindSvc ¶
FindSvc finds a service with the given name in the given Namespace and returns either a copy of that service or nil if no such service could be found.
func (*Cluster) FindWorkload ¶ added in v2.3.7
FindWorkload returns a workload for the given name and namespace. We search in a specific order based on how we prefer workload objects: 1. Deployments 2. ReplicaSets 3. StatefulSets And return the kind as soon as we find one that matches
func (*Cluster) RemoveLocalOnlyIntercept ¶
func (*Cluster) ReplicaSets ¶ added in v2.3.7
ReplicaSets returns all replica sets found in the given Namespace
func (*Cluster) RunWatchers ¶
RunWatchers runs a set of Kubernetes watchers that provide information from the cluster which is then used for controlling the outbound connectivity of the cluster.
Initially, a watcher that watches the namespaces is created. Once it produces its first snapshot, some filtering is done on the list in that snapshot and then one watcher for each resulting namespace is created that watches pods and services. When their snapshot arrives, these pods and services are used when creating IP-tables that are sent to the NAT-logic in the daemon.
The filtered list of namespaces is also used for creating a DNS search path which is propagated to the DNS-resolver in the daemon.
When an update arrives in the namespace watcher, it will refresh the DNS-search path and the current set of watchers so that new watchers are added for added namespaces and watchers for namespaces that have been will be cancelled.
If a pods and services watcher receives an update, it will send an updated IP-table to the daemon.
func (*Cluster) SetInterceptedNamespaces ¶
func (*Cluster) SetMappedNamespaces ¶
func (*Cluster) StatefulSets ¶ added in v2.3.7
StatefulSets returns all stateful sets found in the given Namespace
type Config ¶
type Config struct { Namespace string // default cluster namespace. Context string Server string ConfigFlags *kates.ConfigFlags // contains filtered or unexported fields }
func (*Config) ContextServiceAndFlagsEqual ¶ added in v2.4.1
ContextServiceAndFlagsEqual determines if this instance is equal to the given instance with respect to context, server, and flag arguments.