sigs.k8s.io/cluster-api-provider-azure@v1.14.3/api/v1beta1/azuremanagedmachinepool_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  	capierrors "sigs.k8s.io/cluster-api/errors"
    23  )
    24  
    25  const (
    26  	// LabelAgentPoolMode represents mode of an agent pool. Possible values include: System, User.
    27  	LabelAgentPoolMode = "azuremanagedmachinepool.infrastructure.cluster.x-k8s.io/agentpoolmode"
    28  
    29  	// NodePoolModeSystem represents mode system for azuremachinepool.
    30  	NodePoolModeSystem NodePoolMode = "System"
    31  
    32  	// NodePoolModeUser represents mode user for azuremachinepool.
    33  	NodePoolModeUser NodePoolMode = "User"
    34  
    35  	// DefaultOSType represents the default operating system for azmachinepool.
    36  	DefaultOSType string = LinuxOS
    37  )
    38  
    39  // NodePoolMode enumerates the values for agent pool mode.
    40  type NodePoolMode string
    41  
    42  // CPUManagerPolicy enumerates the values for KubeletConfig.CPUManagerPolicy.
    43  type CPUManagerPolicy string
    44  
    45  const (
    46  	// CPUManagerPolicyNone ...
    47  	CPUManagerPolicyNone CPUManagerPolicy = "none"
    48  	// CPUManagerPolicyStatic ...
    49  	CPUManagerPolicyStatic CPUManagerPolicy = "static"
    50  )
    51  
    52  // TopologyManagerPolicy enumerates the values for KubeletConfig.TopologyManagerPolicy.
    53  type TopologyManagerPolicy string
    54  
    55  // KubeletDiskType enumerates the values for the agent pool's KubeletDiskType.
    56  type KubeletDiskType string
    57  
    58  const (
    59  	// KubeletDiskTypeOS ...
    60  	KubeletDiskTypeOS KubeletDiskType = "OS"
    61  	// KubeletDiskTypeTemporary ...
    62  	KubeletDiskTypeTemporary KubeletDiskType = "Temporary"
    63  )
    64  
    65  const (
    66  	// TopologyManagerPolicyNone ...
    67  	TopologyManagerPolicyNone TopologyManagerPolicy = "none"
    68  	// TopologyManagerPolicyBestEffort ...
    69  	TopologyManagerPolicyBestEffort TopologyManagerPolicy = "best-effort"
    70  	// TopologyManagerPolicyRestricted ...
    71  	TopologyManagerPolicyRestricted TopologyManagerPolicy = "restricted"
    72  	// TopologyManagerPolicySingleNumaNode ...
    73  	TopologyManagerPolicySingleNumaNode TopologyManagerPolicy = "single-numa-node"
    74  )
    75  
    76  // TransparentHugePageOption enumerates the values for various modes of Transparent Hugepages.
    77  type TransparentHugePageOption string
    78  
    79  const (
    80  	// TransparentHugePageOptionAlways ...
    81  	TransparentHugePageOptionAlways TransparentHugePageOption = "always"
    82  
    83  	// TransparentHugePageOptionMadvise ...
    84  	TransparentHugePageOptionMadvise TransparentHugePageOption = "madvise"
    85  
    86  	// TransparentHugePageOptionNever ...
    87  	TransparentHugePageOptionNever TransparentHugePageOption = "never"
    88  
    89  	// TransparentHugePageOptionDefer ...
    90  	TransparentHugePageOptionDefer TransparentHugePageOption = "defer"
    91  
    92  	// TransparentHugePageOptionDeferMadvise ...
    93  	TransparentHugePageOptionDeferMadvise TransparentHugePageOption = "defer+madvise"
    94  )
    95  
    96  // KubeletConfig defines the supported subset of kubelet configurations for nodes in pools.
    97  // See also [AKS doc], [K8s doc].
    98  //
    99  // [AKS doc]: https://learn.microsoft.com/azure/aks/custom-node-configuration
   100  // [K8s doc]: https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/
   101  type KubeletConfig struct {
   102  	// CPUManagerPolicy - CPU Manager policy to use.
   103  	// +kubebuilder:validation:Enum=none;static
   104  	// +optional
   105  	CPUManagerPolicy *CPUManagerPolicy `json:"cpuManagerPolicy,omitempty"`
   106  	// CPUCfsQuota - Enable CPU CFS quota enforcement for containers that specify CPU limits.
   107  	// +optional
   108  	CPUCfsQuota *bool `json:"cpuCfsQuota,omitempty"`
   109  	// CPUCfsQuotaPeriod - Sets CPU CFS quota period value.
   110  	// Must end in "ms", e.g. "100ms"
   111  	// +optional
   112  	CPUCfsQuotaPeriod *string `json:"cpuCfsQuotaPeriod,omitempty"`
   113  	// ImageGcHighThreshold - The percent of disk usage after which image garbage collection is always run.
   114  	// Valid values are 0-100 (inclusive).
   115  	// +kubebuilder:validation:Minimum=0
   116  	// +kubebuilder:validation:Maximum=100
   117  	// +optional
   118  	ImageGcHighThreshold *int `json:"imageGcHighThreshold,omitempty"`
   119  	// ImageGcLowThreshold - The percent of disk usage before which image garbage collection is never run.
   120  	// Valid values are 0-100 (inclusive) and must be less than `imageGcHighThreshold`.
   121  	// +kubebuilder:validation:Minimum=0
   122  	// +kubebuilder:validation:Maximum=100
   123  	// +optional
   124  	ImageGcLowThreshold *int `json:"imageGcLowThreshold,omitempty"`
   125  	// TopologyManagerPolicy - Topology Manager policy to use.
   126  	// +kubebuilder:validation:Enum=none;best-effort;restricted;single-numa-node
   127  	// +optional
   128  	TopologyManagerPolicy *TopologyManagerPolicy `json:"topologyManagerPolicy,omitempty"`
   129  	// AllowedUnsafeSysctls - Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in `*`).
   130  	// Valid values match `kernel.shm*`, `kernel.msg*`, `kernel.sem`, `fs.mqueue.*`, or `net.*`.
   131  	// +optional
   132  	AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty"`
   133  	// FailSwapOn - If set to true it will make the Kubelet fail to start if swap is enabled on the node.
   134  	// +optional
   135  	FailSwapOn *bool `json:"failSwapOn,omitempty"`
   136  	// ContainerLogMaxSizeMB - The maximum size in MB of a container log file before it is rotated.
   137  	// +optional
   138  	ContainerLogMaxSizeMB *int `json:"containerLogMaxSizeMB,omitempty"`
   139  	// ContainerLogMaxFiles - The maximum number of container log files that can be present for a container. The number must be ≥ 2.
   140  	// +kubebuilder:validation:Minimum=2
   141  	// +optional
   142  	ContainerLogMaxFiles *int `json:"containerLogMaxFiles,omitempty"`
   143  	// PodMaxPids - The maximum number of processes per pod.
   144  	// Must not exceed kernel PID limit. -1 disables the limit.
   145  	// +kubebuilder:validation:Minimum=-1
   146  	// +optional
   147  	PodMaxPids *int `json:"podMaxPids,omitempty"`
   148  }
   149  
   150  // SysctlConfig specifies the settings for Linux agent nodes.
   151  type SysctlConfig struct {
   152  	// FsAioMaxNr specifies the maximum number of system-wide asynchronous io requests.
   153  	// Valid values are 65536-6553500 (inclusive).
   154  	// Maps to fs.aio-max-nr.
   155  	// +kubebuilder:validation:Minimum=65536
   156  	// +kubebuilder:validation:Maximum=6553500
   157  	// +optional
   158  	FsAioMaxNr *int `json:"fsAioMaxNr,omitempty"`
   159  
   160  	// FsFileMax specifies the max number of file-handles that the Linux kernel will allocate, by increasing increases the maximum number of open files permitted.
   161  	// Valid values are 8192-12000500 (inclusive).
   162  	// Maps to fs.file-max.
   163  	// +kubebuilder:validation:Minimum=8192
   164  	// +kubebuilder:validation:Maximum=12000500
   165  	// +optional
   166  	FsFileMax *int `json:"fsFileMax,omitempty"`
   167  
   168  	// FsInotifyMaxUserWatches specifies the number of file watches allowed by the system. Each watch is roughly 90 bytes on a 32-bit kernel, and roughly 160 bytes on a 64-bit kernel.
   169  	// Valid values are 781250-2097152 (inclusive).
   170  	// Maps to fs.inotify.max_user_watches.
   171  	// +kubebuilder:validation:Minimum=781250
   172  	// +kubebuilder:validation:Maximum=2097152
   173  	// +optional
   174  	FsInotifyMaxUserWatches *int `json:"fsInotifyMaxUserWatches,omitempty"`
   175  
   176  	// FsNrOpen specifies the maximum number of file-handles a process can allocate.
   177  	// Valid values are 8192-20000500 (inclusive).
   178  	// Maps to fs.nr_open.
   179  	// +kubebuilder:validation:Minimum=8192
   180  	// +kubebuilder:validation:Maximum=20000500
   181  	// +optional
   182  	FsNrOpen *int `json:"fsNrOpen,omitempty"`
   183  
   184  	// KernelThreadsMax specifies the maximum number of all threads that can be created.
   185  	// Valid values are 20-513785 (inclusive).
   186  	// Maps to kernel.threads-max.
   187  	// +kubebuilder:validation:Minimum=20
   188  	// +kubebuilder:validation:Maximum=513785
   189  	// +optional
   190  	KernelThreadsMax *int `json:"kernelThreadsMax,omitempty"`
   191  
   192  	// NetCoreNetdevMaxBacklog specifies maximum number of packets, queued on the INPUT side, when the interface receives packets faster than kernel can process them.
   193  	// Valid values are 1000-3240000 (inclusive).
   194  	// Maps to net.core.netdev_max_backlog.
   195  	// +kubebuilder:validation:Minimum=1000
   196  	// +kubebuilder:validation:Maximum=3240000
   197  	// +optional
   198  	NetCoreNetdevMaxBacklog *int `json:"netCoreNetdevMaxBacklog,omitempty"`
   199  
   200  	// NetCoreOptmemMax specifies the maximum ancillary buffer size (option memory buffer) allowed per socket.
   201  	// Socket option memory is used in a few cases to store extra structures relating to usage of the socket.
   202  	// Valid values are 20480-4194304 (inclusive).
   203  	// Maps to net.core.optmem_max.
   204  	// +kubebuilder:validation:Minimum=20480
   205  	// +kubebuilder:validation:Maximum=4194304
   206  	// +optional
   207  	NetCoreOptmemMax *int `json:"netCoreOptmemMax,omitempty"`
   208  
   209  	// NetCoreRmemDefault specifies the default receive socket buffer size in bytes.
   210  	// Valid values are 212992-134217728 (inclusive).
   211  	// Maps to net.core.rmem_default.
   212  	// +kubebuilder:validation:Minimum=212992
   213  	// +kubebuilder:validation:Maximum=134217728
   214  	// +optional
   215  	NetCoreRmemDefault *int `json:"netCoreRmemDefault,omitempty"`
   216  
   217  	// NetCoreRmemMax specifies the maximum receive socket buffer size in bytes.
   218  	// Valid values are 212992-134217728 (inclusive).
   219  	// Maps to net.core.rmem_max.
   220  	// +kubebuilder:validation:Minimum=212992
   221  	// +kubebuilder:validation:Maximum=134217728
   222  	// +optional
   223  	NetCoreRmemMax *int `json:"netCoreRmemMax,omitempty"`
   224  
   225  	// NetCoreSomaxconn specifies maximum number of connection requests that can be queued for any given listening socket.
   226  	// An upper limit for the value of the backlog parameter passed to the listen(2)(https://man7.org/linux/man-pages/man2/listen.2.html) function.
   227  	// If the backlog argument is greater than the somaxconn, then it's silently truncated to this limit.
   228  	// Valid values are 4096-3240000 (inclusive).
   229  	// Maps to net.core.somaxconn.
   230  	// +kubebuilder:validation:Minimum=4096
   231  	// +kubebuilder:validation:Maximum=3240000
   232  	// +optional
   233  	NetCoreSomaxconn *int `json:"netCoreSomaxconn,omitempty"`
   234  
   235  	// NetCoreWmemDefault specifies the default send socket buffer size in bytes.
   236  	// Valid values are 212992-134217728 (inclusive).
   237  	// Maps to net.core.wmem_default.
   238  	// +kubebuilder:validation:Minimum=212992
   239  	// +kubebuilder:validation:Maximum=134217728
   240  	// +optional
   241  	NetCoreWmemDefault *int `json:"netCoreWmemDefault,omitempty"`
   242  
   243  	// NetCoreWmemMax specifies the maximum send socket buffer size in bytes.
   244  	// Valid values are 212992-134217728 (inclusive).
   245  	// Maps to net.core.wmem_max.
   246  	// +kubebuilder:validation:Minimum=212992
   247  	// +kubebuilder:validation:Maximum=134217728
   248  	// +optional
   249  	NetCoreWmemMax *int `json:"netCoreWmemMax,omitempty"`
   250  
   251  	// NetIpv4IPLocalPortRange is used by TCP and UDP traffic to choose the local port on the agent node.
   252  	// PortRange should be specified in the format "first last".
   253  	// First, being an integer, must be between [1024 - 60999].
   254  	// Last, being an integer, must be between [32768 - 65000].
   255  	// Maps to net.ipv4.ip_local_port_range.
   256  	// +optional
   257  	NetIpv4IPLocalPortRange *string `json:"netIpv4IPLocalPortRange,omitempty"`
   258  
   259  	// NetIpv4NeighDefaultGcThresh1 specifies the minimum number of entries that may be in the ARP cache.
   260  	// Garbage collection won't be triggered if the number of entries is below this setting.
   261  	// Valid values are 128-80000 (inclusive).
   262  	// Maps to net.ipv4.neigh.default.gc_thresh1.
   263  	// +kubebuilder:validation:Minimum=128
   264  	// +kubebuilder:validation:Maximum=80000
   265  	// +optional
   266  	NetIpv4NeighDefaultGcThresh1 *int `json:"netIpv4NeighDefaultGcThresh1,omitempty"`
   267  
   268  	// NetIpv4NeighDefaultGcThresh2 specifies soft maximum number of entries that may be in the ARP cache.
   269  	// ARP garbage collection will be triggered about 5 seconds after reaching this soft maximum.
   270  	// Valid values are 512-90000 (inclusive).
   271  	// Maps to net.ipv4.neigh.default.gc_thresh2.
   272  	// +kubebuilder:validation:Minimum=512
   273  	// +kubebuilder:validation:Maximum=90000
   274  	// +optional
   275  	NetIpv4NeighDefaultGcThresh2 *int `json:"netIpv4NeighDefaultGcThresh2,omitempty"`
   276  
   277  	// NetIpv4NeighDefaultGcThresh3 specified hard maximum number of entries in the ARP cache.
   278  	// Valid values are 1024-100000 (inclusive).
   279  	// Maps to net.ipv4.neigh.default.gc_thresh3.
   280  	// +kubebuilder:validation:Minimum=1024
   281  	// +kubebuilder:validation:Maximum=100000
   282  	// +optional
   283  	NetIpv4NeighDefaultGcThresh3 *int `json:"netIpv4NeighDefaultGcThresh3,omitempty"`
   284  
   285  	// NetIpv4TCPFinTimeout specifies the length of time an orphaned connection will remain in the FIN_WAIT_2 state before it's aborted at the local end.
   286  	// Valid values are 5-120 (inclusive).
   287  	// Maps to net.ipv4.tcp_fin_timeout.
   288  	// +kubebuilder:validation:Minimum=5
   289  	// +kubebuilder:validation:Maximum=120
   290  	// +optional
   291  	NetIpv4TCPFinTimeout *int `json:"netIpv4TCPFinTimeout,omitempty"`
   292  
   293  	// NetIpv4TCPKeepaliveProbes specifies the number of keepalive probes TCP sends out, until it decides the connection is broken.
   294  	// Valid values are 1-15 (inclusive).
   295  	// Maps to net.ipv4.tcp_keepalive_probes.
   296  	// +kubebuilder:validation:Minimum=1
   297  	// +kubebuilder:validation:Maximum=15
   298  	// +optional
   299  	NetIpv4TCPKeepaliveProbes *int `json:"netIpv4TCPKeepaliveProbes,omitempty"`
   300  
   301  	// NetIpv4TCPKeepaliveTime specifies the rate at which TCP sends out a keepalive message when keepalive is enabled.
   302  	// Valid values are 30-432000 (inclusive).
   303  	// Maps to net.ipv4.tcp_keepalive_time.
   304  	// +kubebuilder:validation:Minimum=30
   305  	// +kubebuilder:validation:Maximum=432000
   306  	// +optional
   307  	NetIpv4TCPKeepaliveTime *int `json:"netIpv4TCPKeepaliveTime,omitempty"`
   308  
   309  	// NetIpv4TCPMaxSynBacklog specifies the maximum number of queued connection requests that have still not received an acknowledgment from the connecting client.
   310  	// If this number is exceeded, the kernel will begin dropping requests.
   311  	// Valid values are 128-3240000 (inclusive).
   312  	// Maps to net.ipv4.tcp_max_syn_backlog.
   313  	// +kubebuilder:validation:Minimum=128
   314  	// +kubebuilder:validation:Maximum=3240000
   315  	// +optional
   316  	NetIpv4TCPMaxSynBacklog *int `json:"netIpv4TCPMaxSynBacklog,omitempty"`
   317  
   318  	// NetIpv4TCPMaxTwBuckets specifies maximal number of timewait sockets held by system simultaneously.
   319  	// If this number is exceeded, time-wait socket is immediately destroyed and warning is printed.
   320  	// Valid values are 8000-1440000 (inclusive).
   321  	// Maps to net.ipv4.tcp_max_tw_buckets.
   322  	// +kubebuilder:validation:Minimum=8000
   323  	// +kubebuilder:validation:Maximum=1440000
   324  	// +optional
   325  	NetIpv4TCPMaxTwBuckets *int `json:"netIpv4TCPMaxTwBuckets,omitempty"`
   326  
   327  	// NetIpv4TCPTwReuse is used to allow to reuse TIME-WAIT sockets for new connections when it's safe from protocol viewpoint.
   328  	// Maps to net.ipv4.tcp_tw_reuse.
   329  	// +optional
   330  	NetIpv4TCPTwReuse *bool `json:"netIpv4TCPTwReuse,omitempty"`
   331  
   332  	// NetIpv4TCPkeepaliveIntvl specifies the frequency of the probes sent out.
   333  	// Multiplied by tcpKeepaliveprobes, it makes up the time to kill a connection that isn't responding, after probes started.
   334  	// Valid values are 1-75 (inclusive).
   335  	// Maps to net.ipv4.tcp_keepalive_intvl.
   336  	// +kubebuilder:validation:Minimum=1
   337  	// +kubebuilder:validation:Maximum=75
   338  	// +optional
   339  	NetIpv4TCPkeepaliveIntvl *int `json:"netIpv4TCPkeepaliveIntvl,omitempty"`
   340  
   341  	// NetNetfilterNfConntrackBuckets specifies the size of hash table used by nf_conntrack module to record the established connection record of the TCP protocol.
   342  	// Valid values are 65536-147456 (inclusive).
   343  	// Maps to net.netfilter.nf_conntrack_buckets.
   344  	// +kubebuilder:validation:Minimum=65536
   345  	// +kubebuilder:validation:Maximum=147456
   346  	// +optional
   347  	NetNetfilterNfConntrackBuckets *int `json:"netNetfilterNfConntrackBuckets,omitempty"`
   348  
   349  	// NetNetfilterNfConntrackMax specifies the maximum number of connections supported by the nf_conntrack module or the size of connection tracking table.
   350  	// Valid values are 131072-1048576 (inclusive).
   351  	// Maps to net.netfilter.nf_conntrack_max.
   352  	// +kubebuilder:validation:Minimum=131072
   353  	// +kubebuilder:validation:Maximum=1048576
   354  	// +optional
   355  	NetNetfilterNfConntrackMax *int `json:"netNetfilterNfConntrackMax,omitempty"`
   356  
   357  	// VMMaxMapCount specifies the maximum number of memory map areas a process may have.
   358  	// Maps to vm.max_map_count.
   359  	// Valid values are 65530-262144 (inclusive).
   360  	// +kubebuilder:validation:Minimum=65530
   361  	// +kubebuilder:validation:Maximum=262144
   362  	// +optional
   363  	VMMaxMapCount *int `json:"vmMaxMapCount,omitempty"`
   364  
   365  	// VMSwappiness specifies aggressiveness of the kernel in swapping memory pages.
   366  	// Higher values will increase aggressiveness, lower values decrease the amount of swap.
   367  	// Valid values are 0-100 (inclusive).
   368  	// Maps to vm.swappiness.
   369  	// +kubebuilder:validation:Minimum=0
   370  	// +kubebuilder:validation:Maximum=100
   371  	// +optional
   372  	VMSwappiness *int `json:"vmSwappiness,omitempty"`
   373  
   374  	// VMVfsCachePressure specifies the percentage value that controls tendency of the kernel to reclaim the memory, which is used for caching of directory and inode objects.
   375  	// Valid values are 1-500 (inclusive).
   376  	// Maps to vm.vfs_cache_pressure.
   377  	// +kubebuilder:validation:Minimum=1
   378  	// +kubebuilder:validation:Maximum=500
   379  	// +optional
   380  	VMVfsCachePressure *int `json:"vmVfsCachePressure,omitempty"`
   381  }
   382  
   383  // LinuxOSConfig specifies the custom Linux OS settings and configurations.
   384  // See also [AKS doc].
   385  //
   386  // [AKS doc]: https://learn.microsoft.com/azure/aks/custom-node-configuration#linux-os-custom-configuration
   387  type LinuxOSConfig struct {
   388  	// SwapFileSizeMB specifies size in MB of a swap file will be created on the agent nodes from this node pool.
   389  	// Max value of SwapFileSizeMB should be the size of temporary disk(/dev/sdb).
   390  	// Must be at least 1.
   391  	// See also [AKS doc].
   392  	//
   393  	// [AKS doc]: https://learn.microsoft.com/azure/virtual-machines/managed-disks-overview#temporary-disk
   394  	// +kubebuilder:validation:Minimum=1
   395  	// +optional
   396  	SwapFileSizeMB *int `json:"swapFileSizeMB,omitempty"`
   397  
   398  	// Sysctl specifies the settings for Linux agent nodes.
   399  	// +optional
   400  	Sysctls *SysctlConfig `json:"sysctls,omitempty"`
   401  
   402  	// TransparentHugePageDefrag specifies whether the kernel should make aggressive use of memory compaction to make more hugepages available.
   403  	// See also [Linux doc].
   404  	//
   405  	// [Linux doc]: https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge for more details.
   406  	// +kubebuilder:validation:Enum=always;defer;defer+madvise;madvise;never
   407  	// +optional
   408  	TransparentHugePageDefrag *TransparentHugePageOption `json:"transparentHugePageDefrag,omitempty"`
   409  
   410  	// TransparentHugePageEnabled specifies various modes of Transparent Hugepages.
   411  	// See also [Linux doc].
   412  	//
   413  	// [Linux doc]: https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge for more details.
   414  	// +kubebuilder:validation:Enum=always;madvise;never
   415  	// +optional
   416  	TransparentHugePageEnabled *TransparentHugePageOption `json:"transparentHugePageEnabled,omitempty"`
   417  }
   418  
   419  // AzureManagedMachinePoolSpec defines the desired state of AzureManagedMachinePool.
   420  type AzureManagedMachinePoolSpec struct {
   421  	AzureManagedMachinePoolClassSpec `json:",inline"`
   422  
   423  	// ProviderIDList is the unique identifier as specified by the cloud provider.
   424  	// +optional
   425  	ProviderIDList []string `json:"providerIDList,omitempty"`
   426  }
   427  
   428  // ManagedMachinePoolScaling specifies scaling options.
   429  type ManagedMachinePoolScaling struct {
   430  	// MinSize is the minimum number of nodes for auto-scaling.
   431  	MinSize *int `json:"minSize,omitempty"`
   432  	// MaxSize is the maximum number of nodes for auto-scaling.
   433  	MaxSize *int `json:"maxSize,omitempty"`
   434  }
   435  
   436  // TaintEffect is the effect for a Kubernetes taint.
   437  type TaintEffect string
   438  
   439  // Taint represents a Kubernetes taint.
   440  type Taint struct {
   441  	// Effect specifies the effect for the taint
   442  	// +kubebuilder:validation:Enum=NoSchedule;NoExecute;PreferNoSchedule
   443  	Effect TaintEffect `json:"effect"`
   444  	// Key is the key of the taint
   445  	Key string `json:"key"`
   446  	// Value is the value of the taint
   447  	Value string `json:"value"`
   448  }
   449  
   450  // Taints is an array of Taints.
   451  type Taints []Taint
   452  
   453  // AzureManagedMachinePoolStatus defines the observed state of AzureManagedMachinePool.
   454  type AzureManagedMachinePoolStatus struct {
   455  	// Ready is true when the provider resource is ready.
   456  	// +optional
   457  	Ready bool `json:"ready"`
   458  
   459  	// Replicas is the most recently observed number of replicas.
   460  	// +optional
   461  	Replicas int32 `json:"replicas"`
   462  
   463  	// Any transient errors that occur during the reconciliation of Machines
   464  	// can be added as events to the Machine object and/or logged in the
   465  	// controller's output.
   466  	// +optional
   467  	ErrorReason *capierrors.MachineStatusError `json:"errorReason,omitempty"`
   468  
   469  	// Any transient errors that occur during the reconciliation of Machines
   470  	// can be added as events to the Machine object and/or logged in the
   471  	// controller's output.
   472  	// +optional
   473  	ErrorMessage *string `json:"errorMessage,omitempty"`
   474  
   475  	// Conditions defines current service state of the AzureManagedControlPlane.
   476  	// +optional
   477  	Conditions clusterv1.Conditions `json:"conditions,omitempty"`
   478  
   479  	// LongRunningOperationStates saves the states for Azure long-running operations so they can be continued on the
   480  	// next reconciliation loop.
   481  	// +optional
   482  	LongRunningOperationStates Futures `json:"longRunningOperationStates,omitempty"`
   483  }
   484  
   485  // +kubebuilder:object:root=true
   486  // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AzureManagedMachinePool belongs"
   487  // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
   488  // +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
   489  // +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
   490  // +kubebuilder:printcolumn:name="Message",type="string",priority=1,JSONPath=".status.conditions[?(@.type=='Ready')].message"
   491  // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of this AzureManagedMachinePool"
   492  // +kubebuilder:printcolumn:name="Mode",type="string",JSONPath=".spec.mode"
   493  // +kubebuilder:resource:path=azuremanagedmachinepools,scope=Namespaced,categories=cluster-api,shortName=ammp
   494  // +kubebuilder:storageversion
   495  // +kubebuilder:subresource:status
   496  
   497  // AzureManagedMachinePool is the Schema for the azuremanagedmachinepools API.
   498  type AzureManagedMachinePool struct {
   499  	metav1.TypeMeta   `json:",inline"`
   500  	metav1.ObjectMeta `json:"metadata,omitempty"`
   501  
   502  	Spec   AzureManagedMachinePoolSpec   `json:"spec,omitempty"`
   503  	Status AzureManagedMachinePoolStatus `json:"status,omitempty"`
   504  }
   505  
   506  // +kubebuilder:object:root=true
   507  
   508  // AzureManagedMachinePoolList contains a list of AzureManagedMachinePools.
   509  type AzureManagedMachinePoolList struct {
   510  	metav1.TypeMeta `json:",inline"`
   511  	metav1.ListMeta `json:"metadata,omitempty"`
   512  	Items           []AzureManagedMachinePool `json:"items"`
   513  }
   514  
   515  // GetConditions returns the list of conditions for an AzureManagedMachinePool API object.
   516  func (m *AzureManagedMachinePool) GetConditions() clusterv1.Conditions {
   517  	return m.Status.Conditions
   518  }
   519  
   520  // SetConditions will set the given conditions on an AzureManagedMachinePool object.
   521  func (m *AzureManagedMachinePool) SetConditions(conditions clusterv1.Conditions) {
   522  	m.Status.Conditions = conditions
   523  }
   524  
   525  // GetFutures returns the list of long running operation states for an AzureManagedMachinePool API object.
   526  func (m *AzureManagedMachinePool) GetFutures() Futures {
   527  	return m.Status.LongRunningOperationStates
   528  }
   529  
   530  // SetFutures will set the given long running operation states on an AzureManagedMachinePool object.
   531  func (m *AzureManagedMachinePool) SetFutures(futures Futures) {
   532  	m.Status.LongRunningOperationStates = futures
   533  }
   534  
   535  func init() {
   536  	SchemeBuilder.Register(&AzureManagedMachinePool{}, &AzureManagedMachinePoolList{})
   537  }