types

package
v1.48.4 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type Type

	// NetworkName required to filter only requested network
	NetworkName string

	// Authentication
	CredentialsFile string // Path to service account key (fallback)

	// GCP specific
	GCPProjectID string

	// AWS specific (for future)
	AWSAccountID string

	// Azure specific (for future)
	AzureSubscriptionID string
}

Config contains cloud provider configuration.

type Metadata

type Metadata struct {
	Provider      Type
	Domain        string // Cloud domain (e.g., googleapis.com, amazonaws.com)
	VPCs          []VPC
	ServiceRanges []ServiceRanges // Cloud provider service IP ranges (e.g., GCP APIs)
}

type PeeredVPC

type PeeredVPC struct {
	Name   string
	Ranges []PeeredVPCRange
}

PeeredVPC represents a VPC peering connection.

type PeeredVPCRange

type PeeredVPCRange struct {
	Zone   string
	Region string
	CIDR   netip.Prefix
}

PeeredVPCRange represents a VPC peering IP ranges.

type Provider

type Provider interface {
	// GetMetadata returns the cached network metadata for the cluster's cloud environment.
	GetMetadata(ctx context.Context) (*Metadata, error)

	// RefreshMetadata updates cached metadata.
	RefreshMetadata(ctx context.Context) error

	// Type returns the cloud provider type.
	Type() Type

	// Close cleans up resources.
	Close() error
}

Provider defines cloud-agnostic operations for fetching VPC/network metadata.

type SecondaryRange

type SecondaryRange struct {
	Name string
	CIDR netip.Prefix
	Type string // "pods" or "services"
}

SecondaryRange represents secondary IP ranges (GKE pods/services).

type ServiceRanges

type ServiceRanges struct {
	Region string
	CIRDs  []netip.Prefix
}

ServiceRanges contains cloud provider service IP ranges.

type Subnet

type Subnet struct {
	ID              string
	Name            string
	CIDR            netip.Prefix
	Zone            string // AWS specific, GCP does not have zonal subnets
	Region          string
	SecondaryRanges []SecondaryRange // GCP specific
}

Subnet represents a subnet within a VPC.

type Type

type Type string
const (
	TypeGCP   Type = "gcp"
	TypeAWS   Type = "aws"
	TypeAzure Type = "azure"
	TypeNone  Type = "none"
)

type VPC

type VPC struct {
	ID         string
	Name       string
	CIDRs      []netip.Prefix // GCP does not have CIDR on vpc level
	Subnets    []Subnet
	PeeredVPCs []PeeredVPC
}

VPC represents a virtual private cloud/network.

Jump to

Keyboard shortcuts

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