k8straceannotator

package
v0.0.0-...-6cfc1b2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ResyncPeriod = 1 * time.Minute

Variables

This section is empty.

Functions

func DetectDestinationObject

func DetectDestinationObject(ctx context.Context, k8s K8sClient, trace *pluginsmodels.Telemetry) (runtime.Object, error)

func DetectSourceObject

func DetectSourceObject(ctx context.Context, k8s K8sClient, trace *pluginsmodels.Telemetry) (runtime.Object, error)

func ParseAddr

func ParseAddr(addr string) (ip, port string)

Types

type AppEnvInfo

type AppEnvInfo struct {
	Address   string
	Namespace string
	K8SObject *K8sObjectRef
}

type K8SAnnotatedK8STelemetry

type K8SAnnotatedK8STelemetry struct {
	RequestID   string
	Scheme      string
	Destination *AppEnvInfo
	Source      *AppEnvInfo
	Request     *pluginsmodels.Request
	Response    *pluginsmodels.Response
}

func NewK8SAnnotatedK8STelemetry

func NewK8SAnnotatedK8STelemetry(trace *pluginsmodels.Telemetry, src, dest runtime.Object) *K8SAnnotatedK8STelemetry

type K8sClient

type K8sClient interface {
	ServicesGet(namespace, name string) (*corev1.Service, error)
	ServicesList(namespace string) ([]*corev1.Service, error)
	PodsList(namespace string) ([]*corev1.Pod, error)

	GetObject(ctx context.Context, apiVersion, kind, namespace, name string) (runtime.Object, error)
	GetObjectOwnerRecursively(ctx context.Context, namespace string, refs []metav1.OwnerReference) (runtime.Object, error)
}

func NewK8sClient

func NewK8sClient(clientset kubernetes.Interface) (K8sClient, error)

type K8sObjectRef

type K8sObjectRef struct {
	// nolint:revive,stylecheck
	ApiVersion string `json:"apiVersion,omitempty"`
	Kind       string `json:"kind,omitempty"`
	Name       string `json:"name,omitempty"`
	Namespace  string `json:"namespace,omitempty"`
	// nolint:revive,stylecheck
	Uid string `json:"uid,omitempty"`
}

func NewRef

func NewRef(obj runtime.Object) *K8sObjectRef

Jump to

Keyboard shortcuts

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