k8s

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: Apache-2.0 Imports: 24 Imported by: 4

Documentation

Index

Constants

View Source
const ClusterName = "cluster"
View Source
const (
	Manager = "k8s"
)

Variables

This section is empty.

Functions

func NewConfig added in v0.20.0

func NewConfig(kubeConfig string) (*rest.Config, error)

NewConfig returns a new Kubernetes configuration object

Types

type DefaultResourceHandler added in v0.20.0

type DefaultResourceHandler struct {
}

func (*DefaultResourceHandler) IsTopLevel added in v0.20.0

func (h *DefaultResourceHandler) IsTopLevel() bool

type PolicyPoint added in v0.19.1

type PolicyPoint string
const (
	PolicyPointBegin PolicyPoint = "begin"
	PolicyPointEnd   PolicyPoint = "end"
)

func (PolicyPoint) String added in v0.19.1

func (val PolicyPoint) String() string

type PolicyTarget added in v0.19.0

type PolicyTarget string
const (
	PolicyTargetDeny  PolicyTarget = "deny"
	PolicyTargetAllow PolicyTarget = "allow"
)

func (PolicyTarget) String added in v0.19.0

func (val PolicyTarget) String() string

type PolicyType added in v0.19.0

type PolicyType string
const (
	PolicyTypeIngress PolicyType = "ingress"
	PolicyTypeEgress  PolicyType = "egress"
)

func (PolicyType) String added in v0.19.0

func (val PolicyType) String() string

type Probe

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

Probe for tracking k8s events

func NewK8sProbe added in v0.20.0

func NewK8sProbe(g *graph.Graph) (*Probe, error)

NewK8sProbe returns a new Kubernetes probe

func NewProbe

func NewProbe(manager, clusterName string, g *graph.Graph, subprobes map[string]Subprobe, linkers []probe.Probe) (*Probe, error)

NewProbe creates the probe for tracking k8s events

func (*Probe) Start

func (p *Probe) Start()

Start k8s probe

func (*Probe) Stop

func (p *Probe) Stop()

Stop k8s probe

type ResourceCache added in v0.20.0

type ResourceCache struct {
	*graph.GraphEventHandler
	// contains filtered or unexported fields
}

ResourceCache describes a cache for a specific kind of Kubernetes resource. It is in charge of listening to Kubernetes events and creating the according resource in the graph with the informations returned by the associated resource handler

func NewResourceCache added in v0.20.0

func NewResourceCache(restClient rest.Interface, objType runtime.Object, resources string, g *graph.Graph, handler ResourceHandler) *ResourceCache

NewResourceCache returns a new cache using the associed Kubernetes client and with the handler for the resource that this cache manages.

func (*ResourceCache) OnAdd added in v0.20.0

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

OnAdd is called when a new Kubernetes resource has been created

func (*ResourceCache) OnDelete added in v0.20.0

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

OnDelete is called when a Kubernetes resource has been deleted

func (*ResourceCache) OnUpdate added in v0.20.0

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

OnUpdate is called when a Kubernetes resource has been updated

func (*ResourceCache) Start added in v0.20.0

func (c *ResourceCache) Start()

Start begin waiting on Kubernetes events

func (*ResourceCache) Stop added in v0.20.0

func (c *ResourceCache) Stop()

Stop end waiting on Kubernetes events

type ResourceHandler added in v0.20.0

type ResourceHandler interface {
	Map(obj interface{}) (graph.Identifier, graph.Metadata)
	Dump(obj interface{}) string
	IsTopLevel() bool
}

ResourceHandler is used to map Kubernetes resources to objets in the graph

type Subprobe added in v0.20.0

type Subprobe interface {
	probe.Probe
	graph.GraphListenerHandler
}

Jump to

Keyboard shortcuts

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