Documentation ¶
Index ¶
- Constants
- Variables
- func GetOrGenerateKeyPair(kp *v1alpha1.KeyPair, user string) ([]byte, []byte, error)
- type AzureClients
- type AzureComputeClient
- type AzureNetworkClient
- type AzureResourcesClient
- type MachineScope
- type MachineScopeGetter
- type MachineScopeGetterFunc
- type MachineScopeParams
- type Scope
- func (s *Scope) Close()
- func (s *Scope) Location() string
- func (s *Scope) Name() string
- func (s *Scope) Namespace() string
- func (s *Scope) Network() *v1alpha1.Network
- func (s *Scope) SecurityGroups() map[v1alpha1.SecurityGroupRole]*v1alpha1.SecurityGroup
- func (s *Scope) Subnets() v1alpha1.Subnets
- func (s *Scope) Vnet() *v1alpha1.Vnet
- type ScopeGetter
- type ScopeGetterFunc
- type ScopeParams
Constants ¶
const ( ClusterCA = "cluster-ca" EtcdCA = "etcd-ca" FrontProxyCA = "front-proxy-ca" ServiceAccount = "service-account" )
Variables ¶
var ( DefaultScopeGetter ScopeGetter = ScopeGetterFunc(NewScope) DefaultMachineScopeGetter MachineScopeGetter = MachineScopeGetterFunc(NewMachineScope) )
Functions ¶
Types ¶
type AzureClients ¶
type AzureClients struct { // TODO: Remove legacy clients once interfaces are reimplemented Compute AzureComputeClient Network AzureNetworkClient Resources AzureResourcesClient // Compute VM compute.VirtualMachinesClient Disks compute.DisksClient // Network VirtualNetworks network.VirtualNetworksClient SecurityGroups network.SecurityGroupsClient Interfaces network.InterfacesClient LB network.LoadBalancersClient PublicIPAddresses network.PublicIPAddressesClient // Resources Groups resources.GroupsClient Deployments resources.DeploymentsClient Tags resources.TagsClient }
AzureClients contains all the Azure clients used by the scopes.
type AzureComputeClient ¶
type AzureComputeClient interface { // Virtual Machines Operations RunCommand(resoureGroup string, name string, cmd string) (compute.VirtualMachinesRunCommandFuture, error) VMIfExists(resourceGroup string, name string) (*compute.VirtualMachine, error) DeleteVM(resourceGroup string, name string) (compute.VirtualMachinesDeleteFuture, error) WaitForVMRunCommandFuture(future compute.VirtualMachinesRunCommandFuture) error WaitForVMDeletionFuture(future compute.VirtualMachinesDeleteFuture) error // Disk Operations DeleteManagedDisk(resourceGroup string, name string) (compute.DisksDeleteFuture, error) WaitForDisksDeleteFuture(future compute.DisksDeleteFuture) error }
AzureComputeClient defines the operations that will interact with the Azure Compute API
type AzureNetworkClient ¶
type AzureNetworkClient interface { // Network Interfaces Operations DeleteNetworkInterface(resourceGroupName string, networkInterfaceName string) (network.InterfacesDeleteFuture, error) WaitForNetworkInterfacesDeleteFuture(future network.InterfacesDeleteFuture) error // Network Security Groups Operations CreateOrUpdateNetworkSecurityGroup(resourceGroupName string, networkSecurityGroupName string, location string) (*network.SecurityGroupsCreateOrUpdateFuture, error) NetworkSGIfExists(resourceGroupName string, networkSecurityGroupName string) (*network.SecurityGroup, error) WaitForNetworkSGsCreateOrUpdateFuture(future network.SecurityGroupsCreateOrUpdateFuture) error // Public Ip Address Operations CreateOrUpdatePublicIPAddress(resourceGroupName string, IPName string) (network.PublicIPAddress, error) DeletePublicIPAddress(resourceGroup string, IPName string) (network.PublicIPAddressesDeleteFuture, error) WaitForPublicIPAddressDeleteFuture(future network.PublicIPAddressesDeleteFuture) error // Virtual Networks Operations CreateOrUpdateVnet(resourceGroupName string, virtualNetworkName string, location string) (*network.VirtualNetworksCreateOrUpdateFuture, error) WaitForVnetCreateOrUpdateFuture(future network.VirtualNetworksCreateOrUpdateFuture) error }
AzureNetworkClient defines the operations that will interact with the Azure Network API
type AzureResourcesClient ¶
type AzureResourcesClient interface { // Resource Groups Operations CreateOrUpdateGroup(resourceGroupName string, location string) (resources.Group, error) DeleteGroup(resourceGroupName string) (resources.GroupsDeleteFuture, error) CheckGroupExistence(rgName string) (autorest.Response, error) WaitForGroupsDeleteFuture(future resources.GroupsDeleteFuture) error // Deployment Operations CreateOrUpdateDeployment(machine *clusterv1.Machine, clusterConfig *providerv1.AzureClusterProviderSpec, machineConfig *providerv1.AzureMachineProviderSpec, startupScript string) (*resources.DeploymentsCreateOrUpdateFuture, error) GetDeploymentResult(future resources.DeploymentsCreateOrUpdateFuture) (de resources.DeploymentExtended, err error) ValidateDeployment(machine *clusterv1.Machine, clusterConfig *providerv1.AzureClusterProviderSpec, machineConfig *providerv1.AzureMachineProviderSpec, startupScript string) error WaitForDeploymentsCreateOrUpdateFuture(future resources.DeploymentsCreateOrUpdateFuture) error }
AzureResourcesClient defines the operations that will interact with the Azure Resources API
type MachineScope ¶
type MachineScope struct { *Scope Machine *clusterv1.Machine MachineClient client.MachineInterface MachineConfig *v1alpha1.AzureMachineProviderSpec MachineStatus *v1alpha1.AzureMachineProviderStatus }
MachineScope defines a scope defined around a machine and its cluster.
func NewMachineScope ¶
func NewMachineScope(params MachineScopeParams) (*MachineScope, error)
NewMachineScope creates a new MachineScope from the supplied parameters. This is meant to be called for each machine actuator operation.
func (*MachineScope) Close ¶
func (m *MachineScope) Close()
func (*MachineScope) Location ¶
func (m *MachineScope) Location() string
Location returns the machine location.
func (*MachineScope) Namespace ¶
func (m *MachineScope) Namespace() string
Namespace returns the machine namespace.
func (*MachineScope) Role ¶
func (m *MachineScope) Role() string
Role returns the machine role from the labels.
type MachineScopeGetter ¶
type MachineScopeGetter interface {
GetMachineScope(params MachineScopeParams) (*MachineScope, error)
}
type MachineScopeGetterFunc ¶
type MachineScopeGetterFunc func(params MachineScopeParams) (*MachineScope, error)
func (MachineScopeGetterFunc) GetMachineScope ¶
func (f MachineScopeGetterFunc) GetMachineScope(params MachineScopeParams) (*MachineScope, error)
type MachineScopeParams ¶
type MachineScopeParams struct { AzureClients Cluster *clusterv1.Cluster Machine *clusterv1.Machine Client client.ClusterV1alpha1Interface }
MachineScopeParams defines the input parameters used to create a new MachineScope.
type Scope ¶
type Scope struct { AzureClients Cluster *clusterv1.Cluster ClusterClient client.ClusterInterface ClusterConfig *v1alpha1.AzureClusterProviderSpec ClusterStatus *v1alpha1.AzureClusterProviderStatus Context context.Context }
Scope defines the basic context for an actuator to operate upon.
func NewScope ¶
func NewScope(params ScopeParams) (*Scope, error)
NewScope creates a new Scope from the supplied parameters. This is meant to be called for each different actuator iteration.
func (*Scope) Close ¶
func (s *Scope) Close()
Close closes the current scope persisting the cluster configuration and status.
func (*Scope) SecurityGroups ¶
func (s *Scope) SecurityGroups() map[v1alpha1.SecurityGroupRole]*v1alpha1.SecurityGroup
SecurityGroups returns the cluster security groups as a map, it creates the map if empty.
type ScopeGetter ¶
type ScopeGetter interface {
GetScope(params ScopeParams) (*Scope, error)
}
type ScopeGetterFunc ¶
type ScopeGetterFunc func(params ScopeParams) (*Scope, error)
func (ScopeGetterFunc) GetScope ¶
func (f ScopeGetterFunc) GetScope(params ScopeParams) (*Scope, error)
type ScopeParams ¶
type ScopeParams struct { AzureClients Cluster *clusterv1.Cluster Client client.ClusterV1alpha1Interface }
ScopeParams defines the input parameters used to create a new Scope.