resourcehelpers

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package resourcehelpers provides helper functions for working with Azure resources in AKS MCP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLoadBalancerIDsFromAKS

func GetLoadBalancerIDsFromAKS(
	ctx context.Context,
	cluster *armcontainerservice.ManagedCluster,
	client *azureclient.AzureClient,
) ([]string, error)

GetLoadBalancerIDsFromAKS extracts all load balancer IDs from an AKS cluster. It looks for load balancers in the node resource group that match the AKS cluster naming convention. AKS clusters can have multiple load balancers (e.g., kubernetes, kubernetes-internal).

func GetNSGIDFromAKS

func GetNSGIDFromAKS(
	ctx context.Context,
	cluster *armcontainerservice.ManagedCluster,
	client *azureclient.AzureClient,
) (string, error)

GetNSGIDFromAKS attempts to find a network security group associated with an AKS cluster. It first checks if a subnet is associated with the AKS cluster, then looks for an NSG attached to that subnet. If no NSG is found, it returns an empty string.

func GetPrivateEndpointIDFromAKS added in v0.0.3

func GetPrivateEndpointIDFromAKS(
	ctx context.Context,
	cluster *armcontainerservice.ManagedCluster,
	client *azureclient.AzureClient,
) (string, error)

GetPrivateEndpointIDFromAKS attempts to find the private endpoint associated with an AKS cluster. It looks for a private endpoint named "kube-apiserver" in the cluster's node resource group. Returns empty string if no private endpoint is found (indicating a non-private cluster).

func GetRouteTableIDFromAKS

func GetRouteTableIDFromAKS(
	ctx context.Context,
	cluster *armcontainerservice.ManagedCluster,
	client *azureclient.AzureClient,
) (string, error)

GetRouteTableIDFromAKS attempts to find a route table associated with an AKS cluster. It first checks if a subnet is associated with the AKS cluster, then looks for a route table attached to that subnet. If no route table is found, it returns an empty string and no error (this is a valid state).

func GetSubnetIDFromAKS

func GetSubnetIDFromAKS(ctx context.Context, cluster *armcontainerservice.ManagedCluster, client *azureclient.AzureClient) (string, error)

GetSubnetIDFromAKS extracts subnet ID from an AKS cluster. It tries to get the subnet ID from the agent pool profiles first. If not found, it will try to find the VNet in the node resource group, and then look for a subnet with the name 'aks-subnet' or use the first subnet if not found.

func GetVNetIDFromAKS

func GetVNetIDFromAKS(
	ctx context.Context,
	cluster *armcontainerservice.ManagedCluster,
	client *azureclient.AzureClient,
) (string, error)

GetVNetIDFromAKS extracts the virtual network ID from an AKS cluster. It first checks the agent pool profiles for subnet IDs. If no subnet ID is found, it attempts to look up the VNet in the node resource group.

Types

This section is empty.

Jump to

Keyboard shortcuts

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