infrastructure

package
v0.0.0-...-60d224e Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0, MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TerraformerPurpose is the Terraformer purpose for infrastructure operations.
	TerraformerPurpose = "infra"

	// TerraformerOutputKeyVPCID is the output key of the VPC ID.
	TerraformerOutputKeyVPCID = "vpc_id"
	// TerraformerOutputKeyVPCCIDR is the output key of the VPC CIDR.
	TerraformerOutputKeyVPCCIDR = "vpc_cidr"
	// TerraformerOutputKeySecurityGroupID is the output key of the security group ID.
	TerraformerOutputKeySecurityGroupID = "sg_id"
	// TerraformerOutputKeyKeyPairName is the output key of the key pair name.
	TerraformerOutputKeyKeyPairName = "key_pair_name"
	// TerraformerOutputKeyVSwitchNodesPrefix is the prefix for the vswitches.
	TerraformerOutputKeyVSwitchNodesPrefix = "vswitch_id_z"

	// TerraformDefaultVPCID is the default value for the VPC ID in the chart.
	TerraformDefaultVPCID = "${alicloud_vpc.vpc.id}"
	// TerraformDefaultNATGatewayID is the default value for the NAT gateway ID in the chart.
	TerraformDefaultNATGatewayID = "${alicloud_nat_gateway.nat_gateway.id}"
	// TerraformDefaultSNATTableIDs is the default value for the SNAT table IDs in the chart.
	TerraformDefaultSNATTableIDs = "${alicloud_nat_gateway.nat_gateway.snat_table_ids}"
)

Variables

View Source
var (
	// DefaultAddOptions are the default AddOptions for AddToManager.
	DefaultAddOptions = AddOptions{}
)
View Source
var StatusTypeMeta = func() metav1.TypeMeta {
	apiVersion, kind := alicloudv1alpha1.SchemeGroupVersion.WithKind(extensioncontroller.UnsafeGuessKind(&alicloudv1alpha1.InfrastructureStatus{})).ToAPIVersionAndKind()
	return metav1.TypeMeta{
		APIVersion: apiVersion,
		Kind:       kind,
	}
}()

StatusTypeMeta is the TypeMeta of InfrastructureStatus.

Functions

func AddToManager

func AddToManager(mgr manager.Manager) error

AddToManager adds a controller with the default AddOptions.

func AddToManagerWithOptions

func AddToManagerWithOptions(mgr manager.Manager, options AddOptions) error

AddToManagerWithOptions adds a controller with the given AddOptions to the given manager. The opts.Reconciler is being set with a newly instantiated actuator.

func FetchEIPInternetChargeType

func FetchEIPInternetChargeType(vpcClient alicloudclient.VPC, vpcID string) (string, error)

FetchEIPInternetChargeType fetches the internet charge type for the VPC's EIP.

func NewActuator

func NewActuator() infrastructure.Actuator

NewActuator instantiates an actuator with the default dependencies.

func NewActuatorWithDeps

func NewActuatorWithDeps(
	logger logr.Logger,
	alicloudClientFactory alicloudclient.Factory,
	terraformerFactory extensionsterraformer.Factory,
	chartRendererFactory extensionschartrenderer.Factory,
	terraformChartOps TerraformChartOps,
) infrastructure.Actuator

NewActuatorWithDeps instantiates an actuator with the given dependencies.

Types

type AddOptions

type AddOptions struct {
	// Controller are the controller.Options.
	Controller controller.Options
	// IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not.
	IgnoreOperationAnnotation bool
}

AddOptions are options to apply when adding the infrastructure controller to the manager.

type InitializerValues

type InitializerValues struct {
	CreateVPC          bool
	VPCID              string
	VPCCIDR            string
	NATGatewayID       string
	SNATTableIDs       string
	InternetChargeType string
}

InitializerValues are values used to render a terraform initializer chart.

type TerraformChartOps

type TerraformChartOps interface {
	ComputeCreateVPCInitializerValues(config *v1alpha1.InfrastructureConfig, internetChargeType string) *InitializerValues
	ComputeUseVPCInitializerValues(config *v1alpha1.InfrastructureConfig, info *VPCInfo) *InitializerValues
	ComputeChartValues(infra *extensionsv1alpha1.Infrastructure, config *v1alpha1.InfrastructureConfig, values *InitializerValues) map[string]interface{}
}

TerraformChartOps are operations to do for interfacing with Terraform charts.

func DefaultTerraformOps

func DefaultTerraformOps() TerraformChartOps

DefaultTerraformOps returns the default TerraformChartOps.

type VPCInfo

type VPCInfo struct {
	CIDR               string
	NATGatewayID       string
	SNATTableIDs       string
	InternetChargeType string
}

VPCInfo contains info about an existing VPC.

func GetVPCInfo

func GetVPCInfo(vpcClient alicloudclient.VPC, vpcID string) (*VPCInfo, error)

GetVPCInfo gets info of an existing VPC.

Jump to

Keyboard shortcuts

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