sigs.k8s.io/cluster-api-provider-azure@v1.17.0/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 // NodeResourceGroupName is the name of the resource group 143 // containing cluster IaaS resources. Will be populated to default 144 // in webhook. 145 // Immutable. 146 // +optional 147 NodeResourceGroupName string `json:"nodeResourceGroupName,omitempty"` 148 149 // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. 150 // Immutable, populated by the AKS API at create. 151 // +optional 152 ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint,omitempty"` 153 154 // SSHPublicKey is a string literal containing an ssh public key base64 encoded. 155 // Use empty string to autogenerate new key. Use null value to not set key. 156 // Immutable. 157 // +optional 158 SSHPublicKey *string `json:"sshPublicKey,omitempty"` 159 160 // DNSPrefix allows the user to customize dns prefix. 161 // Immutable. 162 // +optional 163 DNSPrefix *string `json:"dnsPrefix,omitempty"` 164 165 // FleetsMember is the spec for the fleet this cluster is a member of. 166 // See also [AKS doc]. 167 // 168 // [AKS doc]: https://learn.microsoft.com/en-us/azure/templates/microsoft.containerservice/2023-03-15-preview/fleets/members 169 // +optional 170 FleetsMember *FleetsMember `json:"fleetsMember,omitempty"` 171 } 172 173 // ManagedClusterSecurityProfile defines the security profile for the cluster. 174 type ManagedClusterSecurityProfile struct { 175 // AzureKeyVaultKms defines Azure Key Vault Management Services Profile for the security profile. 176 // +optional 177 AzureKeyVaultKms *AzureKeyVaultKms `json:"azureKeyVaultKms,omitempty"` 178 179 // Defender settings for the security profile. 180 // +optional 181 Defender *ManagedClusterSecurityProfileDefender `json:"defender,omitempty"` 182 183 // ImageCleaner settings for the security profile. 184 // +optional 185 ImageCleaner *ManagedClusterSecurityProfileImageCleaner `json:"imageCleaner,omitempty"` 186 187 // Workloadidentity enables Kubernetes applications to access Azure cloud resources securely with Azure AD. Ensure to enable OIDC issuer while enabling Workload Identity 188 // +optional 189 WorkloadIdentity *ManagedClusterSecurityProfileWorkloadIdentity `json:"workloadIdentity,omitempty"` 190 } 191 192 // ManagedClusterSecurityProfileDefender defines Microsoft Defender settings for the security profile. 193 // See also [AKS doc]. 194 // 195 // [AKS doc]: https://learn.microsoft.com/azure/defender-for-cloud/defender-for-containers-enable 196 type ManagedClusterSecurityProfileDefender struct { 197 // LogAnalyticsWorkspaceResourceID is the ID of the Log Analytics workspace that has to be associated with Microsoft Defender. 198 // When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. 199 // +kubebuilder:validation:Required 200 LogAnalyticsWorkspaceResourceID string `json:"logAnalyticsWorkspaceResourceID"` 201 202 // SecurityMonitoring profile defines the Microsoft Defender threat detection for Cloud settings for the security profile. 203 // +kubebuilder:validation:Required 204 SecurityMonitoring ManagedClusterSecurityProfileDefenderSecurityMonitoring `json:"securityMonitoring"` 205 } 206 207 // ManagedClusterSecurityProfileDefenderSecurityMonitoring settings for the security profile threat detection. 208 type ManagedClusterSecurityProfileDefenderSecurityMonitoring struct { 209 // Enabled enables Defender threat detection 210 // +kubebuilder:validation:Required 211 Enabled bool `json:"enabled"` 212 } 213 214 // ManagedClusterSecurityProfileImageCleaner removes unused images from nodes, freeing up disk space and helping to reduce attack surface area. 215 // See also [AKS doc]. 216 // 217 // [AKS doc]: https://learn.microsoft.com/azure/aks/image-cleaner 218 type ManagedClusterSecurityProfileImageCleaner struct { 219 // Enabled enables the Image Cleaner on AKS cluster. 220 // +kubebuilder:validation:Required 221 Enabled bool `json:"enabled"` 222 223 // IntervalHours defines Image Cleaner scanning interval in hours. Default value is 24 hours. 224 // +optional 225 // +kubebuilder:validation:Minimum=24 226 // +kubebuilder:validation:Maximum=2160 227 IntervalHours *int `json:"intervalHours,omitempty"` 228 } 229 230 // ManagedClusterSecurityProfileWorkloadIdentity settings for the security profile. 231 // See also [AKS doc]. 232 // 233 // [AKS doc]: https://learn.microsoft.com/azure/defender-for-cloud/defender-for-containers-enable 234 type ManagedClusterSecurityProfileWorkloadIdentity struct { 235 // Enabled enables the workload identity. 236 // +kubebuilder:validation:Required 237 Enabled bool `json:"enabled"` 238 } 239 240 // AzureKeyVaultKms service settings for the security profile. 241 // See also [AKS doc]. 242 // 243 // [AKS doc]: https://learn.microsoft.com/azure/aks/use-kms-etcd-encryption#update-key-vault-mode 244 type AzureKeyVaultKms struct { 245 // Enabled enables the Azure Key Vault key management service. The default is false. 246 // +kubebuilder:validation:Required 247 Enabled bool `json:"enabled"` 248 249 // KeyID defines the Identifier of Azure Key Vault key. 250 // When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. 251 // +kubebuilder:validation:Required 252 KeyID string `json:"keyID"` 253 254 // KeyVaultNetworkAccess defines the network access of key vault. 255 // The possible values are Public and Private. 256 // Public means the key vault allows public access from all networks. 257 // Private means the key vault disables public access and enables private link. The default value is Public. 258 // +optional 259 // +kubebuilder:default:=Public 260 KeyVaultNetworkAccess *KeyVaultNetworkAccessTypes `json:"keyVaultNetworkAccess,omitempty"` 261 262 // KeyVaultResourceID is the Resource ID of key vault. When keyVaultNetworkAccess is Private, this field is required and must be a valid resource ID. 263 // +optional 264 KeyVaultResourceID *string `json:"keyVaultResourceID,omitempty"` 265 } 266 267 // HTTPProxyConfig is the HTTP proxy configuration for the cluster. 268 type HTTPProxyConfig struct { 269 // HTTPProxy is the HTTP proxy server endpoint to use. 270 // +optional 271 HTTPProxy *string `json:"httpProxy,omitempty"` 272 273 // HTTPSProxy is the HTTPS proxy server endpoint to use. 274 // +optional 275 HTTPSProxy *string `json:"httpsProxy,omitempty"` 276 277 // NoProxy indicates the endpoints that should not go through proxy. 278 // +optional 279 NoProxy []string `json:"noProxy,omitempty"` 280 281 // TrustedCA is the alternative CA cert to use for connecting to proxy servers. 282 // +optional 283 TrustedCA *string `json:"trustedCa,omitempty"` 284 } 285 286 // AADProfile - AAD integration managed by AKS. 287 // See also [AKS doc]. 288 // 289 // [AKS doc]: https://learn.microsoft.com/azure/aks/managed-aad 290 type AADProfile struct { 291 // Managed - Whether to enable managed AAD. 292 // +kubebuilder:validation:Required 293 Managed bool `json:"managed"` 294 295 // AdminGroupObjectIDs - AAD group object IDs that will have admin role of the cluster. 296 // +kubebuilder:validation:Required 297 AdminGroupObjectIDs []string `json:"adminGroupObjectIDs"` 298 } 299 300 // AddonProfile represents a managed cluster add-on. 301 type AddonProfile struct { 302 // Name - The name of the managed cluster add-on. 303 Name string `json:"name"` 304 305 // Config - Key-value pairs for configuring the add-on. 306 // +optional 307 Config map[string]string `json:"config,omitempty"` 308 309 // Enabled - Whether the add-on is enabled or not. 310 Enabled bool `json:"enabled"` 311 } 312 313 // AzureManagedControlPlaneSkuTier - Tier of a managed cluster SKU. 314 // +kubebuilder:validation:Enum=Free;Paid;Standard 315 type AzureManagedControlPlaneSkuTier string 316 317 const ( 318 // FreeManagedControlPlaneTier is the free tier of AKS without corresponding SLAs. 319 FreeManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Free" 320 // PaidManagedControlPlaneTier is the paid tier of AKS with corresponding SLAs. 321 // Deprecated. It has been replaced with StandardManagedControlPlaneTier. 322 PaidManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Paid" 323 // StandardManagedControlPlaneTier is the standard tier of AKS with corresponding SLAs. 324 StandardManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Standard" 325 ) 326 327 // AKSSku - AKS SKU. 328 type AKSSku struct { 329 // Tier - Tier of an AKS cluster. 330 Tier AzureManagedControlPlaneSkuTier `json:"tier"` 331 } 332 333 // LoadBalancerProfile - Profile of the cluster load balancer. 334 // At most one of `managedOutboundIPs`, `outboundIPPrefixes`, or `outboundIPs` may be specified. 335 // See also [AKS doc]. 336 // 337 // [AKS doc]: https://learn.microsoft.com/azure/aks/load-balancer-standard 338 type LoadBalancerProfile struct { 339 // ManagedOutboundIPs - Desired managed outbound IPs for the cluster load balancer. 340 // +optional 341 ManagedOutboundIPs *int `json:"managedOutboundIPs,omitempty"` 342 343 // OutboundIPPrefixes - Desired outbound IP Prefix resources for the cluster load balancer. 344 // +optional 345 OutboundIPPrefixes []string `json:"outboundIPPrefixes,omitempty"` 346 347 // OutboundIPs - Desired outbound IP resources for the cluster load balancer. 348 // +optional 349 OutboundIPs []string `json:"outboundIPs,omitempty"` 350 351 // 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. 352 // +optional 353 AllocatedOutboundPorts *int `json:"allocatedOutboundPorts,omitempty"` 354 355 // 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. 356 // +optional 357 IdleTimeoutInMinutes *int `json:"idleTimeoutInMinutes,omitempty"` 358 } 359 360 // APIServerAccessProfile tunes the accessibility of the cluster's control plane. 361 // See also [AKS doc]. 362 // 363 // [AKS doc]: https://learn.microsoft.com/azure/aks/api-server-authorized-ip-ranges 364 type APIServerAccessProfile struct { 365 // AuthorizedIPRanges - Authorized IP Ranges to kubernetes API server. 366 // +optional 367 AuthorizedIPRanges []string `json:"authorizedIPRanges,omitempty"` 368 369 APIServerAccessProfileClassSpec `json:",inline"` 370 } 371 372 // ManagedControlPlaneVirtualNetwork describes a virtual network required to provision AKS clusters. 373 type ManagedControlPlaneVirtualNetwork struct { 374 // ResourceGroup is the name of the Azure resource group for the VNet and Subnet. 375 // +optional 376 ResourceGroup string `json:"resourceGroup,omitempty"` 377 378 // Name is the name of the virtual network. 379 Name string `json:"name"` 380 381 ManagedControlPlaneVirtualNetworkClassSpec `json:",inline"` 382 } 383 384 // ManagedControlPlaneSubnet describes a subnet for an AKS cluster. 385 type ManagedControlPlaneSubnet struct { 386 Name string `json:"name"` 387 CIDRBlock string `json:"cidrBlock"` 388 389 // ServiceEndpoints is a slice of Virtual Network service endpoints to enable for the subnets. 390 // +optional 391 ServiceEndpoints ServiceEndpoints `json:"serviceEndpoints,omitempty"` 392 393 // PrivateEndpoints is a slice of Virtual Network private endpoints to create for the subnets. 394 // +optional 395 PrivateEndpoints PrivateEndpoints `json:"privateEndpoints,omitempty"` 396 } 397 398 // AzureManagedControlPlaneStatus defines the observed state of AzureManagedControlPlane. 399 type AzureManagedControlPlaneStatus struct { 400 // AutoUpgradeVersion is the Kubernetes version populated after auto-upgrade based on the upgrade channel. 401 // +kubebuilder:validation:MinLength=2 402 // +optional 403 AutoUpgradeVersion string `json:"autoUpgradeVersion,omitempty"` 404 405 // Ready is true when the provider resource is ready. 406 // +optional 407 Ready bool `json:"ready,omitempty"` 408 409 // Initialized is true when the control plane is available for initial contact. 410 // This may occur before the control plane is fully ready. 411 // In the AzureManagedControlPlane implementation, these are identical. 412 // +optional 413 Initialized bool `json:"initialized,omitempty"` 414 415 // Conditions defines current service state of the AzureManagedControlPlane. 416 // +optional 417 Conditions clusterv1.Conditions `json:"conditions,omitempty"` 418 419 // LongRunningOperationStates saves the states for Azure long-running operations so they can be continued on the 420 // next reconciliation loop. 421 // +optional 422 LongRunningOperationStates Futures `json:"longRunningOperationStates,omitempty"` 423 424 // OIDCIssuerProfile is the OIDC issuer profile of the Managed Cluster. 425 // +optional 426 OIDCIssuerProfile *OIDCIssuerProfileStatus `json:"oidcIssuerProfile,omitempty"` 427 428 // Version defines the Kubernetes version for the control plane instance. 429 // +optional 430 Version string `json:"version"` 431 } 432 433 // OIDCIssuerProfileStatus is the OIDC issuer profile of the Managed Cluster. 434 type OIDCIssuerProfileStatus struct { 435 // IssuerURL is the OIDC issuer url of the Managed Cluster. 436 // +optional 437 IssuerURL *string `json:"issuerURL,omitempty"` 438 } 439 440 // AutoScalerProfile parameters to be applied to the cluster-autoscaler. 441 // See also [AKS doc], [K8s doc]. 442 // 443 // [AKS doc]: https://learn.microsoft.com/azure/aks/cluster-autoscaler#use-the-cluster-autoscaler-profile 444 // [K8s doc]: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca 445 type AutoScalerProfile struct { 446 // BalanceSimilarNodeGroups - Valid values are 'true' and 'false'. The default is false. 447 // +kubebuilder:validation:Enum="true";"false" 448 // +optional 449 BalanceSimilarNodeGroups *BalanceSimilarNodeGroups `json:"balanceSimilarNodeGroups,omitempty"` 450 // 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. 451 // +kubebuilder:validation:Enum=least-waste;most-pods;priority;random 452 // +optional 453 Expander *Expander `json:"expander,omitempty"` 454 // MaxEmptyBulkDelete - The default is 10. 455 // +optional 456 MaxEmptyBulkDelete *string `json:"maxEmptyBulkDelete,omitempty"` 457 // MaxGracefulTerminationSec - The default is 600. 458 // +kubebuilder:validation:Pattern=`^(\d+)$` 459 // +optional 460 MaxGracefulTerminationSec *string `json:"maxGracefulTerminationSec,omitempty"` 461 // MaxNodeProvisionTime - The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. 462 // +kubebuilder:validation:Pattern=`^(\d+)m$` 463 // +optional 464 MaxNodeProvisionTime *string `json:"maxNodeProvisionTime,omitempty"` 465 // MaxTotalUnreadyPercentage - The default is 45. The maximum is 100 and the minimum is 0. 466 // +kubebuilder:validation:Pattern=`^(\d+)$` 467 // +kubebuilder:validation:MaxLength=3 468 // +kubebuilder:validation:MinLength=1 469 // +optional 470 MaxTotalUnreadyPercentage *string `json:"maxTotalUnreadyPercentage,omitempty"` 471 // 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). 472 // +optional 473 NewPodScaleUpDelay *string `json:"newPodScaleUpDelay,omitempty"` 474 // OkTotalUnreadyCount - This must be an integer. The default is 3. 475 // +kubebuilder:validation:Pattern=`^(\d+)$` 476 // +optional 477 OkTotalUnreadyCount *string `json:"okTotalUnreadyCount,omitempty"` 478 // ScanInterval - How often cluster is reevaluated for scale up or down. The default is '10s'. 479 // +kubebuilder:validation:Pattern=`^(\d+)s$` 480 // +optional 481 ScanInterval *string `json:"scanInterval,omitempty"` 482 // ScaleDownDelayAfterAdd - The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. 483 // +kubebuilder:validation:Pattern=`^(\d+)m$` 484 // +optional 485 ScaleDownDelayAfterAdd *string `json:"scaleDownDelayAfterAdd,omitempty"` 486 // 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. 487 // +kubebuilder:validation:Pattern=`^(\d+)s$` 488 // +optional 489 ScaleDownDelayAfterDelete *string `json:"scaleDownDelayAfterDelete,omitempty"` 490 // ScaleDownDelayAfterFailure - The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. 491 // +kubebuilder:validation:Pattern=`^(\d+)m$` 492 // +optional 493 ScaleDownDelayAfterFailure *string `json:"scaleDownDelayAfterFailure,omitempty"` 494 // ScaleDownUnneededTime - The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. 495 // +kubebuilder:validation:Pattern=`^(\d+)m$` 496 // +optional 497 ScaleDownUnneededTime *string `json:"scaleDownUnneededTime,omitempty"` 498 // ScaleDownUnreadyTime - The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. 499 // +kubebuilder:validation:Pattern=`^(\d+)m$` 500 // +optional 501 ScaleDownUnreadyTime *string `json:"scaleDownUnreadyTime,omitempty"` 502 // ScaleDownUtilizationThreshold - The default is '0.5'. 503 // +optional 504 ScaleDownUtilizationThreshold *string `json:"scaleDownUtilizationThreshold,omitempty"` 505 // SkipNodesWithLocalStorage - The default is false. 506 // +kubebuilder:validation:Enum="true";"false" 507 // +optional 508 SkipNodesWithLocalStorage *SkipNodesWithLocalStorage `json:"skipNodesWithLocalStorage,omitempty"` 509 // SkipNodesWithSystemPods - The default is true. 510 // +kubebuilder:validation:Enum="true";"false" 511 // +optional 512 SkipNodesWithSystemPods *SkipNodesWithSystemPods `json:"skipNodesWithSystemPods,omitempty"` 513 } 514 515 // BalanceSimilarNodeGroups enumerates the values for BalanceSimilarNodeGroups. 516 type BalanceSimilarNodeGroups string 517 518 const ( 519 // BalanceSimilarNodeGroupsTrue ... 520 BalanceSimilarNodeGroupsTrue BalanceSimilarNodeGroups = "true" 521 // BalanceSimilarNodeGroupsFalse ... 522 BalanceSimilarNodeGroupsFalse BalanceSimilarNodeGroups = "false" 523 ) 524 525 // SkipNodesWithLocalStorage enumerates the values for SkipNodesWithLocalStorage. 526 type SkipNodesWithLocalStorage string 527 528 const ( 529 // SkipNodesWithLocalStorageTrue ... 530 SkipNodesWithLocalStorageTrue SkipNodesWithLocalStorage = "true" 531 // SkipNodesWithLocalStorageFalse ... 532 SkipNodesWithLocalStorageFalse SkipNodesWithLocalStorage = "false" 533 ) 534 535 // SkipNodesWithSystemPods enumerates the values for SkipNodesWithSystemPods. 536 type SkipNodesWithSystemPods string 537 538 const ( 539 // SkipNodesWithSystemPodsTrue ... 540 SkipNodesWithSystemPodsTrue SkipNodesWithSystemPods = "true" 541 // SkipNodesWithSystemPodsFalse ... 542 SkipNodesWithSystemPodsFalse SkipNodesWithSystemPods = "false" 543 ) 544 545 // Expander enumerates the values for Expander. 546 type Expander string 547 548 const ( 549 // ExpanderLeastWaste ... 550 ExpanderLeastWaste Expander = "least-waste" 551 // ExpanderMostPods ... 552 ExpanderMostPods Expander = "most-pods" 553 // ExpanderPriority ... 554 ExpanderPriority Expander = "priority" 555 // ExpanderRandom ... 556 ExpanderRandom Expander = "random" 557 ) 558 559 // Identity represents the Identity configuration for an AKS control plane. 560 // See also [AKS doc]. 561 // 562 // [AKS doc]: https://learn.microsoft.com/en-us/azure/aks/use-managed-identity 563 type Identity struct { 564 // Type - The Identity type to use. 565 // +kubebuilder:validation:Enum=SystemAssigned;UserAssigned 566 // +optional 567 Type ManagedControlPlaneIdentityType `json:"type,omitempty"` 568 569 // UserAssignedIdentityResourceID - Identity ARM resource ID when using user-assigned identity. 570 // +optional 571 UserAssignedIdentityResourceID string `json:"userAssignedIdentityResourceID,omitempty"` 572 } 573 574 // OIDCIssuerProfile is the OIDC issuer profile of the Managed Cluster. 575 // See also [AKS doc]. 576 // 577 // [AKS doc]: https://learn.microsoft.com/en-us/azure/aks/use-oidc-issuer 578 type OIDCIssuerProfile struct { 579 // Enabled is whether the OIDC issuer is enabled. 580 // +optional 581 Enabled *bool `json:"enabled,omitempty"` 582 } 583 584 // AKSExtension represents the configuration for an AKS cluster extension. 585 // See also [AKS doc]. 586 // 587 // [AKS doc]: https://learn.microsoft.com/en-us/azure/aks/cluster-extensions 588 type AKSExtension struct { 589 // Name is the name of the extension. 590 Name string `json:"name"` 591 592 // AKSAssignedIdentityType is the type of the AKS assigned identity. 593 // +optional 594 AKSAssignedIdentityType AKSAssignedIdentity `json:"aksAssignedIdentityType,omitempty"` 595 596 // AutoUpgradeMinorVersion is a flag to note if this extension participates in auto upgrade of minor version, or not. 597 // +kubebuilder:default=true 598 // +optional 599 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 600 601 // ConfigurationSettings are the name-value pairs for configuring this extension. 602 // +optional 603 ConfigurationSettings map[string]string `json:"configurationSettings,omitempty"` 604 605 // ExtensionType is the type of the Extension of which this resource is an instance. 606 // It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. 607 ExtensionType *string `json:"extensionType"` 608 609 // Plan is the plan of the extension. 610 // +optional 611 Plan *ExtensionPlan `json:"plan,omitempty"` 612 613 // ReleaseTrain is the release train this extension participates in for auto-upgrade (e.g. Stable, Preview, etc.) 614 // This is only used if autoUpgradeMinorVersion is ‘true’. 615 // +optional 616 ReleaseTrain *string `json:"releaseTrain,omitempty"` 617 618 // Scope is the scope at which this extension is enabled. 619 // +optional 620 Scope *ExtensionScope `json:"scope,omitempty"` 621 622 // Version is the version of the extension. 623 // +optional 624 Version *string `json:"version,omitempty"` 625 626 // Identity is the identity type of the Extension resource in an AKS cluster. 627 // +optional 628 Identity ExtensionIdentity `json:"identity,omitempty"` 629 } 630 631 // +kubebuilder:object:root=true 632 // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AzureManagedControlPlane belongs" 633 // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" 634 // +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" 635 // +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" 636 // +kubebuilder:printcolumn:name="Message",type="string",priority=1,JSONPath=".status.conditions[?(@.type=='Ready')].message" 637 // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of this AzureManagedControlPlane" 638 // +kubebuilder:resource:path=azuremanagedcontrolplanes,scope=Namespaced,categories=cluster-api,shortName=amcp 639 // +kubebuilder:storageversion 640 // +kubebuilder:subresource:status 641 642 // AzureManagedControlPlane is the Schema for the azuremanagedcontrolplanes API. 643 type AzureManagedControlPlane struct { 644 metav1.TypeMeta `json:",inline"` 645 metav1.ObjectMeta `json:"metadata,omitempty"` 646 647 Spec AzureManagedControlPlaneSpec `json:"spec,omitempty"` 648 Status AzureManagedControlPlaneStatus `json:"status,omitempty"` 649 } 650 651 // +kubebuilder:object:root=true 652 653 // AzureManagedControlPlaneList contains a list of AzureManagedControlPlane. 654 type AzureManagedControlPlaneList struct { 655 metav1.TypeMeta `json:",inline"` 656 metav1.ListMeta `json:"metadata,omitempty"` 657 Items []AzureManagedControlPlane `json:"items"` 658 } 659 660 // GetConditions returns the list of conditions for an AzureManagedControlPlane API object. 661 func (m *AzureManagedControlPlane) GetConditions() clusterv1.Conditions { 662 return m.Status.Conditions 663 } 664 665 // SetConditions will set the given conditions on an AzureManagedControlPlane object. 666 func (m *AzureManagedControlPlane) SetConditions(conditions clusterv1.Conditions) { 667 m.Status.Conditions = conditions 668 } 669 670 // GetFutures returns the list of long running operation states for an AzureManagedControlPlane API object. 671 func (m *AzureManagedControlPlane) GetFutures() Futures { 672 return m.Status.LongRunningOperationStates 673 } 674 675 // SetFutures will set the given long running operation states on an AzureManagedControlPlane object. 676 func (m *AzureManagedControlPlane) SetFutures(futures Futures) { 677 m.Status.LongRunningOperationStates = futures 678 } 679 680 func init() { 681 SchemeBuilder.Register(&AzureManagedControlPlane{}, &AzureManagedControlPlaneList{}) 682 }