ateclient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 35 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	APIServiceEnv           = "ATE_API_SERVICE_NAME"
	ClientServiceAccountEnv = "ATE_CLIENT_SERVICE_ACCOUNT"
)

APIServiceEnv and ClientServiceAccountEnv override the ateapi Service and the ServiceAccount the client mints its token from. A deployment that prefixes resource names changes both, and the client has no way to discover that from outside the cluster.

View Source
const NamespaceEnv = "ATE_NAMESPACE"

NamespaceEnv overrides the namespace the client looks for substrate in. The client runs outside the cluster, so it has no downward API to read and no pod namespace to fall back on.

Variables

This section is empty.

Functions

func ConnectActorWithHeaders added in v1.0.0

func ConnectActorWithHeaders(ctx context.Context, addr string, tlsCfg *tls.Config, actorRef resources.ActorRef, port int, header http.Header, stop func()) (net.Conn, error)

ConnectActorWithHeaders dials addr over TLS, sends an HTTP CONNECT request for actorRef:port with header, and returns the tunnel connection. Closing the returned connection calls stop at most once if non-nil.

func FallbackPrincipal

func FallbackPrincipal() string

FallbackPrincipal is the principal a client authenticates as when it is given no token file: the ServiceAccount it mints a token from. Every caller relying on the fallback is this same principal.

func LoadKubeConfig

func LoadKubeConfig(kubeconfigPath, k8sContext string) (*rest.Config, error)

LoadKubeConfig loads a Kubernetes client configuration from the specified kubeconfig path and context.

func NewMetricsClientset

func NewMetricsClientset(kubeconfigPath, k8sContext string) (*metricsv1beta1.Clientset, error)

NewMetricsClientset creates a new Kubernetes Metrics Clientset using the provided kubeconfig path and context.

Types

type Client

type Client struct {
	ateapi.ControlClient
	// contains filtered or unexported fields
}

Client wraps the gRPC ControlClient and ensures the port-forward connection is closed when done.

func NewClient

func NewClient(ctx context.Context, kubeconfigPath, k8sContext, endpoint, tokenFile string, traceEnabled bool, extraOpts ...grpc.DialOption) (*Client, error)

NewClient creates a new Ate API client. If endpoint is empty, it automatically port-forwards to the ate-api-server pod in substrate's system namespace. extraOpts are appended to the options used to dial the server.

func (*Client) Close

func (c *Client) Close()

func (*Client) WorkerService

func (c *Client) WorkerService() ateapi.WorkerServiceClient

WorkerService returns a WorkerService client on the same connection. Only atelet is permitted to call WorkerService; this exists so tests can check that other callers are rejected.

type RouterDialer added in v1.0.0

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

RouterDialer opens CONNECT tunnels to actors through atenet-router.

func NewRouterDialer added in v1.0.0

func NewRouterDialer(ctx context.Context, kubeconfigPath, k8sContext string) (*RouterDialer, error)

NewRouterDialer returns a dialer that reaches atenet-router's CONNECT-TLS listener through a port-forward. It verifies the router's servicedns serving certificate and presents a podidentity certificate for the ingress client ServiceAccount, which the router allows by default.

The certificate is requested before NewRouterDialer returns, so a caller without RBAC to create PodCertificateRequests fails here. It is requested again once half its lifetime has passed.

TODO: Authenticate with a JWT once atenet-router supports JWT-based authentication instead of minting a client certificate via PodCertificateRequest.

func (*RouterDialer) DialActor added in v1.0.0

func (d *RouterDialer) DialActor(ctx context.Context, actorRef resources.ActorRef, port int) (net.Conn, error)

DialActor opens a CONNECT tunnel through atenet-router to port on actorRef. Closing the returned connection also stops its port-forward.

Jump to

Keyboard shortcuts

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