scope

package
v0.5.5-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: Apache-2.0 Imports: 34 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewEC2Client added in v0.5.5

func NewEC2Client(scopeUser cloud.ScopeUsage, session cloud.Session, target runtime.Object) ec2iface.EC2API

NewEC2Client creates a new EC2 API client for a given session

func NewELBClient added in v0.5.5

func NewELBClient(scopeUser cloud.ScopeUsage, session cloud.Session, target runtime.Object) elbiface.ELBAPI

NewELBClient creates a new ELB API client for a given session

func NewResourgeTaggingClient added in v0.5.5

func NewResourgeTaggingClient(scopeUser cloud.ScopeUsage, session cloud.Session, target runtime.Object) resourcegroupstaggingapiiface.ResourceGroupsTaggingAPIAPI

NewResourgeTaggingClient creates a new Resource Tagging API client for a given session

func NewSecretsManagerClient added in v0.5.5

func NewSecretsManagerClient(scopeUser cloud.ScopeUsage, session cloud.Session, target runtime.Object) secretsmanageriface.SecretsManagerAPI

NewSecretsManagerClient creates a new Secrets API client for a given session

Types

type ClusterScope

type ClusterScope struct {
	logr.Logger

	Cluster    *clusterv1.Cluster
	AWSCluster *infrav1.AWSCluster
	// contains filtered or unexported fields
}

ClusterScope defines the basic context for an actuator to operate upon.

func NewClusterScope

func NewClusterScope(params ClusterScopeParams) (*ClusterScope, error)

NewClusterScope creates a new Scope from the supplied parameters. This is meant to be called for each reconcile iteration.

func (*ClusterScope) APIServerPort added in v0.4.1

func (s *ClusterScope) APIServerPort() int32

APIServerPort returns the APIServerPort to use when creating the load balancer.

func (*ClusterScope) AdditionalTags added in v0.4.1

func (s *ClusterScope) AdditionalTags() infrav1.Tags

AdditionalTags returns AdditionalTags from the scope's AWSCluster. The returned value will never be nil.

func (*ClusterScope) Bastion added in v0.5.5

func (s *ClusterScope) Bastion() *infrav1.Bastion

Bastion returns the bastion details.

func (*ClusterScope) CNIIngressRules added in v0.5.5

func (s *ClusterScope) CNIIngressRules() infrav1.CNIIngressRules

CNIIngressRules returns the CNI spec ingress rules.

func (*ClusterScope) Close

func (s *ClusterScope) Close() error

Close closes the current scope persisting the cluster configuration and status.

func (*ClusterScope) ControlPlaneConfigMapName

func (s *ClusterScope) ControlPlaneConfigMapName() string

ControlPlaneConfigMapName returns the name of the ConfigMap used to coordinate the bootstrapping of control plane nodes.

func (*ClusterScope) ControlPlaneLoadBalancer added in v0.4.3

func (s *ClusterScope) ControlPlaneLoadBalancer() *infrav1.AWSLoadBalancerSpec

ControlPlaneLoadBalancer returns the AWSLoadBalancerSpec

func (*ClusterScope) ControlPlaneLoadBalancerScheme added in v0.4.3

func (s *ClusterScope) ControlPlaneLoadBalancerScheme() infrav1.ClassicELBScheme

ControlPlaneLoadBalancerScheme returns the Classic ELB scheme (public or internal facing)

func (*ClusterScope) ControllerName added in v0.5.5

func (s *ClusterScope) ControllerName() string

ControllerName returns the name of the controller that created the ClusterScope.

func (*ClusterScope) InfraCluster added in v0.5.5

func (s *ClusterScope) InfraCluster() cloud.ClusterObject

InfraCluster returns the AWS infrastructure cluster object. Initially this will be AWSCluster but in the future it could also be AWSManagedCluster

func (*ClusterScope) ListOptionsLabelSelector

func (s *ClusterScope) ListOptionsLabelSelector() client.ListOption

ListOptionsLabelSelector returns a ListOptions with a label selector for clusterName.

func (*ClusterScope) Name

func (s *ClusterScope) Name() string

Name returns the cluster name.

func (*ClusterScope) Namespace

func (s *ClusterScope) Namespace() string

Namespace returns the cluster namespace.

func (*ClusterScope) Network

func (s *ClusterScope) Network() *infrav1.Network

Network returns the cluster network object.

func (*ClusterScope) PatchObject added in v0.5.0

func (s *ClusterScope) PatchObject() error

PatchObject persists the cluster configuration and status.

func (*ClusterScope) Region

