From aef33ac4c724de6a1376f33ddd6daa9b87e326ee Mon Sep 17 00:00:00 2001 From: Sanggu Han Date: Sun, 29 Sep 2024 19:26:15 +0900 Subject: [PATCH] refactor(manager): set machinepool true as default - MachinePool feature flag is true as default since CAPI v1.7.0, but capz-contoller-manager deployment still uses false as default. - It causes error `spec: Forbidden: can be set only if the Cluster API 'MachinePool' feature flag is enabled` when user does not specify MachinePool feature flag true in capz-controller-manager. - As CAPI v1.7.0 has been GA around six months, It should set MachinePool feature flag as true to make seamless UX. references https://github.com/kubernetes-sigs/cluster-api/releases/tag/v1.7.0 https://github.com/kubernetes-sigs/cluster-api/pull/10141 refactor(hack): set machinepool true in default - set machinepool feature flag as true for controller in observability hack stack doc(machinepool): add note of enabled per default - add note about MachinePool feature gate's promotion to beta - add note about MachinePool feature gate's default value (true) doc(machinepool): restore feature requirement part - as the information "MachinePool feature gate need to be set as true" must be shown, restore the part - modify the "need to turn on" sentence to "it's already on, but you can set it again" doc(machinepool): accept wording change - changed the wording as willie-yao suggested in PR Co-authored-by: Willie Yao <47200969+willie-yao@users.noreply.github.com> --- config/manager/manager.yaml | 2 +- docs/book/src/developers/development.md | 2 +- docs/book/src/managed/managedcluster.md | 7 ++++--- docs/book/src/self-managed/machinepools.md | 8 +++++++- .../opentelemetry/controller-manager-patch.yaml | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index b70a13a0bd6..dddc46d6a47 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -24,7 +24,7 @@ spec: - --leader-elect - "--diagnostics-address=${CAPZ_DIAGNOSTICS_ADDRESS:=:8443}" - "--insecure-diagnostics=${CAPZ_INSECURE_DIAGNOSTICS:=false}" - - "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=false},AKSResourceHealth=${EXP_AKS_RESOURCE_HEALTH:=false},EdgeZone=${EXP_EDGEZONE:=false},ASOAPI=${EXP_ASO_API:=true}" + - "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=true},AKSResourceHealth=${EXP_AKS_RESOURCE_HEALTH:=false},EdgeZone=${EXP_EDGEZONE:=false},ASOAPI=${EXP_ASO_API:=true}" - "--v=0" image: controller:latest imagePullPolicy: Always diff --git a/docs/book/src/developers/development.md b/docs/book/src/developers/development.md index 0845fa0ede4..a99b7be31da 100644 --- a/docs/book/src/developers/development.md +++ b/docs/book/src/developers/development.md @@ -571,7 +571,7 @@ You can optionally set the following variables: | `KUBERNETES_VERSION` | Desired Kubernetes version to test. You can pass in a definitive released version, e.g., "v1.24.0". If you want to use pre-released CI bits of a particular release you may use the "latest-" prefix, e.g., "latest-1.24"; you may use the very latest built CI bits from the kubernetes/kubernetes master branch by passing in "latest". If you provide a `KUBERNETES_VERSION` environment variable, you may not also use `CI_VERSION` (below). Use only one configuration variable to declare the version of Kubernetes to test. | | `CI_VERSION` | Provide a custom CI version of Kubernetes (e.g., `v1.25.0-alpha.0.597+aa49dffc7f24dc`). If not specified, this will be determined from the KUBERNETES_VERSION above if it is an unreleased version. If you provide a `CI_VERSION` environment variable, you may not also use `KUBERNETES_VERSION` (above). | | `TEST_CCM` | Build a cluster that uses custom versions of the Azure cloud-provider cloud-controller-manager and node-controller-manager images | -| `EXP_MACHINE_POOL` | Use [Machine Pool](../self-managed/machinepools.md) for worker machines. | +| `EXP_MACHINE_POOL` | Use [Machine Pool](../self-managed/machinepools.md) for worker machines. Defaults to true. | | `TEST_WINDOWS` | Build a cluster that has Windows worker nodes. | | `REGISTRY` | Registry to push any custom k8s images or cloud provider images built. | | `CLUSTER_TEMPLATE` | Use a custom cluster template. It can be a path to a template under templates/, a path on the host or a link. If the value is not set, the script will choose the appropriate cluster template based on existing environment variables. | diff --git a/docs/book/src/managed/managedcluster.md b/docs/book/src/managed/managedcluster.md index a2f769d0e22..f231e6ac9fa 100644 --- a/docs/book/src/managed/managedcluster.md +++ b/docs/book/src/managed/managedcluster.md @@ -68,12 +68,13 @@ export AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE="default" export CLUSTER_IDENTITY_NAME="cluster-identity" ``` -Managed clusters require the Cluster API "MachinePool" feature flag enabled. You can do that via an environment variable thusly: +Managed clusters require the Cluster API "MachinePool" feature flag enabled. The feature flag is enabled by default, but you can configure it using the following environment variable: ```bash -export EXP_MACHINE_POOL=true +export EXP_MACHINE_POOL=true ``` + Create a local kind cluster to run the management cluster components: ```bash @@ -416,4 +417,4 @@ To learn more about OIDC and AKS refer [AKS Docs on OIDC issuer](https://learn.m CAPZ no longer supports passing custom headers to AKS APIs with `infrastructure.cluster.x-k8s.io/custom-header-` annotations. Custom headers are deprecated in AKS in favor of new features first landing in preview API versions: -https://github.com/Azure/azure-rest-api-specs/pull/18232 \ No newline at end of file +https://github.com/Azure/azure-rest-api-specs/pull/18232 diff --git a/docs/book/src/self-managed/machinepools.md b/docs/book/src/self-managed/machinepools.md index a683b1a969a..0311378b123 100644 --- a/docs/book/src/self-managed/machinepools.md +++ b/docs/book/src/self-managed/machinepools.md @@ -1,6 +1,7 @@ # MachinePools -- **Feature status:** Experimental +- **Feature status:** Experimental (Beta) - **Feature gate:** MachinePool=true +- **Default value:** true (enabled) > In Cluster API (CAPI) v1alpha2, users can create MachineDeployment, MachineSet or Machine custom > resources. When you create a MachineDeployment or MachineSet, Cluster API components react and @@ -31,6 +32,11 @@ *Source: [MachinePool API Proposal](https://github.com/kubernetes-sigs/cluster-api/blob/bf51a2502f9007b531f6a9a2c1a4eae1586fb8ca/docs/proposals/20190919-machinepool-api.md)* +> In Cluster API (CAPI) v1.7.0, MachinePool feature flag's default settings become true and promoted +> to Beta from Alpha. To disable this feature, you can use `EXP_MACHINE_POOL=false`. + +*Source: [Cluster API v1.7.0 Release Note](https://github.com/kubernetes-sigs/cluster-api/releases/tag/v1.7.0)* + ## AzureMachinePool Cluster API Provider Azure (CAPZ) has experimental support for `MachinePool` through the infrastructure types `AzureMachinePool` and `AzureMachinePoolMachine`. An `AzureMachinePool` corresponds to a diff --git a/hack/observability/opentelemetry/controller-manager-patch.yaml b/hack/observability/opentelemetry/controller-manager-patch.yaml index 9d0fc5bd1f8..2ba355b841d 100644 --- a/hack/observability/opentelemetry/controller-manager-patch.yaml +++ b/hack/observability/opentelemetry/controller-manager-patch.yaml @@ -12,5 +12,5 @@ spec: - "--diagnostics-address=:8080" - "--insecure-diagnostics" - "--leader-elect" - - "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=false},AKSResourceHealth=${EXP_AKS_RESOURCE_HEALTH:=false},EdgeZone=${EXP_EDGEZONE:=false},ASOAPI=${EXP_ASO_API:=true}" + - "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=true},AKSResourceHealth=${EXP_AKS_RESOURCE_HEALTH:=false},EdgeZone=${EXP_EDGEZONE:=false},ASOAPI=${EXP_ASO_API:=true}" - "--enable-tracing"