sigs.k8s.io/cluster-api-provider-azure@v1.14.3/api/v1beta1/azuremanagedcontrolplane_types.go (about)

     1  /*
     2  Copyright 2023 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package v1beta1
    18  
    19  import (
    20  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    21  	clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
    22  )
    23  
    24  const (
    25  	// ManagedClusterFinalizer allows Reconcile to clean up Azure resources associated with the AzureManagedControlPlane before
    26  	// removing it from the apiserver.
    27  	ManagedClusterFinalizer = "azuremanagedcontrolplane.infrastructure.cluster.x-k8s.io"
    28  
    29  	// PrivateDNSZoneModeSystem represents mode System for azuremanagedcontrolplane.
    30  	PrivateDNSZoneModeSystem string = "System"
    31  
    32  	// PrivateDNSZoneModeNone represents mode None for azuremanagedcontrolplane.
    33  	PrivateDNSZoneModeNone string = "None"
    34  )
    35  
    36  // UpgradeChannel determines the type of upgrade channel for automatically upgrading the cluster.
    37  // See also [AKS doc].
    38  //
    39  // [AKS doc]: https://learn.microsoft.com/en-us/azure/aks/auto-upgrade-cluster
    40  type UpgradeChannel string
    41  
    42  const (
    43  	// UpgradeChannelNodeImage automatically upgrades the node image to the latest version available.
    44  	// Consider using nodeOSUpgradeChannel instead as that allows you to configure node OS patching separate from Kubernetes version patching.
    45  	UpgradeChannelNodeImage UpgradeChannel = "node-image"
    46  
    47  	// UpgradeChannelNone disables auto-upgrades and keeps the cluster at its current version of Kubernetes.
    48  	UpgradeChannelNone UpgradeChannel = "none"
    49  
    50  	// UpgradeChannelPatch automatically upgrades the cluster to the latest supported patch version when it becomes available
    51  	// while keeping the minor version the same. For example, if a cluster is running version 1.17.7 while versions 1.17.9, 1.18.4,
    52  	// 1.18.6, and 1.19.1 are available, the cluster will be upgraded to 1.17.9.
    53  	UpgradeChannelPatch UpgradeChannel = "patch"
    54  
    55  	// UpgradeChannelRapid automatically upgrades the cluster to the latest supported patch release on the latest supported minor
    56  	// version. In cases where the cluster is at a version of Kubernetes that is at an N-2 minor version where N is the latest
    57  	// supported minor version, the cluster first upgrades to the latest supported patch version on N-1 minor version. For example,
    58  	// if a cluster is running version 1.17.7 while versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, the cluster
    59  	// will first be upgraded to 1.18.6 and then to 1.19.1.
    60  	UpgradeChannelRapid UpgradeChannel = "rapid"
    61  
    62  	// UpgradeChannelStable automatically upgrade the cluster to the latest supported patch release on minor version N-1, where
    63  	// N is the latest supported minor version. For example, if a cluster is running version 1.17.7 while versions 1.17.9, 1.18.4,
    64  	// 1.18.6, and 1.19.1 are available, the cluster will be upgraded to 1.18.6.
    65  	UpgradeChannelStable UpgradeChannel = "stable"
    66  )
    67  
    68  // ManagedControlPlaneOutboundType enumerates the values for the managed control plane OutboundType.
    69  type ManagedControlPlaneOutboundType string
    70  
    71  const (
    72  	// ManagedControlPlaneOutboundTypeLoadBalancer ...
    73  	ManagedControlPlaneOutboundTypeLoadBalancer ManagedControlPlaneOutboundType = "loadBalancer"
    74  	// ManagedControlPlaneOutboundTypeManagedNATGateway ...
    75  	ManagedControlPlaneOutboundTypeManagedNATGateway ManagedControlPlaneOutboundType = "managedNATGateway"
    76  	// ManagedControlPlaneOutboundTypeUserAssignedNATGateway ...
    77  	ManagedControlPlaneOutboundTypeUserAssignedNATGateway ManagedControlPlaneOutboundType = "userAssignedNATGateway"
    78  	// ManagedControlPlaneOutboundTypeUserDefinedRouting ...
    79  	ManagedControlPlaneOutboundTypeUserDefinedRouting ManagedControlPlaneOutboundType = "userDefinedRouting"
    80  )
    81  
    82  // ManagedControlPlaneIdentityType enumerates the values for managed control plane identity type.
    83  type ManagedControlPlaneIdentityType string
    84  
    85  const (
    86  	// ManagedControlPlaneIdentityTypeSystemAssigned Use an implicitly created system-assigned managed identity to manage
    87  	// cluster resources. Components in the control plane such as kube-controller-manager will use the
    88  	// system-assigned managed identity to manipulate Azure resources.
    89  	ManagedControlPlaneIdentityTypeSystemAssigned ManagedControlPlaneIdentityType = ManagedControlPlaneIdentityType(VMIdentitySystemAssigned)
    90  	// ManagedControlPlaneIdentityTypeUserAssigned Use a user-assigned identity to manage cluster resources.
    91  	// Components in the control plane such as kube-controller-manager will use the specified user-assigned
    92  	// managed identity to manipulate Azure resources.
    93  	ManagedControlPlaneIdentityTypeUserAssigned ManagedControlPlaneIdentityType = ManagedControlPlaneIdentityType(VMIdentityUserAssigned)
    94  )
    95  
    96  // NetworkPluginMode is the mode the network plugin should use.
    97  type NetworkPluginMode string
    98  
    99  const (
   100  	// NetworkPluginModeOverlay is used with networkPlugin=azure, pods are given IPs from the PodCIDR address space but use Azure
   101  	// Routing Domains rather than Kubenet's method of route tables.
   102  	// See also [AKS doc].
   103  	//
   104  	// [AKS doc]: https://aka.ms/aks/azure-cni-overlay
   105  	NetworkPluginModeOverlay NetworkPluginMode = "overlay"
   106  )
   107  
   108  // NetworkDataplaneType is the type of network dataplane to use.
   109  type NetworkDataplaneType string
   110  
   111  const (
   112  	// NetworkDataplaneTypeAzure is the Azure network dataplane type.
   113  	NetworkDataplaneTypeAzure NetworkDataplaneType = "azure"
   114  	// NetworkDataplaneTypeCilium is the Cilium network dataplane type.
   115  	NetworkDataplaneTypeCilium NetworkDataplaneType = "cilium"
   116  )
   117  
   118  const (
   119  	// LoadBalancerSKUStandard is the Standard load balancer SKU.
   120  	LoadBalancerSKUStandard = "Standard"
   121  	// LoadBalancerSKUBasic is the Basic load balancer SKU.
   122  	LoadBalancerSKUBasic = "Basic"
   123  )
   124  
   125  // KeyVaultNetworkAccessTypes defines the types of network access of key vault.
   126  // The possible values are Public and Private.
   127  // The default value is Public.
   128  type KeyVaultNetworkAccessTypes string
   129  
   130  const (
   131  	// KeyVaultNetworkAccessTypesPrivate means the key vault disables public access and enables private link.
   132  	KeyVaultNetworkAccessTypesPrivate KeyVaultNetworkAccessTypes = "Private"
   133  
   134  	// KeyVaultNetworkAccessTypesPublic means the key vault allows public access from all networks.
   135  	KeyVaultNetworkAccessTypesPublic KeyVaultNetworkAccessTypes = "Public"
   136  )
   137  
   138  // AzureManagedControlPlaneSpec defines the desired state of AzureManagedControlPlane.
   139  type AzureManagedControlPlaneSpec struct {
   140  	AzureManagedControlPlaneClassSpec `json:",inline"`
   141  
   142  	// ResourceGroupName is the name of the Azure resource group for this AKS Cluster.
   143  	// Immutable.
   144  	ResourceGroupName string `json:"resourceGroupName"`
   145  
   146  	// NodeResourceGroupName is the name of the resource group
   147  	// containing cluster IaaS resources. Will be populated to default
   148  	// in webhook.
   149  	// Immutable.
   150  	// +optional
   151  	NodeResourceGroupName string `json:"nodeResourceGroupName,omitempty"`
   152  
   153  	// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
   154  	// Immutable, populated by the AKS API at create.
   155  	// +optional
   156  	ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint,omitempty"`
   157  
   158  	// SSHPublicKey is a string literal containing an ssh public key base64 encoded.
   159  	// Use empty string to autogenerate new key. Use null value to not set key.
   160  	// Immutable.
   161  	// +optional
   162  	SSHPublicKey *string `json:"sshPublicKey,omitempty"`
   163  
   164  	// DNSPrefix allows the user to customize dns prefix.
   165  	// Immutable.
   166  	// +optional
   167  	DNSPrefix *string `json:"dnsPrefix,omitempty"`
   168  
   169  	// FleetsMember is the spec for the fleet this cluster is a member of.
   170  	// See also [AKS doc].
   171  	//
   172  	// [AKS doc]: https://learn.microsoft.com/en-us/azure/templates/microsoft.containerservice/2023-03-15-preview/fleets/members
   173  	// +optional
   174  	FleetsMember *FleetsMember `json:"fleetsMember,omitempty"`
   175  }
   176  
   177  // ManagedClusterSecurityProfile defines the security profile for the cluster.
   178  type ManagedClusterSecurityProfile struct {
   179  	// AzureKeyVaultKms defines Azure Key Vault Management Services Profile for the security profile.
   180  	// +optional
   181  	AzureKeyVaultKms *AzureKeyVaultKms `json:"azureKeyVaultKms,omitempty"`
   182  
   183  	// Defender settings for the security profile.
   184  	// +optional
   185  	Defender *ManagedClusterSecurityProfileDefender `json:"defender,omitempty"`
   186  
   187  	// ImageCleaner settings for the security profile.
   188  	// +optional
   189  	ImageCleaner *ManagedClusterSecurityProfileImageCleaner `json:"imageCleaner,omitempty"`
   190  
   191  	// Workloadidentity enables Kubernetes applications to access Azure cloud resources securely with Azure AD. Ensure to enable OIDC issuer while enabling Workload Identity
   192  	// +optional
   193  	WorkloadIdentity *ManagedClusterSecurityProfileWorkloadIdentity `json:"workloadIdentity,omitempty"`
   194  }
   195  
   196  // ManagedClusterSecurityProfileDefender defines Microsoft Defender settings for the security profile.
   197  // See also [AKS doc].
   198  //
   199  // [AKS doc]: https://learn.microsoft.com/azure/defender-for-cloud/defender-for-containers-enable
   200  type ManagedClusterSecurityProfileDefender struct {
   201  	// LogAnalyticsWorkspaceResourceID is the ID of the Log Analytics workspace that has to be associated with Microsoft Defender.
   202  	// When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID.
   203  	// +kubebuilder:validation:Required
   204  	LogAnalyticsWorkspaceResourceID string `json:"logAnalyticsWorkspaceResourceID"`
   205  
   206  	// SecurityMonitoring profile defines the Microsoft Defender threat detection for Cloud settings for the security profile.
   207  	// +kubebuilder:validation:Required
   208  	SecurityMonitoring ManagedClusterSecurityProfileDefenderSecurityMonitoring `json:"securityMonitoring"`
   209  }
   210  
   211  // ManagedClusterSecurityProfileDefenderSecurityMonitoring settings for the security profile threat detection.
   212  type ManagedClusterSecurityProfileDefenderSecurityMonitoring struct {
   213  	// Enabled enables Defender threat detection
   214  	// +kubebuilder:validation:Required
   215  	Enabled bool `json:"enabled"`
   216  }
   217  
   218  // ManagedClusterSecurityProfileImageCleaner removes unused images from nodes, freeing up disk space and helping to reduce attack surface area.
   219  // See also [AKS doc].
   220  //
   221  // [AKS doc]: https://learn.microsoft.com/azure/aks/image-cleaner
   222  type ManagedClusterSecurityProfileImageCleaner struct {
   223  	// Enabled enables the Image Cleaner on AKS cluster.
   224  	// +kubebuilder:validation:Required
   225  	Enabled bool `json:"enabled"`
   226  
   227  	// IntervalHours defines Image Cleaner scanning interval in hours. Default value is 24 hours.
   228  	// +optional
   229  	// +kubebuilder:validation:Minimum=24
   230  	// +kubebuilder:validation:Maximum=2160
   231  	IntervalHours *int `json:"intervalHours,omitempty"`
   232  }
   233  
   234  // ManagedClusterSecurityProfileWorkloadIdentity settings for the security profile.
   235  // See also [AKS doc].
   236  //
   237  // [AKS doc]: https://learn.microsoft.com/azure/defender-for-cloud/defender-for-containers-enable
   238  type ManagedClusterSecurityProfileWorkloadIdentity struct {
   239  	// Enabled enables the workload identity.
   240  	// +kubebuilder:validation:Required
   241  	Enabled bool `json:"enabled"`
   242  }
   243  
   244  // AzureKeyVaultKms service settings for the security profile.
   245  // See also [AKS doc].
   246  //
   247  // [AKS doc]: https://learn.microsoft.com/azure/aks/use-kms-etcd-encryption#update-key-vault-mode
   248  type AzureKeyVaultKms struct {
   249  	// Enabled enables the Azure Key Vault key management service. The default is false.
   250  	// +kubebuilder:validation:Required
   251  	Enabled bool `json:"enabled"`
   252  
   253  	// KeyID defines the Identifier of Azure Key Vault key.
   254  	// When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier.
   255  	// +kubebuilder:validation:Required
   256  	KeyID string `json:"keyID"`
   257  
   258  	// KeyVaultNetworkAccess defines the network access of key vault.
   259  	// The possible values are Public and Private.
   260  	// Public means the key vault allows public access from all networks.
   261  	// Private means the key vault disables public access and enables private link. The default value is Public.
   262  	// +optional
   263  	// +kubebuilder:default:=Public
   264  	KeyVaultNetworkAccess *KeyVaultNetworkAccessTypes `json:"keyVaultNetworkAccess,omitempty"`
   265  
   266  	// KeyVaultResourceID is the Resource ID of key vault. When keyVaultNetworkAccess is Private, this field is required and must be a valid resource ID.
   267  	// +optional
   268  	KeyVaultResourceID *string `json:"keyVaultResourceID,omitempty"`
   269  }
   270  
   271  // HTTPProxyConfig is the HTTP proxy configuration for the cluster.
   272  type HTTPProxyConfig struct {
   273  	// HTTPProxy is the HTTP proxy server endpoint to use.
   274  	// +optional
   275  	HTTPProxy *string `json:"httpProxy,omitempty"`
   276  
   277  	// HTTPSProxy is the HTTPS proxy server endpoint to use.
   278  	// +optional
   279  	HTTPSProxy *string `json:"httpsProxy,omitempty"`
   280  
   281  	// NoProxy indicates the endpoints that should not go through proxy.
   282  	// +optional
   283  	NoProxy []string `json:"noProxy,omitempty"`
   284  
   285  	// TrustedCA is the alternative CA cert to use for connecting to proxy servers.
   286  	// +optional
   287  	TrustedCA *string `json:"trustedCa,omitempty"`
   288  }
   289  
   290  // AADProfile - AAD integration managed by AKS.
   291  // See also [AKS doc].
   292  //
   293  // [AKS doc]: https://learn.microsoft.com/azure/aks/managed-aad
   294  type AADProfile struct {
   295  	// Managed - Whether to enable managed AAD.
   296  	// +kubebuilder:validation:Required
   297  	Managed bool `json:"managed"`
   298  
   299  	// AdminGroupObjectIDs - AAD group object IDs that will have admin role of the cluster.
   300  	// +kubebuilder:validation:Required
   301  	AdminGroupObjectIDs []string `json:"adminGroupObjectIDs"`
   302  }
   303  
   304  // AddonProfile represents a managed cluster add-on.
   305  type AddonProfile struct {
   306  	// Name - The name of the managed cluster add-on.
   307  	Name string `json:"name"`
   308  
   309  	// Config - Key-value pairs for configuring the add-on.
   310  	// +optional
   311  	Config map[string]string `json:"config,omitempty"`
   312  
   313  	// Enabled - Whether the add-on is enabled or not.
   314  	Enabled bool `json:"enabled"`
   315  }
   316  
   317  // AzureManagedControlPlaneSkuTier - Tier of a managed cluster SKU.
   318  // +kubebuilder:validation:Enum=Free;Paid;Standard
   319  type AzureManagedControlPlaneSkuTier string
   320  
   321  const (
   322  	// FreeManagedControlPlaneTier is the free tier of AKS without corresponding SLAs.
   323  	FreeManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Free"
   324  	// PaidManagedControlPlaneTier is the paid tier of AKS with corresponding SLAs.
   325  	// Deprecated. It has been replaced with StandardManagedControlPlaneTier.
   326  	PaidManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Paid"
   327  	// StandardManagedControlPlaneTier is the standard tier of AKS with corresponding SLAs.
   328  	StandardManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Standard"
   329  )
   330  
   331  // AKSSku - AKS SKU.
   332  type AKSSku struct {
   333  	// Tier - Tier of an AKS cluster.
   334  	Tier AzureManagedControlPlaneSkuTier `json:"tier"`
   335  }
   336  
   337  // LoadBalancerProfile - Profile of the cluster load balancer.
   338  // At most one of `managedOutboundIPs`, `outboundIPPrefixes`, or `outboundIPs` may be specified.
   339  // See also [AKS doc].
   340  //
   341  // [AKS doc]: https://learn.microsoft.com/azure/aks/load-balancer-standard
   342  type LoadBalancerProfile struct {
   343  	// ManagedOutboundIPs - Desired managed outbound IPs for the cluster load balancer.
   344  	// +optional
   345  	ManagedOutboundIPs *int `json:"managedOutboundIPs,omitempty"`
   346  
   347  	// OutboundIPPrefixes - Desired outbound IP Prefix resources for the cluster load balancer.
   348  	// +optional
   349  	OutboundIPPrefixes []string `json:"outboundIPPrefixes,omitempty"`
   350  
   351  	// OutboundIPs - Desired outbound IP resources for the cluster load balancer.
   352  	// +optional
   353  	OutboundIPs []string `json:"outboundIPs,omitempty"`
   354  
   355  	// AllocatedOutboundPorts - Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports.
   356  	// +optional
   357  	AllocatedOutboundPorts *int `json:"allocatedOutboundPorts,omitempty"`
   358  
   359  	// IdleTimeoutInMinutes - Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes.
   360  	// +optional
   361  	IdleTimeoutInMinutes *int `json:"idleTimeoutInMinutes,omitempty"`
   362  }
   363  
   364  // APIServerAccessProfile tunes the accessibility of the cluster's control plane.
   365  // See also [AKS doc].
   366  //
   367  // [AKS doc]: https://learn.microsoft.com/azure/aks/api-server-authorized-ip-ranges
   368  type APIServerAccessProfile struct {
   369  	// AuthorizedIPRanges - Authorized IP Ranges to kubernetes API server.
   370  	// +optional
   371  	AuthorizedIPRanges []string `json:"authorizedIPRanges,omitempty"`
   372  
   373  	APIServerAccessProfileClassSpec `json:",inline"`
   374  }
   375  
   376  // ManagedControlPlaneVirtualNetwork describes a virtual network required to provision AKS clusters.
   377  type ManagedControlPlaneVirtualNetwork struct {
   378  	// ResourceGroup is the name of the Azure resource group for the VNet and Subnet.
   379  	// +optional
   380  	ResourceGroup string `json:"resourceGroup,omitempty"`
   381  
   382  	ManagedControlPlaneVirtualNetworkClassSpec `json:",inline"`
   383  }
   384  
   385  // ManagedControlPlaneSubnet describes a subnet for an AKS cluster.
   386  type ManagedControlPlaneSubnet struct {
   387  	Name      string `json:"name"`
   388  	CIDRBlock string `json:"cidrBlock"`
   389  
   390  	// ServiceEndpoints is a slice of Virtual Network service endpoints to enable for the subnets.
   391  	// +optional
   392  	ServiceEndpoints ServiceEndpoints `json:"serviceEndpoints,omitempty"`
   393  
   394  	// PrivateEndpoints is a slice of Virtual Network private endpoints to create for the subnets.
   395  	// +optional
   396  	PrivateEndpoints PrivateEndpoints `json:"privateEndpoints,omitempty"`
   397  }
   398  
   399  // AzureManagedControlPlaneStatus defines the observed state of AzureManagedControlPlane.
   400  type AzureManagedControlPlaneStatus struct {
   401  	// AutoUpgradeVersion is the Kubernetes version populated after auto-upgrade based on the upgrade channel.
   402  	// +kubebuilder:validation:MinLength=2
   403  	// +optional
   404  	AutoUpgradeVersion string `json:"autoUpgradeVersion,omitempty"`
   405  
   406  	// Ready is true when the provider resource is ready.
   407  	// +optional
   408  	Ready bool `json:"ready,omitempty"`
   409  
   410  	// Initialized is true when the control plane is available for initial contact.
   411  	// This may occur before the control plane is fully ready.
   412  	// In the AzureManagedControlPlane implementation, these are identical.
   413  	// +optional
   414  	Initialized bool `json:"initialized,omitempty"`
   415  
   416  	// Conditions defines current service state of the AzureManagedControlPlane.
   417  	// +optional
   418  	Conditions clusterv1.Conditions `json:"conditions,omitempty"`
   419  
   420  	// LongRunningOperationStates saves the states for Azure long-running operations so they can be continued on the
   421  	// next reconciliation loop.
   422  	// +optional
   423  	LongRunningOperationStates Futures `json:"longRunningOperationStates,omitempty"`
   424  
   425  	// OIDCIssuerProfile is the OIDC issuer profile of the Managed Cluster.
   426  	// +optional
   427  	OIDCIssuerProfile *OIDCIssuerProfileStatus `json:"oidcIssuerProfile,omitempty"`
   428  
   429  	// Version defines the Kubernetes version for the control plane instance.
   430  	// +optional
   431  	Version string `json:"version"`
   432  }
   433  
   434  // OIDCIssuerProfileStatus is the OIDC issuer profile of the Managed Cluster.
   435  type OIDCIssuerProfileStatus struct {
   436  	// IssuerURL is the OIDC issuer url of the Managed Cluster.
   437  	// +optional
   438  	IssuerURL *string `json:"issuerURL,omitempty"`
   439  }
   440  
   441  // AutoScalerProfile parameters to be applied to the cluster-autoscaler.
   442  // See also [AKS doc], [K8s doc].
   443  //
   444  // [AKS doc]: https://learn.microsoft.com/azure/aks/cluster-autoscaler#use-the-cluster-autoscaler-profile
   445  // [K8s doc]: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca
   446  type AutoScalerProfile struct {
   447  	// BalanceSimilarNodeGroups - Valid values are 'true' and 'false'. The default is false.
   448  	// +kubebuilder:validation:Enum="true";"false"
   449  	// +optional
   450  	BalanceSimilarNodeGroups *BalanceSimilarNodeGroups `json:"balanceSimilarNodeGroups,omitempty"`
   451  	// Expander - If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information.
   452  	// +kubebuilder:validation:Enum=least-waste;most-pods;priority;random
   453  	// +optional
   454  	Expander *Expander `json:"expander,omitempty"`
   455  	// MaxEmptyBulkDelete - The default is 10.
   456  	// +optional
   457  	MaxEmptyBulkDelete *string `json:"maxEmptyBulkDelete,omitempty"`
   458  	// MaxGracefulTerminationSec - The default is 600.
   459  	// +kubebuilder:validation:Pattern=`^(\d+)$`
   460  	// +optional
   461  	MaxGracefulTerminationSec *string `json:"maxGracefulTerminationSec,omitempty"`
   462  	// MaxNodeProvisionTime - The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.
   463  	// +kubebuilder:validation:Pattern=`^(\d+)m$`
   464  	// +optional
   465  	MaxNodeProvisionTime *string `json:"maxNodeProvisionTime,omitempty"`
   466  	// MaxTotalUnreadyPercentage - The default is 45. The maximum is 100 and the minimum is 0.
   467  	// +kubebuilder:validation:Pattern=`^(\d+)$`
   468  	// +kubebuilder:validation:MaxLength=3
   469  	// +kubebuilder:validation:MinLength=1
   470  	// +optional
   471  	MaxTotalUnreadyPercentage *string `json:"maxTotalUnreadyPercentage,omitempty"`
   472  	// NewPodScaleUpDelay - For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc).
   473  	// +optional
   474  	NewPodScaleUpDelay *string `json:"newPodScaleUpDelay,omitempty"`
   475  	// OkTotalUnreadyCount - This must be an integer. The default is 3.
   476  	// +kubebuilder:validation:Pattern=`^(\d+)$`
   477  	// +optional
   478  	OkTotalUnreadyCount *string `json:"okTotalUnreadyCount,omitempty"`
   479  	// ScanInterval - How often cluster is reevaluated for scale up or down. The default is '10s'.
   480  	// +kubebuilder:validation:Pattern=`^(\d+)s$`
   481  	// +optional
   482  	ScanInterval *string `json:"scanInterval,omitempty"`
   483  	// ScaleDownDelayAfterAdd - The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.
   484  	// +kubebuilder:validation:Pattern=`^(\d+)m$`
   485  	// +optional
   486  	ScaleDownDelayAfterAdd *string `json:"scaleDownDelayAfterAdd,omitempty"`
   487  	// ScaleDownDelayAfterDelete - The default is the scan-interval. Values must be an integer followed by an 's'. No unit of time other than seconds (s) is supported.
   488  	// +kubebuilder:validation:Pattern=`^(\d+)s$`
   489  	// +optional
   490  	ScaleDownDelayAfterDelete *string `json:"scaleDownDelayAfterDelete,omitempty"`
   491  	// ScaleDownDelayAfterFailure - The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.
   492  	// +kubebuilder:validation:Pattern=`^(\d+)m$`
   493  	// +optional
   494  	ScaleDownDelayAfterFailure *string `json:"scaleDownDelayAfterFailure,omitempty"`
   495  	// ScaleDownUnneededTime - The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.
   496  	// +kubebuilder:validation:Pattern=`^(\d+)m$`
   497  	// +optional
   498  	ScaleDownUnneededTime *string `json:"scaleDownUnneededTime,omitempty"`
   499  	// ScaleDownUnreadyTime - The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.
   500  	// +kubebuilder:validation:Pattern=`^(\d+)m$`
   501  	// +optional
   502  	ScaleDownUnreadyTime *string `json:"scaleDownUnreadyTime,omitempty"`
   503  	// ScaleDownUtilizationThreshold - The default is '0.5'.
   504  	// +optional
   505  	ScaleDownUtilizationThreshold *string `json:"scaleDownUtilizationThreshold,omitempty"`
   506  	// SkipNodesWithLocalStorage - The default is false.
   507  	// +kubebuilder:validation:Enum="true";"false"
   508  	// +optional
   509  	SkipNodesWithLocalStorage *SkipNodesWithLocalStorage `json:"skipNodesWithLocalStorage,omitempty"`
   510  	// SkipNodesWithSystemPods - The default is true.
   511  	// +kubebuilder:validation:Enum="true";"false"
   512  	// +optional
   513  	SkipNodesWithSystemPods *SkipNodesWithSystemPods `json:"skipNodesWithSystemPods,omitempty"`
   514  }
   515  
   516  // BalanceSimilarNodeGroups enumerates the values for BalanceSimilarNodeGroups.
   517  type BalanceSimilarNodeGroups string
   518  
   519  const (
   520  	// BalanceSimilarNodeGroupsTrue ...
   521  	BalanceSimilarNodeGroupsTrue BalanceSimilarNodeGroups = "true"
   522  	// BalanceSimilarNodeGroupsFalse ...
   523  	BalanceSimilarNodeGroupsFalse BalanceSimilarNodeGroups = "false"
   524  )
   525  
   526  // SkipNodesWithLocalStorage enumerates the values for SkipNodesWithLocalStorage.
   527  type SkipNodesWithLocalStorage string
   528  
   529  const (
   530  	// SkipNodesWithLocalStorageTrue ...
   531  	SkipNodesWithLocalStorageTrue SkipNodesWithLocalStorage = "true"
   532  	// SkipNodesWithLocalStorageFalse ...
   533  	SkipNodesWithLocalStorageFalse SkipNodesWithLocalStorage = "false"
   534  )
   535  
   536  // SkipNodesWithSystemPods enumerates the values for SkipNodesWithSystemPods.
   537  type SkipNodesWithSystemPods string
   538  
   539  const (
   540  	// SkipNodesWithSystemPodsTrue ...
   541  	SkipNodesWithSystemPodsTrue SkipNodesWithSystemPods = "true"
   542  	// SkipNodesWithSystemPodsFalse ...
   543  	SkipNodesWithSystemPodsFalse SkipNodesWithSystemPods = "false"
   544  )
   545  
   546  // Expander enumerates the values for Expander.
   547  type Expander string
   548  
   549  const (
   550  	// ExpanderLeastWaste ...
   551  	ExpanderLeastWaste Expander = "least-waste"
   552  	// ExpanderMostPods ...
   553  	ExpanderMostPods Expander = "most-pods"
   554  	// ExpanderPriority ...
   555  	ExpanderPriority Expander = "priority"
   556  	// ExpanderRandom ...
   557  	ExpanderRandom Expander = "random"
   558  )
   559  
   560  // Identity represents the Identity configuration for an AKS control plane.
   561  // See also [AKS doc].
   562  //
   563  // [AKS doc]: https://learn.microsoft.com/en-us/azure/aks/use-managed-identity
   564  type Identity struct {
   565  	// Type - The Identity type to use.
   566  	// +kubebuilder:validation:Enum=SystemAssigned;UserAssigned
   567  	// +optional
   568  	Type ManagedControlPlaneIdentityType `json:"type,omitempty"`
   569  
   570  	// UserAssignedIdentityResourceID - Identity ARM resource ID when using user-assigned identity.
   571  	// +optional
   572  	UserAssignedIdentityResourceID string `json:"userAssignedIdentityResourceID,omitempty"`
   573  }
   574  
   575  // OIDCIssuerProfile is the OIDC issuer profile of the Managed Cluster.
   576  // See also [AKS doc].
   577  //
   578  // [AKS doc]: https://learn.microsoft.com/en-us/azure/aks/use-oidc-issuer
   579  type OIDCIssuerProfile struct {
   580  	// Enabled is whether the OIDC issuer is enabled.
   581  	// +optional
   582  	Enabled *bool `json:"enabled,omitempty"`
   583  }
   584  
   585  // AKSExtension represents the configuration for an AKS cluster extension.
   586  // See also [AKS doc].
   587  //
   588  // [AKS doc]: https://learn.microsoft.com/en-us/azure/aks/cluster-extensions
   589  type AKSExtension struct {
   590  	// Name is the name of the extension.
   591  	Name string `json:"name"`
   592  
   593  	// AKSAssignedIdentityType is the type of the AKS assigned identity.
   594  	// +optional
   595  	AKSAssignedIdentityType AKSAssignedIdentity `json:"aksAssignedIdentityType,omitempty"`
   596  
   597  	// AutoUpgradeMinorVersion is a flag to note if this extension participates in auto upgrade of minor version, or not.
   598  	// +kubebuilder:default=true
   599  	// +optional
   600  	AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"`
   601  
   602  	// ConfigurationSettings are the name-value pairs for configuring this extension.
   603  	// +optional
   604  	ConfigurationSettings map[string]string `json:"configurationSettings,omitempty"`
   605  
   606  	// ExtensionType is the type of the Extension of which this resource is an instance.
   607  	// It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher.
   608  	ExtensionType *string `json:"extensionType"`
   609  
   610  	// Plan is the plan of the extension.
   611  	// +optional
   612  	Plan *ExtensionPlan `json:"plan,omitempty"`
   613  
   614  	// ReleaseTrain is the release train this extension participates in for auto-upgrade (e.g. Stable, Preview, etc.)
   615  	// This is only used if autoUpgradeMinorVersion is ‘true’.
   616  	// +optional
   617  	ReleaseTrain *string `json:"releaseTrain,omitempty"`
   618  
   619  	// Scope is the scope at which this extension is enabled.
   620  	// +optional
   621  	Scope *ExtensionScope `json:"scope,omitempty"`
   622  
   623  	// Version is the version of the extension.
   624  	// +optional
   625  	Version *string `json:"version,omitempty"`
   626  
   627  	// Identity is the identity type of the Extension resource in an AKS cluster.
   628  	// +optional
   629  	Identity ExtensionIdentity `json:"identity,omitempty"`
   630  }
   631  
   632  // +kubebuilder:object:root=true
   633  // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AzureManagedControlPlane belongs"
   634  // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
   635  // +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
   636  // +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
   637  // +kubebuilder:printcolumn:name="Message",type="string",priority=1,JSONPath=".status.conditions[?(@.type=='Ready')].message"
   638  // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of this AzureManagedControlPlane"
   639  // +kubebuilder:resource:path=azuremanagedcontrolplanes,scope=Namespaced,categories=cluster-api,shortName=amcp
   640  // +kubebuilder:storageversion
   641  // +kubebuilder:subresource:status
   642  
   643  // AzureManagedControlPlane is the Schema for the azuremanagedcontrolplanes API.
   644  type AzureManagedControlPlane struct {
   645  	metav1.TypeMeta   `json:",inline"`
   646  	metav1.ObjectMeta `json:"metadata,omitempty"`
   647  
   648  	Spec   AzureManagedControlPlaneSpec   `json:"spec,omitempty"`
   649  	Status AzureManagedControlPlaneStatus `json:"status,omitempty"`
   650  }
   651  
   652  // +kubebuilder:object:root=true
   653  
   654  // AzureManagedControlPlaneList contains a list of AzureManagedControlPlane.
   655  type AzureManagedControlPlaneList struct {
   656  	metav1.TypeMeta `json:",inline"`
   657  	metav1.ListMeta `json:"metadata,omitempty"`
   658  	Items           []AzureManagedControlPlane `json:"items"`
   659  }
   660  
   661  // GetConditions returns the list of conditions for an AzureManagedControlPlane API object.
   662  func (m *AzureManagedControlPlane) GetConditions() clusterv1.Conditions {
   663  	return m.Status.Conditions
   664  }
   665  
   666  // SetConditions will set the given conditions on an AzureManagedControlPlane object.
   667  func (m *AzureManagedControlPlane) SetConditions(conditions clusterv1.Conditions) {
   668  	m.Status.Conditions = conditions
   669  }
   670  
   671  // GetFutures returns the list of long running operation states for an AzureManagedControlPlane API object.
   672  func (m *AzureManagedControlPlane) GetFutures() Futures {
   673  	return m.Status.LongRunningOperationStates
   674  }
   675  
   676  // SetFutures will set the given long running operation states on an AzureManagedControlPlane object.
   677  func (m *AzureManagedControlPlane) SetFutures(futures Futures) {
   678  	m.Status.LongRunningOperationStates = futures
   679  }
   680  
   681  func init() {
   682  	SchemeBuilder.Register(&AzureManagedControlPlane{}, &AzureManagedControlPlaneList{})
   683  }