v1

package
v0.8.20 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ObserverServiceName is the name of the observer service for the grpc health check
	ObserverServiceName = "hubble.server.Observer"

	// K8sNamespaceTag is the label tag which denotes the namespace.
	K8sNamespaceTag = "k8s:io.kubernetes.pod.namespace"
)

Variables

This section is empty.

Functions

func CompareKafka

func CompareKafka(a, b *pb.Kafka) bool

CompareKafka returns true if both Kafka flows are identical

func FlowProtocol

func FlowProtocol(flow Flow) string

FlowProtocol returns the protocol best describing the flow. If available, this is the L7 protocol name, then the L4 protocol name.

func LooseCompareHTTP

func LooseCompareHTTP(a, b *pb.HTTP) bool

LooseCompareHTTP returns true if both HTTP flows are loosely identical. This means that the following fields must match:

  • Code
  • Method
  • Url
  • Protocol

Types

type Endpoint

type Endpoint struct {
	ContainerIDs []string                 `json:"container-ids"`
	ID           uint64                   `json:"id"`
	Identity     identity.NumericIdentity `json:"identity"`
	IPv4         net.IP                   `json:"ipv4"`
	IPv6         net.IP                   `json:"ipv6"`
	PodName      string                   `json:"pod-name"`
	PodNamespace string                   `json:"pod-namespace"`
	Labels       []string                 `json:"labels"`
}

Endpoint is the representation of an endpoint running in the Cilium agent

func (*Endpoint) DeepCopy

func (e *Endpoint) DeepCopy() *Endpoint

DeepCopy returns a deep copy of this endpoint.

func (*Endpoint) EqualsByID

func (e *Endpoint) EqualsByID(o *Endpoint) bool

EqualsByID compares if the receiver's endpoint has the same ID, PodName and PodNamespace.

func (*Endpoint) GetID

func (e *Endpoint) GetID() uint64

GetID returns the ID of the endpoint.

func (*Endpoint) GetIdentity

func (e *Endpoint) GetIdentity() identity.NumericIdentity

GetIdentity returns the numerical security identity of the endpoint.

func (*Endpoint) GetK8sNamespace

func (e *Endpoint) GetK8sNamespace() string

GetK8sNamespace returns the pod namespace of the endpoint.

func (*Endpoint) GetK8sPodName

func (e *Endpoint) GetK8sPodName() string

GetK8sPodName returns the pod name of the endpoint.

func (*Endpoint) GetLabels

func (e *Endpoint) GetLabels() []string

GetLabels returns the labels of the endpoint.

type EndpointInfo

type EndpointInfo interface {
	GetID() uint64
	GetIdentity() identity.NumericIdentity
	GetK8sPodName() string
	GetK8sNamespace() string
	GetLabels() []string
}

EndpointInfo defines readable fields of a Cilium endpoint.

type Endpoints

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

Endpoints is a slice of endpoints and their cached dns queries protected by a mutex.

func NewEndpoints

func NewEndpoints() *Endpoints

NewEndpoints returns a new *Endpoints.

func (*Endpoints) DeleteEndpoint

func (es *Endpoints) DeleteEndpoint(del *Endpoint)

DeleteEndpoint deletes the given endpoint if present in the endpoints slice.

func (*Endpoints) FindEPs

func (es *Endpoints) FindEPs(epID uint64, namespace string, podName string) []Endpoint

FindEPs returns all the EPs that have the given epID or the given namespace or the given podName (running in the given namespace).

func (*Endpoints) GetEndpoint

func (es *Endpoints) GetEndpoint(ip net.IP) (endpoint *Endpoint, ok bool)

GetEndpoint returns the endpoint that has the given ip.

func (*Endpoints) GetEndpointByContainerID

func (es *Endpoints) GetEndpointByContainerID(id string) (*Endpoint, bool)

GetEndpointByContainerID returns the endpoint that has the given container ID.

func (*Endpoints) GetEndpointByPodName

func (es *Endpoints) GetEndpointByPodName(namespace string, name string) (*Endpoint, bool)

GetEndpointByPodName returns the endpoint with the given pod name.

func (*Endpoints) GetEndpointInfo

func (es *Endpoints) GetEndpointInfo(ip net.IP) (endpoint EndpointInfo, ok bool)

GetEndpointInfo returns the endpoint info that has the given ip.

func (*Endpoints) SyncEndpoints

func (es *Endpoints) SyncEndpoints(newEps []*Endpoint)

SyncEndpoints adds the given list of endpoints to the internal endpoint slice.

func (*Endpoints) UpdateEndpoint

func (es *Endpoints) UpdateEndpoint(updateEp *Endpoint)

UpdateEndpoint updates the given endpoint if already exists in the slice of endpoints. If the endpoint does not exists, it is appended to the slice of endpoints.

type EndpointsHandler

type EndpointsHandler interface {
	SyncEndpoints([]*Endpoint)
	UpdateEndpoint(*Endpoint)
	FindEPs(epID uint64, ns, pod string) []Endpoint
	GetEndpoint(ip net.IP) (endpoint *Endpoint, ok bool)
	DeleteEndpoint(*Endpoint)
	GetEndpointByContainerID(id string) (*Endpoint, bool)
	GetEndpointByPodName(namespace string, name string) (*Endpoint, bool)
}

EndpointsHandler defines an interface for interacting with Cilium endpoints.

type Event

type Event struct {
	// Timestamp when event was observed in Hubble
	Timestamp *types.Timestamp
	// Event contains the actual event
	Event interface{}
}

Event represents a single event observed and stored by Hubble

func (*Event) GetFlow

func (ev *Event) GetFlow() Flow

GetFlow returns the decoded flow, or nil if there is no event

type Flow

type Flow interface {
	proto.Message
	GetTime() *types.Timestamp
	GetVerdict() pb.Verdict
	GetDropReason() uint32
	GetEthernet() *pb.Ethernet
	GetIP() *pb.IP
	GetL4() *pb.Layer4
	GetSource() *pb.Endpoint
	GetDestination() *pb.Endpoint
	GetType() pb.FlowType
	GetNodeName() string
	GetSourceNames() []string
	GetDestinationNames() []string
	GetL7() *pb.Layer7
	GetReply() bool
	GetEventType() *pb.CiliumEventType
	GetSourceService() *pb.Service
	GetDestinationService() *pb.Service
	GetSummary() string
}

Flow is an interface matching pb.Flow

Jump to

Keyboard shortcuts

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