func (s *ClusterScope) Region() string

Region returns the cluster region.

func (*ClusterScope) SSHKeyName added in v0.5.5

func (s *ClusterScope) SSHKeyName() *string

SSHKeyName returns the SSH key name to use for instances.

func (*ClusterScope) SecurityGroups

SecurityGroups returns the cluster security groups as a map, it creates the map if empty.

func (*ClusterScope) Session added in v0.5.5

func (s *ClusterScope) Session() awsclient.ConfigProvider

Session returns the AWS SDK session. Used for creating clients

func (*ClusterScope) SetBastionInstance added in v0.5.5

func (s *ClusterScope) SetBastionInstance(instance *infrav1.Instance)

SetBastionInstance sets the bastion instance in the status of the cluster.

func (*ClusterScope) SetFailureDomain added in v0.5.0

func (s *ClusterScope) SetFailureDomain(id string, spec clusterv1.FailureDomainSpec)

SetFailureDomain sets the infrastructure provider failure domain key to the spec given as input.

func (*ClusterScope) SetSubnets added in v0.5.5

func (s *ClusterScope) SetSubnets(subnets infrav1.Subnets)

SetSubnets updates the clusters subnets.

func (*ClusterScope) Subnets

func (s *ClusterScope) Subnets() infrav1.Subnets

Subnets returns the cluster subnets.

func (*ClusterScope) VPC

func (s *ClusterScope) VPC() *infrav1.VPCSpec

VPC returns the cluster VPC.

type ClusterScopeGetter

type ClusterScopeGetter interface {
	ClusterScope(params ClusterScopeParams) (*ClusterScope, error)
}

type ClusterScopeGetterFunc

type ClusterScopeGetterFunc func(params ClusterScopeParams) (*ClusterScope, error)

func (ClusterScopeGetterFunc) ClusterScope

func (f ClusterScopeGetterFunc) ClusterScope(params ClusterScopeParams) (*ClusterScope, error)

type ClusterScopeParams

type ClusterScopeParams struct {
	Client         client.Client
	Logger         logr.Logger
	Cluster        *clusterv1.Cluster
	AWSCluster     *infrav1.AWSCluster
	ControllerName string
	Session        awsclient.ConfigProvider
}

ClusterScopeParams defines the input parameters used to create a new Scope.

type MachineScope

type MachineScope struct {
	logr.Logger

	Cluster    *clusterv1.Cluster
	Machine    *clusterv1.Machine
	AWSCluster *infrav1.AWSCluster
	AWSMachine *infrav1.AWSMachine
	// contains filtered or unexported fields
}

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 reconcile iteration.

func (*MachineScope) AWSMachineIsDeleted added in v0.4.9

func (m *MachineScope) AWSMachineIsDeleted() bool

func (*MachineScope) AdditionalTags added in v0.4.1

func (m *MachineScope) AdditionalTags() infrav1.Tags

AdditionalTags merges AdditionalTags from the scope's AWSCluster and AWSMachine. If the same key is present in both, the value from AWSMachine takes precedence. The returned Tags will never be nil.

func (*MachineScope) Close

func (m *MachineScope) Close() error

Close the MachineScope by updating the machine spec, machine status.

func (*MachineScope) DeleteSecretPrefix added in v0.4.9

func (m *MachineScope) DeleteSecretPrefix()

DeleteSecretPrefix deletes the prefix for the secret belonging to the AWSMachine in AWS Secrets Manager

func (*MachineScope) GetBootstrapData added in v0.4.9

func (m *MachineScope) GetBootstrapData() (string, error)

GetBootstrapData returns the bootstrap data from the secret in the Machine's bootstrap.dataSecretName as base64.

func (*MachineScope) GetInstanceID

func (m *MachineScope) GetInstanceID() *string

GetInstanceID returns the AWSMachine instance id by parsing Spec.ProviderID.

func (*MachineScope) GetInstanceState

func (m *MachineScope) GetInstanceState() *infrav1.InstanceState

GetInstanceID returns the AWSMachine instance state from the status.

func (*MachineScope) GetProviderID

func (m *MachineScope) GetProviderID() string

GetProviderID returns the AWSMachine providerID from the spec.

func (*MachineScope) GetRawBootstrapData added in v0.4.9

func (m *MachineScope) GetRawBootstrapData() ([]byte, error)

GetRawBootstrapData returns the bootstrap data from the secret in the Machine's bootstrap.dataSecretName.

func (*MachineScope) GetSecretCount added in v0.4.9

func (m *MachineScope) GetSecretCount() int32

