Documentation
¶
Index ¶
- Constants
- func InstanceIDFromProviderID(providerID string) (string, error)
- func NewProviderID(instanceID string) string
- type InstancesV2
- type LoadBalancer
- func (l *LoadBalancer) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
- func (l *LoadBalancer) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error
- func (l *LoadBalancer) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)
- func (l *LoadBalancer) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string
- func (l *LoadBalancer) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error
- type Oxide
- func (o *Oxide) Clusters() (cloudprovider.Clusters, bool)
- func (o *Oxide) HasClusterID() bool
- func (o *Oxide) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})
- func (o *Oxide) Instances() (cloudprovider.Instances, bool)
- func (o *Oxide) InstancesV2() (cloudprovider.InstancesV2, bool)
- func (o *Oxide) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (o *Oxide) ProviderName() string
- func (o *Oxide) Routes() (cloudprovider.Routes, bool)
- func (o *Oxide) Zones() (cloudprovider.Zones, bool)
Constants ¶
const ( // AnnotationFloatingIP specifies an explicit IP address to allocate for // the floating IP, using the default IP pool for the respective IP version // of the address. Mutually exclusive with [AnnotationFloatingIPPool] and // [AnnotationFloatingIPVersion]. AnnotationFloatingIP = "oxide.computer/floating-ip" // AnnotationFloatingIPPool specifies the IP pool to automatically allocate a // floating IP from. AnnotationFloatingIPPool = "oxide.computer/floating-ip-pool" // AnnotationFloatingIPVersion specifies the IP version (e.g., `v4` or `v6`) of // the floating IP to allocate, using the default IP pool for the IP version. // Cannot be used when [AnnotationFloatingIPPool] is set. AnnotationFloatingIPVersion = "oxide.computer/floating-ip-version" )
const Name = "oxide"
Name is the name of this cloud provider.
Variables ¶
This section is empty.
Functions ¶
func InstanceIDFromProviderID ¶
InstanceIDFromProviderID extracts the Oxide instance ID from a provider ID.
func NewProviderID ¶
NewProviderID formats an Oxide instance ID as a provider ID.
Types ¶
type InstancesV2 ¶
type InstancesV2 struct {
// contains filtered or unexported fields
}
InstancesV2 implements cloudprovider.InstancesV2 to provide Oxide specific instance functionality.
func (*InstancesV2) InstanceExists ¶
InstanceExists checks whether the provided Kubernetes node exists as instance in Oxide.
func (*InstancesV2) InstanceMetadata ¶
func (i *InstancesV2) InstanceMetadata( ctx context.Context, node *v1.Node, ) (*cloudprovider.InstanceMetadata, error)
InstanceMetadata populates the metadata for the provided node, notably setting its provider ID.
func (*InstancesV2) InstanceShutdown ¶
InstanceShutdown checks whether the provided node is shut down in Oxide.
type LoadBalancer ¶ added in v0.4.0
type LoadBalancer struct {
// contains filtered or unexported fields
}
LoadBalancer implements cloudprovider.LoadBalancer by attaching a single floating IP to one Kubernetes node.
func (*LoadBalancer) EnsureLoadBalancer ¶ added in v0.4.0
func (l *LoadBalancer) EnsureLoadBalancer( ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node, ) (*v1.LoadBalancerStatus, error)
EnsureLoadBalancer creates a floating IP if it does not exist, attaches it to the first node in nodes order by name, and returns the load balancer status with the floating IP address and node's internal IP addresses.
func (*LoadBalancer) EnsureLoadBalancerDeleted ¶ added in v0.4.0
func (l *LoadBalancer) EnsureLoadBalancerDeleted( ctx context.Context, clusterName string, service *v1.Service, ) error
EnsureLoadBalancerDeleted detaches and deletes the floating IP.
func (*LoadBalancer) GetLoadBalancer ¶ added in v0.4.0
func (l *LoadBalancer) GetLoadBalancer( ctx context.Context, clusterName string, service *v1.Service, ) (*v1.LoadBalancerStatus, bool, error)
GetLoadBalancer returns the status of the floating IP "load balancer" for the given service. It fetches the floating IP from Oxide, checks whether the floating IP is attached to an instance that's a valid Kubernetes node, and returns the load balancer status with the floating IP address and the instance's internal IP addresses.
func (*LoadBalancer) GetLoadBalancerName ¶ added in v0.4.0
func (l *LoadBalancer) GetLoadBalancerName( ctx context.Context, clusterName string, service *v1.Service, ) string
GetLoadBalancerName returns a stable load balancer name derived from the cluster name, namespace, and service name, truncated to at most 63 characters.
func (*LoadBalancer) UpdateLoadBalancer ¶ added in v0.4.0
func (l *LoadBalancer) UpdateLoadBalancer( ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node, ) error
UpdateLoadBalancer updates an existing load balancer by attaching the floating IP to the first node ordered by name.
type Oxide ¶
type Oxide struct {
// contains filtered or unexported fields
}
Oxide is the Oxide cloud provider. It implements cloudprovider.Interface to provide Oxide specific functionality.
func (*Oxide) Clusters ¶
func (o *Oxide) Clusters() (cloudprovider.Clusters, bool)
Clusters is purposefully unimplemented. This is meant for a single Cloud Controller Manager to manage multiple Kubernetes clusters but the modern idiom is to run a single Cloud Controller Manager per Kubernetes cluster, making this irrelevant.
func (*Oxide) HasClusterID ¶
HasClusterID is purposefully unimplemented. A cluster ID is used to uniquely identify resources for a specific Kubernetes cluster when multiple Kubernetes clusters can conflict with each other when using shared resources (e.g., VPC, load balancer). Usually, such resources are tagged or labeled with the cluster ID but Oxide does not have resource tags or labels. Additionally, it's expected that a Kubernetes cluster on Oxide is deployed in its own VPC and does not share resources with other Kubernetes clusters. This may become supported in the future when Oxide has resource tags or labels.
func (*Oxide) Initialize ¶
func (o *Oxide) Initialize( clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{}, )
Initialize creates the Oxide and Kubernetes clients and spawns any additional controllers, if necessary.
func (*Oxide) Instances ¶
func (o *Oxide) Instances() (cloudprovider.Instances, bool)
Instances is purposefully unimplemented. Use Oxide.InstancesV2.
func (*Oxide) InstancesV2 ¶
func (o *Oxide) InstancesV2() (cloudprovider.InstancesV2, bool)
InstancesV2 returns an implementation of cloudprovider.InstancesV2 that provides functionality to initialize Kubernetes nodes, provide their metadata, and determine whether they exists to facilitate cleanup.
func (*Oxide) LoadBalancer ¶
func (o *Oxide) LoadBalancer() (cloudprovider.LoadBalancer, bool)
func (*Oxide) ProviderName ¶
ProviderName returns the name of this cloud provider.
func (*Oxide) Routes ¶
func (o *Oxide) Routes() (cloudprovider.Routes, bool)
Routes is purposefully unimplemented. It is expected that the Kubernetes cluster uses a third-party CNI instead of this controller. This may be implemented in the future.
func (*Oxide) Zones ¶
func (o *Oxide) Zones() (cloudprovider.Zones, bool)
Zones is purposefully unimplemented. Zone and region information is retrieved from InstancesV2.InstanceMetadata instead.