agentmap

package
v2.21.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerPortsAnnotation = agentconfig.DomainPrefix + "inject-container-ports"
	ServicePortsAnnotation   = agentconfig.DomainPrefix + "inject-service-ports"
	// ServicePortAnnotation is deprecated. Use plural form instead.
	ServicePortAnnotation = agentconfig.DomainPrefix + "inject-service-port"
	ServiceNameAnnotation = agentconfig.DomainPrefix + "inject-service-name"
	ManagerAppName        = "traffic-manager"
)

Variables

View Source
var GeneratorConfigFunc func(qualifiedAgentImage string) (GeneratorConfig, error) //nolint:gochecknoglobals // extension point
View Source
var ReplicaSetNameRx = regexp.MustCompile(`\A(.+)-[a-f0-9]+\z`)
View Source
var TrafficManagerSelector = labels.SelectorFromSet(map[string]string{
	"app":          ManagerAppName,
	"telepresence": "manager",
})

Functions

func AgentContainer added in v2.19.0

func AgentContainer(pod *core.Pod) *core.Container

AgentContainer returns the pod's traffic-agent container, or nil if the pod doesn't have a traffic-agent.

func Base26 added in v2.20.0

func Base26(v uint64) string

Base26 converts the given number into base 26, represented using the letters 'a' to 'z'.

func CapsBase26

func CapsBase26(v uint64) string

CapsBase26 converts the given number into base 26, represented using the letters 'A' to 'Z'.

func FindOwnerWorkload

func FindOwnerWorkload(ctx context.Context, obj k8sapi.Object, supportedWorkloadKinds []string) (k8sapi.Workload, error)

func FindServicesForPod added in v2.20.0

func FindServicesForPod(ctx context.Context, pod *core.PodTemplateSpec, svcName string) ([]k8sapi.Object, error)

func GetWorkload added in v2.19.0

func GetWorkload(ctx context.Context, name, namespace, workloadKind string) (obj k8sapi.Workload, err error)

func InitContainer added in v2.19.0

func InitContainer(pod *core.Pod) *core.Container

InitContainer returns the pod's tel-agent-init init-container, or nil if the pod doesn't have a tel-agent-init.

func IsPodRunning added in v2.19.0

func IsPodRunning(pod *core.Pod) bool

IsPodRunning returns true if at least one container has state Running and a non-zero StartedAt.

Types

type BasicGeneratorConfig added in v2.14.1

type BasicGeneratorConfig struct {
	ManagerPort         uint16
	AgentPort           uint16
	APIPort             uint16
	QualifiedAgentImage string
	ManagerNamespace    string
	LogLevel            string
	InitResources       *core.ResourceRequirements
	Resources           *core.ResourceRequirements
	PullPolicy          string
	PullSecrets         []core.LocalObjectReference
	AppProtocolStrategy k8sapi.AppProtocolStrategy
	SecurityContext     *core.SecurityContext
}

func (*BasicGeneratorConfig) Generate added in v2.14.1

func (cfg *BasicGeneratorConfig) Generate(
	ctx context.Context,
	wl k8sapi.Workload,
	existingConfig agentconfig.SidecarExt,
) (sc agentconfig.SidecarExt, err error)

type GeneratorConfig

type GeneratorConfig interface {
	// Generate generates a configuration for the given workload. If replaceContainers is given it will be used to configure
	// container replacement EXCEPT if existingConfig is not nil, in which replaceContainers will be
	// ignored and the value from existingConfig used. 0 can be conventionally passed in as replaceContainers in this case.
	Generate(
		ctx context.Context,
		wl k8sapi.Workload,
		existingConfig agentconfig.SidecarExt,
	) (sc agentconfig.SidecarExt, err error)
}

Jump to

Keyboard shortcuts

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