infrastructure

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TerraformerPurpose is a constant for the complete Terraform setup with purpose 'infrastructure'.
	TerraformerPurpose = "infra"
	// TerraformOutputKeySSHKeyName key for accessing SSH key name from outputs in terraform
	TerraformOutputKeySSHKeyName = "key_name"
	// TerraformOutputKeyRouterID is the id the router between provider network and the worker subnet.
	TerraformOutputKeyRouterID = "router_id"
	// TerraformOutputKeyNetworkID is the private worker network.
	TerraformOutputKeyNetworkID = "network_id"
	// TerraformOutputKeySecurityGroupID is the id of worker security group.
	TerraformOutputKeySecurityGroupID = "security_group_id"
	// TerraformOutputKeySecurityGroupName is the name of the worker security group.
	TerraformOutputKeySecurityGroupName = "security_group_name"
	// TerraformOutputKeyFloatingNetworkID is the id of the provider network.
	TerraformOutputKeyFloatingNetworkID = "floating_network_id"
	// TerraformOutputKeyFloatingSubnetID is the id of the floating pool network subnet.
	TerraformOutputKeyFloatingSubnetID = "floating_subnet_id"
	// TerraformOutputKeySubnetID is the id of the worker subnet.
	TerraformOutputKeySubnetID = "subnet_id"
	// DefaultRouterID is the computed router ID as generated by terraform.
	DefaultRouterID = "openstack_networking_router_v2.router.id"
)

Variables

View Source
var StatusTypeMeta = metav1.TypeMeta{
	APIVersion: apiv1alpha1.SchemeGroupVersion.String(),
	Kind:       "InfrastructureStatus",
}

StatusTypeMeta is the TypeMeta of the GCP InfrastructureStatus

Functions

func ComputeStatus

ComputeStatus computes the status based on the Terraformer and the given InfrastructureConfig.

func ComputeTerraformerChartValues

func ComputeTerraformerChartValues(
	infra *extensionsv1alpha1.Infrastructure,
	credentials *openstack.Credentials,
	config *api.InfrastructureConfig,
	cluster *controller.Cluster,
) (map[string]interface{}, error)

ComputeTerraformerChartValues computes the values for the OpenStack Terraformer chart.

func GetCredentialsFromInfrastructure

func GetCredentialsFromInfrastructure(ctx context.Context, c client.Client, config *extensionsv1alpha1.Infrastructure) (*openstack.Credentials, error)

GetCredentialsFromInfrastructure retrieves the ServiceAccount from the Secret referenced in the given Infrastructure.

func StatusFromTerraformState

func StatusFromTerraformState(state *TerraformState) *apiv1alpha1.InfrastructureStatus

StatusFromTerraformState computes an InfrastructureStatus from the given Terraform variables.

Types

type TerraformFiles

type TerraformFiles struct {
	Main      string
	Variables string
	TFVars    []byte
}

TerraformFiles are the files that have been rendered from the infrastructure chart.

func RenderTerraformerChart

func RenderTerraformerChart(
	renderer chartrenderer.Interface,
	infra *extensionsv1alpha1.Infrastructure,
	credentials *openstack.Credentials,
	config *api.InfrastructureConfig,
	cluster *controller.Cluster,
) (*TerraformFiles, error)

RenderTerraformerChart renders the openstack-infra chart with the given values.

type TerraformState

type TerraformState struct {
	// SSHKeyName key for accessing SSH key name from outputs in terraform
	SSHKeyName string
	// RouterID is the id the router between provider network and the worker subnet.
	RouterID string
	// NetworkID is the private worker network.
	NetworkID string
	// SubnetID is the id of the worker subnet.
	SubnetID string
	// FloatingNetworkID is the id of the provider network.
	FloatingNetworkID string
	// FloatingPoolSubnetID is the id of the floating pool network subnet.
	FloatingPoolSubnetID string
	// SecurityGroupID is the id of worker security group.
	SecurityGroupID string
	// SecurityGroupName is the name of the worker security group.
	SecurityGroupName string
}

TerraformState is the Terraform state for an infrastructure.

func ExtractTerraformState

func ExtractTerraformState(ctx context.Context, tf terraformer.Terraformer, config *api.InfrastructureConfig) (*TerraformState, error)

ExtractTerraformState extracts the TerraformState from the given Terraformer.

Jump to

Keyboard shortcuts

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