Documentation ¶
Index ¶
- Constants
- func GetSubprobesMap(manager string) map[string]Subprobe
- func InitLinkers(linkerHandlers []LinkHandler, g *graph.Graph) (linkers []probe.Handler)
- func InitSubprobes(enabled []string, subprobeHandlers map[string]SubprobeHandler, ...)
- func ListSubprobes(manager string, types ...string) (handlers []graph.ListenerHandler)
- func MatchNamespace(obj1, obj2 metav1.Object) bool
- func MetadataField(field string) string
- func MetadataFields(fields ...string) []string
- func NewABLinker(g *graph.Graph, aManager, aType, bManager, bType string, areLinked AreLinked, ...) probe.Handler
- func NewConfig(kubeconfigPath string) (*rest.Config, *clientcmd.ClientConfig, error)
- func NewEdgeMetadata(manager, name string) graph.Metadata
- func NewMetadata(manager, ty string, kubeMeta graph.Metadata, extra interface{}, name string) graph.Metadata
- func NewMetadataFields(o metav1.Object) graph.Metadata
- func PutSubprobe(manager, name string, subprobe Subprobe)
- func SetState(m *graph.Metadata, isUp bool)
- type ABLinker
- type AreLinked
- type GetMetadata
- type K8sProbe
- type KubeCache
- type LinkHandler
- type Linker
- type PolicyPoint
- type PolicyTarget
- type PolicyType
- type Probe
- type ResourceCache
- type ResourceHandler
- type Subprobe
- type SubprobeHandler
Constants ¶
const ( // Manager is the manager value for Kubernetes Manager = "k8s" // KubeKey is the metadata area for k8s specific fields KubeKey = "K8s" // ExtraKey is the metadata area for k8s extra fields ExtraKey = "K8s.Extra" ClusterNameField = "ClusterName" )
const Cluster = "cluster"
Variables ¶
This section is empty.
Functions ¶
func GetSubprobesMap ¶ added in v0.22.0
GetSubprobesMap returns a map of all the subprobes that belong to manager probe
func InitLinkers ¶ added in v0.22.0
func InitLinkers(linkerHandlers []LinkHandler, g *graph.Graph) (linkers []probe.Handler)
InitLinkers initializes the listed linkers
func InitSubprobes ¶ added in v0.21.0
func InitSubprobes(enabled []string, subprobeHandlers map[string]SubprobeHandler, client interface{}, g *graph.Graph, manager, clusterName string)
InitSubprobes initializes only the subprobes which are enabled
func ListSubprobes ¶ added in v0.22.0
func ListSubprobes(manager string, types ...string) (handlers []graph.ListenerHandler)
ListSubprobes returns the list of Subprobe as ListernerHandler
func MatchNamespace ¶ added in v0.22.0
MatchNamespace true if namespaces are identical
func MetadataField ¶ added in v0.21.0
MetadataField is generates full path of a k8s specific field
func MetadataFields ¶ added in v0.21.0
MetadataFields generates full path of a list of k8s specific fields
func NewABLinker ¶ added in v0.22.0
func NewABLinker(g *graph.Graph, aManager, aType, bManager, bType string, areLinked AreLinked, getMetadata ...GetMetadata) probe.Handler
NewABLinker create and initialize an ABLinker based linker
func NewEdgeMetadata ¶ added in v0.22.0
NewEdgeMetadata creates a new edge metadata
func NewMetadata ¶ added in v0.21.0
func NewMetadata(manager, ty string, kubeMeta graph.Metadata, extra interface{}, name string) graph.Metadata
NewMetadata creates a k8s node base metadata struct
func NewMetadataFields ¶ added in v0.21.0
NewMetadataFields creates internal k8s node metadata struct
func PutSubprobe ¶ added in v0.22.0
PutSubprobe puts a new subprobe in the subprobes map
Types ¶
type ABLinker ¶ added in v0.22.0
type ABLinker struct {
// contains filtered or unexported fields
}
ABLinker basis for a simple A to B linker
func (*ABLinker) GetABLinks ¶ added in v0.22.0
GetABLinks implementing graph.Linker
type AreLinked ¶ added in v0.22.0
type AreLinked func(a, b interface{}) bool
AreLinked return true if (a, b) should be linked
type GetMetadata ¶ added in v0.22.0
GetMetadata returns the metadata of the edge
type K8sProbe ¶ added in v0.27.0
type K8sProbe struct { *Probe // contains filtered or unexported fields }
K8sProbe defines the k8s probe
func NewK8sProbe ¶ added in v0.20.0
NewK8sProbe returns a new Kubernetes probe
type KubeCache ¶ added in v0.21.0
type KubeCache struct {
// contains filtered or unexported fields
}
KubeCache describes a generic cache for Kubernetes resources.
func NewKubeCache ¶ added in v0.21.0
NewKubeCache returns a new cache using the associed Kubernetes client.
func RegisterKubeCache ¶ added in v0.21.0
func RegisterKubeCache(restClient rest.Interface, objType runtime.Object, resources string, handler k8sHandler) *KubeCache
RegisterKubeCache registers resource handler to kubernetes events.
func (*KubeCache) GetByNode ¶ added in v0.22.0
GetByNode returns graph node according to name and namespace
func (*KubeCache) List ¶ added in v0.22.0
func (c *KubeCache) List() []interface{}
List returns a list of resources
type LinkHandler ¶ added in v0.22.0
LinkHandler creates a linker
type Linker ¶ added in v0.22.0
type Linker struct {
*graph.ResourceLinker
}
Linker defines a k8s linker
type PolicyPoint ¶ added in v0.19.1
type PolicyPoint string
PolicyPoint defines whether a policy applies to a of pods or if it restricts access from a set of pods
const ( PolicyPointBegin PolicyPoint = "begin" PolicyPointEnd PolicyPoint = "end" )
PolicyPoint values
func (PolicyPoint) String ¶ added in v0.19.1
func (val PolicyPoint) String() string
String returns the string representation of a PolicyPoint
type PolicyTarget ¶ added in v0.19.0
type PolicyTarget string
PolicyTarget defines whether traffic is allowed or denied
const ( PolicyTargetDeny PolicyTarget = "deny" PolicyTargetAllow PolicyTarget = "allow" )
Policy targets
func (PolicyTarget) String ¶ added in v0.19.0
func (val PolicyTarget) String() string
String returns the string representation of a policy target
type PolicyType ¶ added in v0.19.0
type PolicyType string
PolicyType defines the policy type (ingress or egress)
const ( PolicyTypeIngress PolicyType = "ingress" PolicyTypeEgress PolicyType = "egress" )
Policy types
func (PolicyType) String ¶ added in v0.19.0
func (val PolicyType) String() string
String returns the string representation of a policy type
type Probe ¶
type Probe struct {
// contains filtered or unexported fields
}
Probe for tracking k8s events
func NewProbe ¶
func NewProbe(g *graph.Graph, manager string, subprobes map[string]Subprobe, linkers []probe.Handler, verifiers []probe.Handler) *Probe
NewProbe creates the probe for tracking k8s events
func (*Probe) AppendClusterLinkers ¶ added in v0.21.0
AppendClusterLinkers appends newly created cluster linker per type
func (*Probe) AppendNamespaceLinkers ¶ added in v0.21.0
AppendNamespaceLinkers appends newly created namespace linker per type
type ResourceCache ¶ added in v0.20.0
type ResourceCache struct { *graph.EventHandler *KubeCache // 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
type ResourceHandler ¶ added in v0.20.0
type ResourceHandler interface { Map(obj interface{}) (graph.Identifier, graph.Metadata) Dump(obj interface{}) string }
ResourceHandler is used to map Kubernetes resources to objets in the graph
type Subprobe ¶ added in v0.20.0
type Subprobe interface { Start() error Stop() graph.ListenerHandler }
Subprobe describes a probe for a specific Kubernetes resource It must implement the ListenerHandler interface so that you listen for creation/update/removal of a resource
func GetSubprobe ¶ added in v0.22.0
GetSubprobe returns a specific subprobe
type SubprobeHandler ¶ added in v0.21.0
SubprobeHandler the signature of ctor of a subprobe
Source Files ¶
- cache.go
- cluster.go
- configmap.go
- container.go
- cronjob.go
- daemonset.go
- deployment.go
- endpoints.go
- graph.go
- ingress.go
- job.go
- k8s.go
- linker.go
- namespace.go
- networkpolicy.go
- node.go
- persistentvolume.go
- persistentvolumeclaim.go
- pod.go
- probe.go
- replicaset.go
- replicationcontroller.go
- secret.go
- service.go
- statefulset.go
- storageclass.go