pipy

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package pipy implements utility routines related to Pipy proxy, and models an instance of a proxy to be able to generate XDS configurations for it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNetAddress

func NewNetAddress(address string) net.Addr

NewNetAddress creates a new net.Addr

Types

type NetAddr

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

NetAddr represents a network end point address.

The two methods Network and String conventionally return strings that can be passed as the arguments to Dial, but the exact form and meaning of the strings is up to the implementation.

func (*NetAddr) Network

func (a *NetAddr) Network() string

Network implements net.Addr interface

func (*NetAddr) String

func (a *NetAddr) String() string

String form of address (for example, "192.0.2.1:25", "[2001:db8::1]:80")

type Proxy

type Proxy struct {

	// UUID of the proxy
	uuid.UUID

	Identity identity.ServiceIdentity

	net.Addr

	// Records metadata around the Kubernetes Pod on which this Sidecar Proxy is installed.
	// This could be nil if the Sidecar is not operating in a Kubernetes cluster (VM for example)
	// NOTE: This field may be not be set at the time Proxy struct is initialized. This would
	// eventually be set when the metadata arrives via the xDS protocol.
	Metadata *ProxyMetadata

	MeshConf    *configurator.Configurator
	SidecarCert *certificate.Certificate

	// The version of Pipy Repo Codebase
	ETag uint64

	Backlogs int32
	Mutex    *sync.RWMutex
	Quit     chan bool

	ID uint64

	VM        bool
	MachineIP net.Addr

	ClusterID string
	// contains filtered or unexported fields
}

Proxy is a representation of an Sidecar proxy . This should at some point have a 1:1 match to an Endpoint (which is a member of a meshed service).

func NewProxy

func NewProxy(kind models.ProxyKind, uuid uuid.UUID, svcIdentity identity.ServiceIdentity, vm bool, ip net.Addr) *Proxy

NewProxy creates a new instance of an Sidecar proxy connected to the servers.

func (*Proxy) GetAddr

func (p *Proxy) GetAddr() string

GetAddr returns the IP address of the proxy connected.

func (*Proxy) GetCNPrefix

func (p *Proxy) GetCNPrefix() string

GetCNPrefix returns a newly generated CommonName for a certificate of the form: <ProxyUUID>.<kind>.<identity> where identity itself is of the form <name>.<namespace>

func (*Proxy) GetConnectedAt

func (p *Proxy) GetConnectedAt() time.Time

GetConnectedAt returns the timestamp of when the given proxy connected to the control plane.

func (*Proxy) GetIP

func (p *Proxy) GetIP() net.Addr

GetIP returns the address of the proxy connected.

func (*Proxy) GetIdentity

func (p *Proxy) GetIdentity() identity.ServiceIdentity

GetIdentity returns ServiceIdentity.

func (*Proxy) GetName

func (p *Proxy) GetName() string

GetName returns a unique name for this proxy based on the identity and uuid.

func (*Proxy) GetUUID

func (p *Proxy) GetUUID() uuid.UUID

GetUUID returns UUID.

func (*Proxy) HasMetadata added in v1.2.0

func (p *Proxy) HasMetadata() bool

HasMetadata answers the question - has the Pod metadata been recorded for the given Sidecar proxy

func (*Proxy) Kind

func (p *Proxy) Kind() models.ProxyKind

Kind return the proxy's kind

func (*Proxy) MetadataString added in v1.2.0

func (p *Proxy) MetadataString() string

MetadataString returns relevant pod metadata as a string

func (*Proxy) StatsHeaders

func (p *Proxy) StatsHeaders() map[string]string

StatsHeaders returns the headers required for SMI metrics

func (*Proxy) String

func (p *Proxy) String() string

type ProxyMetadata added in v1.2.0

type ProxyMetadata struct {
	UID             string
	Name            string
	Namespace       string
	IP              string
	ServiceAccount  identity.K8sServiceAccount
	CreationTime    time.Time
	Cluster         string
	SidecarNodeID   string
	WorkloadKind    string
	WorkloadName    string
	ReadinessProbes []*v1.Probe
	LivenessProbes  []*v1.Probe
	StartupProbes   []*v1.Probe
}

ProxyMetadata is a struct holding information on the Pod/VM on which a given Sidecar proxy is installed This struct is initialized *eventually*, when the metadata arrives via xDS.

Directories

Path Synopsis
Package bootstrap implements functionality related to Pipy's bootstrap config.
Package bootstrap implements functionality related to Pipy's bootstrap config.
Package client implements the PipyRepo struct.
Package client implements the PipyRepo struct.
Package driver implements debugger's methods.
Package driver implements debugger's methods.
Package registry implements handler's methods.
Package registry implements handler's methods.
Package repo implements broadcast's methods.
Package repo implements broadcast's methods.

Jump to

Keyboard shortcuts

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