types

package
v1.49.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TypeGCP   Type = "gcp"
	TypeAWS   Type = "aws"
	TypeAzure Type = "azure"

	DomainGCP string = "googleapis.com"
	DomainAWS string = "amazonaws.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkState added in v1.49.0

type NetworkState 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 {
	// Type returns the cloud provider type.
	Type() Type

	// GetNetworkState returns the cached network state for the cluster's cloud environment.
	GetNetworkState(ctx context.Context) (*NetworkState, error)

	// RefreshNetworkState updates cached network state.
	RefreshNetworkState(ctx context.Context, network string) error

	// GetStorageState returns the storage state for the cluster's cloud environment.
	GetStorageState(ctx context.Context, instanceIds ...string) (*StorageState, error)

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

Provider defines cloud-agnostic operations for fetching cloud environment state.

type ProviderConfig added in v1.49.0

type ProviderConfig struct {
	Type Type

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

	// GCP specific
	GCPProjectID string

	// AWS specific
	AWSRegion string

	// Azure specific (for future)
	AzureSubscriptionID string
}

ProviderConfig contains cloud provider configuration.

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 StorageState added in v1.49.0

type StorageState struct {
	Provider        Type
	Domain          string              // Cloud domain (e.g., googleapis.com, amazonaws.com)
	InstanceVolumes map[string][]Volume // Instance id -> volumes
}

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

func NewProviderType added in v1.49.0

func NewProviderType(provider string) (Type, error)

func (Type) KubernetesType added in v1.49.0

func (t Type) KubernetesType() string

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.

type Volume added in v1.49.0

type Volume struct {
	VolumeID        string
	VolumeType      string
	VolumeState     string
	SizeBytes       int64
	IOPS            int32
	ThroughputBytes int32
	Encrypted       bool
	Zone            string
}

Volume represents a cloud storage volume with metrics data

Jump to

Keyboard shortcuts

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