Documentation ¶
Index ¶
- Constants
- Variables
- func ComputeTerraformStatus(ctx context.Context, tf terraformer.Terraformer, ...) (*apiv1alpha1.InfrastructureStatus, error)
- func ComputeTerraformerTemplateValues(infra *extensionsv1alpha1.Infrastructure, config *api.InfrastructureConfig, ...) (map[string]interface{}, error)
- func DeleteNodeSubnetIfExists(ctx context.Context, factory azureclient.Factory, ...) error
- func DeleteShootResourceGroupIfExists(ctx context.Context, factory azureclient.Factory, ...) error
- func EgressCidrs(terraformState *terraformer.RawState) ([]string, error)
- func IsPrimaryAvailabilitySetRequired(infra *extensionsv1alpha1.Infrastructure, config *api.InfrastructureConfig, ...) (bool, error)
- func IsShootResourceGroupAvailable(ctx context.Context, factory azureclient.Factory, ...) (bool, error)
- func MakeCluster(pods, services string, region string, ...) *controller.Cluster
- func PatchProviderStatusAndState(ctx context.Context, runtimeClient client.Client, ...) error
- func ShootResourceGroupName(infra *extensionsv1alpha1.Infrastructure, cfg *api.InfrastructureConfig, ...) string
- func StatusFromTerraformState(config *api.InfrastructureConfig, tfState *TerraformState) *apiv1alpha1.InfrastructureStatus
- type InfrastructureState
- type TerraformFiles
- type TerraformState
Constants ¶
const ( // TerraformerPurpose is the terraformer infrastructure purpose. TerraformerPurpose = "infra" // TerraformerOutputKeyResourceGroupName is the key for the resourceGroupName output TerraformerOutputKeyResourceGroupName = "resourceGroupName" // TerraformerOutputKeyVNetName is the key for the vnetName output TerraformerOutputKeyVNetName = "vnetName" // TerraformerOutputKeyVNetResourceGroup is the key for the vnetResourceGroup output TerraformerOutputKeyVNetResourceGroup = "vnetResourceGroup" // TerraformerOutputKeySubnetName is the key for the subnetName output TerraformerOutputKeySubnetName = "subnetName" // TerraformerOutputKeySubnetNamePrefix is the key for the subnetName output TerraformerOutputKeySubnetNamePrefix = "subnetName-z" // TerraformerOutputKeyAvailabilitySetID is the key for the availabilitySetID output TerraformerOutputKeyAvailabilitySetID = "availabilitySetID" // TerraformerOutputKeyAvailabilitySetName is the key for the availabilitySetName output TerraformerOutputKeyAvailabilitySetName = "availabilitySetName" // TerraformerOutputKeyCountFaultDomains is the key for the fault domain count output. TerraformerOutputKeyCountFaultDomains = "countFaultDomains" // TerraformerOutputKeyCountUpdateDomains is the key for the update domain count output. TerraformerOutputKeyCountUpdateDomains = "countUpdateDomains" // TerraformerOutputKeyRouteTableName is the key for the routeTableName output TerraformerOutputKeyRouteTableName = "routeTableName" // TerraformerOutputKeySecurityGroupName is the key for the securityGroupName output TerraformerOutputKeySecurityGroupName = "securityGroupName" // TerraformerOutputKeyIdentityID is the key for the identityID output TerraformerOutputKeyIdentityID = "identityID" // TerraformerOutputKeyIdentityClientID is the key for the identityClientID output TerraformerOutputKeyIdentityClientID = "identityClientID" )
Variables ¶
var StatusTypeMeta = metav1.TypeMeta{ APIVersion: apiv1alpha1.SchemeGroupVersion.String(), Kind: "InfrastructureStatus", }
StatusTypeMeta is the TypeMeta of the Azure InfrastructureStatus
Functions ¶
func ComputeTerraformStatus ¶ added in v1.40.0
func ComputeTerraformStatus(ctx context.Context, tf terraformer.Terraformer, infra *extensionsv1alpha1.Infrastructure, config *api.InfrastructureConfig, cluster *controller.Cluster) (*apiv1alpha1.InfrastructureStatus, error)
ComputeTerraformStatus computes the status based on the Terraformer and the given InfrastructureConfig.
func ComputeTerraformerTemplateValues ¶ added in v1.21.0
func ComputeTerraformerTemplateValues( infra *extensionsv1alpha1.Infrastructure, config *api.InfrastructureConfig, cluster *controller.Cluster, ) ( map[string]interface{}, error, )
ComputeTerraformerTemplateValues computes the values for the Azure Terraformer chart.
func DeleteNodeSubnetIfExists ¶ added in v1.28.0
func DeleteNodeSubnetIfExists(ctx context.Context, factory azureclient.Factory, infra *extensionsv1alpha1.Infrastructure, infraConfig *api.InfrastructureConfig) error
DeleteNodeSubnetIfExists will delete the nodes subnet(s) if exists.
func DeleteShootResourceGroupIfExists ¶ added in v1.42.3
func DeleteShootResourceGroupIfExists(ctx context.Context, factory azureclient.Factory, infra *extensionsv1alpha1.Infrastructure, cfg *api.InfrastructureConfig, status *api.InfrastructureStatus) error
DeleteShootResourceGroupIfExists will delete the shoot's resource group if it exists.
func EgressCidrs ¶ added in v1.45.0
func EgressCidrs(terraformState *terraformer.RawState) ([]string, error)
EgressCidrs retrieves the Egress CIDRs from the Terraform state and returns them.
func IsPrimaryAvailabilitySetRequired ¶ added in v1.40.0
func IsPrimaryAvailabilitySetRequired(infra *extensionsv1alpha1.Infrastructure, config *api.InfrastructureConfig, cluster *controller.Cluster) (bool, error)
IsPrimaryAvailabilitySetRequired determines if a cluster primary AvailabilitySet is required.
func IsShootResourceGroupAvailable ¶ added in v1.28.0
func IsShootResourceGroupAvailable(ctx context.Context, factory azureclient.Factory, infra *extensionsv1alpha1.Infrastructure, infraConfig *api.InfrastructureConfig) (bool, error)
IsShootResourceGroupAvailable determines if the managed resource group exists on Azure.
func MakeCluster ¶ added in v1.40.0
func MakeCluster(pods, services string, region string, countFaultDomain, countUpdateDomain int32) *controller.Cluster
MakeCluster returns a cluster object used for testing.
func PatchProviderStatusAndState ¶ added in v1.44.0
func PatchProviderStatusAndState( ctx context.Context, runtimeClient client.Client, infra *extensionsv1alpha1.Infrastructure, status *apiv1alpha1.InfrastructureStatus, state *runtime.RawExtension, egressCidrs []string, ) error
PatchProviderStatusAndState patches the infrastructure resource with the given provider status and state.
func ShootResourceGroupName ¶ added in v1.42.3
func ShootResourceGroupName(infra *extensionsv1alpha1.Infrastructure, cfg *api.InfrastructureConfig, status *api.InfrastructureStatus) string
ShootResourceGroupName returns the expected name of the resource group.
func StatusFromTerraformState ¶
func StatusFromTerraformState(config *api.InfrastructureConfig, tfState *TerraformState) *apiv1alpha1.InfrastructureStatus
StatusFromTerraformState computes an InfrastructureStatus from the given Terraform variables.
Types ¶
type InfrastructureState ¶ added in v1.40.0
type InfrastructureState struct { // SavedProviderStatus contains the infrastructure's ProviderStatus. SavedProviderStatus *runtime.RawExtension `json:"savedProviderStatus,omitempty"` // TerraformState contains the state of the last applied terraform config. TerraformState *runtime.RawExtension `json:"terraformState,omitempty"` }
InfrastructureState represents the last known State of an Infrastructure resource. It is saved after a reconciliation and used during restore operations.
func (*InfrastructureState) ToRawExtension ¶ added in v1.40.0
func (i *InfrastructureState) ToRawExtension() (*runtime.RawExtension, error)
ToRawExtension marshalls the struct and returns a runtime.RawExtension.
type TerraformFiles ¶
TerraformFiles are the files that have been rendered from the infrastructure chart.
func RenderTerraformerTemplate ¶ added in v1.21.0
func RenderTerraformerTemplate( infra *extensionsv1alpha1.Infrastructure, config *api.InfrastructureConfig, cluster *controller.Cluster, ) ( *TerraformFiles, error, )
RenderTerraformerTemplate renders the azure infrastructure template with the given values.
type TerraformState ¶
type TerraformState struct { // VPCName is the name of the VNet created for an infrastructure. VNetName string // VNetResourceGroupName is the name of the resource group where the vnet is deployed to. VNetResourceGroupName string // ResourceGroupName is the name of the resource group. ResourceGroupName string // AvailabilitySetID is the ID for the created availability set. AvailabilitySetID string // CountFaultDomains is the fault domain count for the created availability set. CountFaultDomains int // CountUpdateDomains is the update domain count for the created availability set. CountUpdateDomains int // AvailabilitySetName the ID for the created availability set . AvailabilitySetName string // Subnets contain information to identify the created subnets. Subnets []terraformSubnet // RouteTableName is the name of the route table. RouteTableName string // SecuritGroupName is the name of the security group. SecurityGroupName string // IdentityID is the id of the identity. IdentityID string // IdentityClientID is the client id of the identity. IdentityClientID string }
TerraformState is the Terraform state for an infrastructure.
func ExtractTerraformState ¶
func ExtractTerraformState(ctx context.Context, tf terraformer.Terraformer, infra *extensionsv1alpha1.Infrastructure, config *api.InfrastructureConfig, cluster *controller.Cluster) (*TerraformState, error)
ExtractTerraformState extracts the TerraformState from the given Terraformer.