infrastructure

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LabelAreaID is the label key used to identify Shoots that are SNA-enabled.
	LabelAreaID = "stackit.cloud/area-id"
)

Variables

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

StatusTypeMeta is the TypeMeta of the InfrastructureStatus

Functions

func CleanupKubernetesLoadbalancers

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

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

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

func InjectConfig

func InjectConfig(config *stackitv1alpha1.Networks, snaConfig *SNAConfig)

func IsSNAShoot

func IsSNAShoot(labels map[string]string) bool

isSNAShoot determines if a Shoot is in fact SNA-enabled based on its labels. For this to be true, the areaID label value must be non-empty.

func PatchProviderStatusAndState

func PatchProviderStatusAndState(
	ctx context.Context,
	runtimeClient client.Client,
	infra *extensionsv1alpha1.Infrastructure,
	status *stackitv1alpha1.InfrastructureStatus,
	nodesCIDR *string,
	state *runtime.RawExtension,
) error

PatchProviderStatusAndState patches the infrastructure status with the given provider specific status and state.

func WorkersCIDR

func WorkersCIDR(config *stackitv1alpha1.InfrastructureConfig) string

WorkersCIDR determines the Workers CIDR from the given InfrastructureConfig.

Types

type SNAConfig

type SNAConfig struct {
	NetworkID   string
	RouterID    string
	SubnetID    string
	WorkersCIDR string
}

SNAConfig contains relevant values for SNA clusters that can be determined using the provided Network ID.

func GetSNAConfigFromNetworkID

func GetSNAConfigFromNetworkID(ctx context.Context, networking osclient.Networking, networkID *string) (*SNAConfig, error)

Jump to

Keyboard shortcuts

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