infrastructure

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0, MIT Imports: 24 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"
	// TerraformOutputKeyRouterIP is the ip address of the router.
	TerraformOutputKeyRouterIP = "router_ip"
	// TerraformOutputKeyNetworkID is the private worker network.
	TerraformOutputKeyNetworkID = "network_id"
	// TerraformOutputKeyNetworkName is the private worker network name.
	TerraformOutputKeyNetworkName = "network_name"
	// 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"
	// TerraformOutputKeySubnetID is the id of the worker subnet.
	TerraformOutputKeySubnetID = "subnet_id"
	// TerraformOutputKeyShareNetworkID is the share network.
	TerraformOutputKeyShareNetworkID = "share_network_id"
	// TerraformOutputKeyShareNetworkName is the share network name.
	TerraformOutputKeyShareNetworkName = "share_network_name"

	// DefaultRouterID is the computed router ID as generated by terraform.
	DefaultRouterID = "openstack_networking_router_v2.router.id"
	// MaxApiCallRetries sets the maximum retries for failed requests.
	MaxApiCallRetries = "10"
)

Variables

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

StatusTypeMeta is the TypeMeta of the GCP InfrastructureStatus

Functions

func CleanupKubernetesLoadbalancers added in v1.36.0

func CleanupKubernetesLoadbalancers(ctx context.Context, log logr.Logger, client openstackclient.Loadbalancing, subnetID, clusterName string) error

CleanupKubernetesLoadbalancers cleans loadbalancers that could prevent shoot deletion from proceeding. Particularly it tries to prevent orphan ports from blocking subnet deletion. It filters for LBs that bear the "kube_service" prefix along with the cluster name. Note that this deletion may still leave some leftover resources like the floating IPs. This is intentional because the users may want to preserve them but without the k8s service object we cannot decide that - therefore the floating IPs will be untouched.

func CleanupKubernetesRoutes added in v1.30.2

func CleanupKubernetesRoutes(_ context.Context, client openstackclient.Networking, routerID, workers string) error

CleanupKubernetesRoutes deletes all routes from the router which have a nextHop in the subnet.

func ComputeStatus

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

func ComputeTerraformerTemplateValues added in v1.20.0

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

ComputeTerraformerTemplateValues computes the values for the OpenStack Terraformer chart.

func StatusFromTerraformState

func StatusFromTerraformState(state *TerraformState) *apiv1alpha1.InfrastructureStatus

StatusFromTerraformState computes an InfrastructureStatus from the given Terraform variables.

func WorkersCIDR added in v1.30.3

func WorkersCIDR(config *openstack.InfrastructureConfig) string

WorkersCIDR determines the Workers CIDR from the given InfrastructureConfig.

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 RenderTerraformerTemplate added in v1.20.0

func RenderTerraformerTemplate(
	infra *extensionsv1alpha1.Infrastructure,
	config *api.InfrastructureConfig,
	cluster *controller.Cluster,
) (*TerraformFiles, error)

RenderTerraformerTemplate renders the openstack infrastructure templates 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
	// RouterIP is the ip address of the router.
	RouterIP string
	// NetworkID is the private worker network.
	NetworkID string
	// NetworkName is the private worker network name.
	NetworkName string
	// SubnetID is the id of the worker subnet.
	SubnetID string
	// FloatingNetworkID is the id of the provider network.
	FloatingNetworkID string
	// SecurityGroupID is the id of worker security group.
	SecurityGroupID string
	// SecurityGroupName is the name of the worker security group.
	SecurityGroupName string
	// ShareNetworkID is the optional share network ID.
	ShareNetworkID string
	// ShareNetworkName is the optional share network name.
	ShareNetworkName 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