GetSecretCount returns the number of AWS Secret Manager entries making up the complete userdata

func (*MachineScope) GetSecretPrefix added in v0.4.9

func (m *MachineScope) GetSecretPrefix() string

GetSecretPrefix returns the prefix for the secrets belonging to the AWSMachine in AWS Secrets Manager

func (*MachineScope) HasFailed added in v0.4.9

func (m *MachineScope) HasFailed() bool

func (*MachineScope) InstanceIsInKnownState added in v0.4.9

func (m *MachineScope) InstanceIsInKnownState() bool

func (*MachineScope) InstanceIsOperational added in v0.4.9

func (m *MachineScope) InstanceIsOperational() bool

func (*MachineScope) InstanceIsRunning added in v0.5.4

func (m *MachineScope) InstanceIsRunning() bool

func (*MachineScope) IsControlPlane

func (m *MachineScope) IsControlPlane() bool

IsControlPlane returns true if the machine is a control plane.

func (*MachineScope) Name

func (m *MachineScope) Name() string

Name returns the AWSMachine name.

func (*MachineScope) Namespace

func (m *MachineScope) Namespace() string

Namespace returns the namespace name.

func (*MachineScope) PatchObject added in v0.4.9

func (m *MachineScope) PatchObject() error

PatchObject persists the machine spec and status.

func (*MachineScope) Role

func (m *MachineScope) Role() string

Role returns the machine role from the labels.

func (*MachineScope) SetAddresses added in v0.5.0

func (m *MachineScope) SetAddresses(addrs []clusterv1.MachineAddress)

SetAddresses sets the AWSMachine address status.

func (*MachineScope) SetAnnotation

func (m *MachineScope) SetAnnotation(key, value string)

SetAnnotation sets a key value annotation on the AWSMachine.

func (*MachineScope) SetFailureMessage added in v0.5.0

func (m *MachineScope) SetFailureMessage(v error)

SetFailureMessage sets the AWSMachine status failure message.

func (*MachineScope) SetFailureReason added in v0.5.0

func (m *MachineScope) SetFailureReason(v capierrors.MachineStatusError)

SetFailureReason sets the AWSMachine status failure reason.

func (*MachineScope) SetInstanceState

func (m *MachineScope) SetInstanceState(v infrav1.InstanceState)

SetInstanceID sets the AWSMachine instance id.

func (*MachineScope) SetNotReady added in v0.5.0

func (m *MachineScope) SetNotReady()

SetNotReady sets the AWSMachine Ready Status to false

func (*MachineScope) SetProviderID

func (m *MachineScope) SetProviderID(instanceID, availabilityZone string)

SetProviderID sets the AWSMachine providerID in spec.

func (*MachineScope) SetReady

func (m *MachineScope) SetReady()

SetReady sets the AWSMachine Ready Status

func (*MachineScope) SetSecretCount added in v0.4.9

func (m *MachineScope) SetSecretCount(i int32)

SetSecretCount sets the number of AWS Secret Manager entries making up the complete userdata

func (*MachineScope) SetSecretPrefix added in v0.4.9

func (m *MachineScope) SetSecretPrefix(value string)

SetSecretPrefix sets the prefix for the secrets belonging to the AWSMachine in AWS Secrets Manager

func (*MachineScope) UseSecretsManager added in v0.4.9

func (m *MachineScope) UseSecretsManager() bool

UseSecretsManager returns the computed value of whether or not userdata should be stored using AWS Secrets Manager.

func (*MachineScope) UserDataIsUncompressed added in v0.5.2

func (m *MachineScope) UserDataIsUncompressed() bool

UserDataIsCompressed returns the computed value of whether or not userdata should be compressed using gzip.

type MachineScopeGetter

type MachineScopeGetter interface {
	MachineScope(params MachineScopeParams) (*MachineScope, error)
}

type MachineScopeGetterFunc

type MachineScopeGetterFunc func(params MachineScopeParams) (*MachineScope, error)

func (MachineScopeGetterFunc) MachineScope

func (f MachineScopeGetterFunc) MachineScope(params MachineScopeParams) (*MachineScope, error)

type MachineScopeParams

type MachineScopeParams struct {
	Client     client.Client
	Logger     logr.Logger
	Cluster    *clusterv1.Cluster
	Machine    *clusterv1.Machine
	AWSCluster *infrav1.AWSCluster
	AWSMachine *infrav1.AWSMachine
}

MachineScopeParams defines the input parameters used to create a new MachineScope.

Jump to

Keyboard shortcuts

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