infrastructure

package
v1.51.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0, MIT Imports: 38 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"
	// 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(ctx context.Context, mgr manager.Manager) error

AddToManager adds a controller with the default AddOptions.

func AddToManagerWithOptions

func AddToManagerWithOptions(ctx context.Context, 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 NewActuator

func NewActuator(mgr manager.Manager, machineImageOwnerSecretRef *corev1.SecretReference, toBeSharedImageIDs []string, disableProjectedTokenMount bool) (infrastructure.Actuator, error)

NewActuator instantiates an actuator with the default dependencies.

func NewActuatorWithDeps

func NewActuatorWithDeps(
	mgr manager.Manager,
	newClientFactory alicloudclient.ClientFactory,
	terraformerFactory terraformer.Factory,
	terraformChartOps TerraformChartOps,
	machineImageOwnerSecretRef *corev1.SecretReference,
	toBeSharedImageIDs []string,
	disableProjectedTokenMount bool,
) (infrastructure.Actuator, error)

NewActuatorWithDeps instantiates an actuator with the given dependencies.

func NewConfigValidator added in v1.51.0

func NewConfigValidator(mgr manager.Manager, logger logr.Logger, factory aliclient.Factory) infrastructure.ConfigValidator

NewConfigValidator creates a new ConfigValidator.

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
	// MachineImageOwnerSecretRef is the secret reference which contains credential of AliCloud subaccount for customized images.
	MachineImageOwnerSecretRef *corev1.SecretReference
	// ToBeSharedImageIDs specifies custom image IDs which need to be shared by shoots
	ToBeSharedImageIDs []string
	// DisableProjectedTokenMount specifies whether the projected token mount shall be disabled for the terraformer.
	// Used for testing only.
	DisableProjectedTokenMount bool
}

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

type EIP added in v1.22.0

type EIP struct {
	InternetChargeType string
}

EIP contains values of EIP used to render terraform charts

type InitializerValues

type InitializerValues struct {
	VPC        VPC
	NATGateway NATGateway
	EIP        EIP
}

InitializerValues are values used to render a terraform initializer chart.

type NATGateway added in v1.22.0

type NATGateway struct {
	CreateNATGateway bool
	NATGatewayID     string
	SNATTableIDs     string
}

NATGateway contains values of NATGateway used to render terraform charts.

type TerraformChartOps

type TerraformChartOps interface {
	ComputeCreateVPCInitializerValues(config *v1alpha1.InfrastructureConfig, internetChargeType string) *InitializerValues
	ComputeUseVPCInitializerValues(config *v1alpha1.InfrastructureConfig, info *alicloudclient.VPCInfo) *InitializerValues
	ComputeChartValues(infra *extensionsv1alpha1.Infrastructure, config *v1alpha1.InfrastructureConfig, podCIDR *string, 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 VPC added in v1.22.0

type VPC struct {
	CreateVPC bool
	VPCID     string
	VPCCIDR   string
}

VPC contains values of VPC used to render terraform charts.

Directories

Path Synopsis
aliclient/mock
Package aliclient is a generated GoMock package.
Package aliclient is a generated GoMock package.

Jump to

Keyboard shortcuts

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