Documentation
¶
Index ¶
- type Cluster
- func (c *Cluster) Close(ctx context.Context) error
- func (c *Cluster) ControlPlaneDNSZoneAndName() (string, string, error)
- func (c *Cluster) ControlPlaneHost() (string, error)
- func (c *Cluster) ControlPlaneLoadBalancerAllowedRanges() []string
- func (c *Cluster) ControlPlaneLoadBalancerIPs() []string
- func (c *Cluster) ControlPlaneLoadBalancerPort() int32
- func (c *Cluster) ControlPlaneLoadBalancerPrivate() bool
- func (c *Cluster) HasControlPlaneDNS() bool
- func (c *Cluster) HasPrivateNetwork() bool
- func (c *Cluster) PatchObject(ctx context.Context) error
- func (c *Cluster) PrivateNetworkID() (string, error)
- func (c *Cluster) ResourceName(suffixes ...string) string
- func (c *Cluster) ResourceTags(additional ...string) []string
- func (c *Cluster) SetFailureDomains(zones []scw.Zone)
- func (c *Cluster) SetStatusExtraLoadBalancerIPs(ips []string)
- func (c *Cluster) SetStatusLoadBalancerIP(ip string)
- func (c *Cluster) SetStatusPrivateNetworkID(pnID string)
- func (c *Cluster) SetStatusVPCID(vpcID string)
- func (c *Cluster) ShouldManagePrivateNetwork() bool
- type ClusterParams
- type Machine
- func (m *Machine) Close(ctx context.Context) error
- func (m *Machine) GetBootstrapData(ctx context.Context) ([]byte, error)
- func (m *Machine) HasJoinedCluster() bool
- func (m *Machine) HasPublicIPv4() bool
- func (m *Machine) HasPublicIPv6() bool
- func (m *Machine) IsControlPlane() bool
- func (m *Machine) PatchObject(ctx context.Context) error
- func (m *Machine) ResourceName() string
- func (m *Machine) ResourceTags() []string
- func (m *Machine) RootVolumeIOPS() *int64
- func (m *Machine) RootVolumeSize() scw.Size
- func (m *Machine) RootVolumeType() (instance.VolumeVolumeType, error)
- func (m *Machine) SetAddresses(addresses []clusterv1.MachineAddress)
- func (m *Machine) SetProviderID(providerID string)
- func (m *Machine) Zone() (scw.Zone, error)
- type MachineParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
Cluster *clusterv1.Cluster
ScalewayCluster *infrav1.ScalewayCluster
ScalewayClient scwClient.Interface
// contains filtered or unexported fields
}
Cluster is a Cluster scope.
func NewCluster ¶
func NewCluster(ctx context.Context, params *ClusterParams) (*Cluster, error)
NewCluster creates a new Cluster scope.
func (*Cluster) ControlPlaneDNSZoneAndName ¶ added in v0.1.1
ControlPlaneDNSZoneAndName returns the DNS zone and the name of the records that should be updated.
func (*Cluster) ControlPlaneHost ¶
ControlPlaneHost returns the control plane host.
func (*Cluster) ControlPlaneLoadBalancerAllowedRanges ¶
ControlPlaneLoadBalancerAllowedRanges returns the control plane loadbalancer allowed ranges.
func (*Cluster) ControlPlaneLoadBalancerIPs ¶
ControlPlaneLoadBalancerIPs returns the IPs of the control plane loadbalancers.
func (*Cluster) ControlPlaneLoadBalancerPort ¶
ControlPlaneLoadBalancerPort returns the port to use for the control plane loadbalancer frontend.
func (*Cluster) ControlPlaneLoadBalancerPrivate ¶ added in v0.1.1
ControlPlaneLoadBalancerPrivate returns true if the control plane should only be accessible through a private endpoint.
func (*Cluster) HasControlPlaneDNS ¶
HasControlPlaneDNS returns true if the cluster has an associated domain (public or private).
func (*Cluster) HasPrivateNetwork ¶
HasPrivateNetwork returns true if the cluster has a Private Network.
func (*Cluster) PatchObject ¶
PatchObject patches the ScalewayCluster object.
func (*Cluster) PrivateNetworkID ¶
PrivateNetworkID returns the PrivateNetwork ID of the cluster, obtained from the status of the ScalewayCluster resource.
func (*Cluster) ResourceName ¶
ResourceNameName returns the name/prefix that resources created for the cluster should have. It is possible to provide additional suffixes that will be appended to the name with a leading "-".
func (*Cluster) ResourceTags ¶
ResourceTags returns the tags that resources created for the cluster should have. It is possible to provide additional tags that will be added to the default tags.
func (*Cluster) SetFailureDomains ¶
SetFailureDomains sets the failure domains of the cluster.
func (*Cluster) SetStatusExtraLoadBalancerIPs ¶
SetStatusExtraLoadBalancerIPs sets the extra loadbalancer IPs in the status.
func (*Cluster) SetStatusLoadBalancerIP ¶
SetStatusLoadBalancerIP sets the loadbalancer IP in the status.
func (*Cluster) SetStatusPrivateNetworkID ¶
SetStatusPrivateNetworkID sets the Private Network ID in the status of the ScalewayCluster object.
func (*Cluster) SetStatusVPCID ¶ added in v0.1.1
SetStatusVPCID sets the VPC ID in the status of the ScalewayCluster object.
func (*Cluster) ShouldManagePrivateNetwork ¶
ShouldManagePrivateNetwork returns true if the provider should manage the Private Network of the cluster.
type ClusterParams ¶
type ClusterParams struct {
Client client.Client
Cluster *clusterv1.Cluster
ScalewayCluster *infrav1.ScalewayCluster
}
ClusterParams contains mandatory params for creating the Cluster scope.
type Machine ¶
type Machine struct {
Client client.Client
*Cluster
Machine *clusterv1.Machine
ScalewayMachine *infrav1.ScalewayMachine
// contains filtered or unexported fields
}
func NewMachine ¶
func NewMachine(params *MachineParams) (*Machine, error)
NewMachine creates a new Machine scope.
func (*Machine) GetBootstrapData ¶
GetBootstrapData retrieves the bootstrap data from the secret specified in the ScalewayMachine. It returns an error if the secret is not found or if the value key is missing.
func (*Machine) HasJoinedCluster ¶
HasJoinedCluster returns true if the machine has joined the cluster. A machine is considered to have joined the cluster if it has a NodeRef with a non-empty name.
func (*Machine) HasPublicIPv4 ¶
HasPublicIPv4 returns true if the machine should have a Public IPv4 address.
func (*Machine) HasPublicIPv6 ¶
HasPublicIPv6 returns true if the machine should have a Public IPv6 address.
func (*Machine) IsControlPlane ¶
IsControlPlane returns true if the machine is a control plane machine.
func (*Machine) PatchObject ¶
PatchObject patches the ScalewayMachine object.
func (*Machine) ResourceName ¶
ResourceNameName returns the name that resources created for the machine should have.
func (*Machine) ResourceTags ¶
ResourceTags returns the tags that resources created for the machine should have.
func (*Machine) RootVolumeIOPS ¶
RootVolumeIOPS returns the IOPS of the root volume for the machine. If not specified, it returns nil. Note: IOPS is only applicable for block volumes.
func (*Machine) RootVolumeSize ¶
RootVolumeSize returns the size of the root volume for the machine.
func (*Machine) RootVolumeType ¶
RootVolumeType returns the type of the root volume for the machine.
func (*Machine) SetAddresses ¶
func (m *Machine) SetAddresses(addresses []clusterv1.MachineAddress)
SetAddresses sets the addresses of the ScalewayMachine. It replaces the existing addresses with the provided ones.
func (*Machine) SetProviderID ¶
SetProviderID sets the ProviderID of the ScalewayMachine if it is not already set.
type MachineParams ¶
type MachineParams struct {
Client client.Client
ClusterScope *Cluster
Machine *clusterv1.Machine
ScalewayMachine *infrav1.ScalewayMachine
}
MachineParams contains mandatory params for creating the Machine scope.