Skip to content

Commit 6abf1c3

Browse files
authored
Merge pull request #5304 from nawazkh/feature_flag_internal_ilb
Create and add InternalILB as a CAPZ feature flag
2 parents d54979f + f7d70c4 commit 6abf1c3

File tree

5 files changed

+54
-3
lines changed

5 files changed

+54
-3
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ create-cluster: ## Create a workload development Kubernetes cluster on Azure in
387387
EXP_MACHINE_POOL=true \
388388
EXP_EDGEZONE=true \
389389
EXP_ASO_API=true \
390+
EXP_APISERVER_ILB=true \
390391
$(MAKE) create-management-cluster \
391392
create-workload-cluster
392393

@@ -751,7 +752,7 @@ tilt-up: install-tools ## Start tilt and build kind cluster if needed.
751752
@if [ -z "${AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY}" ]; then \
752753
export AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY=$(shell cat $(AZURE_IDENTITY_ID_FILEPATH)); \
753754
fi; \
754-
CLUSTER_TOPOLOGY=true EXP_ASO_API=true EXP_CLUSTER_RESOURCE_SET=true EXP_MACHINE_POOL=true EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION=true EXP_EDGEZONE=true tilt up
755+
CLUSTER_TOPOLOGY=true EXP_ASO_API=true EXP_CLUSTER_RESOURCE_SET=true EXP_MACHINE_POOL=true EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION=true EXP_EDGEZONE=true EXP_APISERVER_ILB=true tilt up
755756

756757
.PHONY: delete-cluster
757758
delete-cluster: delete-workload-cluster ## Deletes the example kind cluster "capz".

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
- --leader-elect
2525
- "--diagnostics-address=${CAPZ_DIAGNOSTICS_ADDRESS:=:8443}"
2626
- "--insecure-diagnostics=${CAPZ_INSECURE_DIAGNOSTICS:=false}"
27-
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=true},AKSResourceHealth=${EXP_AKS_RESOURCE_HEALTH:=false},EdgeZone=${EXP_EDGEZONE:=false},ASOAPI=${EXP_ASO_API:=true}"
27+
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=true},AKSResourceHealth=${EXP_AKS_RESOURCE_HEALTH:=false},EdgeZone=${EXP_EDGEZONE:=false},ASOAPI=${EXP_ASO_API:=true},APIServerILB=${EXP_APISERVER_ILB:=false}"
2828
- "--v=0"
2929
image: controller:latest
3030
imagePullPolicy: Always

docs/book/src/developers/development.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
- [Tilt for dev in CAPZ](#tilt-for-dev-in-capz)
2222
- [Tilt for dev in both CAPZ and CAPI](#tilt-for-dev-in-both-capz-and-capi)
2323
- [Deploying a workload cluster](#deploying-a-workload-cluster)
24+
- [Tilt for dev using internal load balancer (ILB) for intra-cluster node-apiserver traffic](#tilt-for-dev-using-internal-load-balancer-ilb-for-intra-cluster-node-apiserver-traffic)
25+
- [Flavors for dev using internal load balancer (ILB) for intra-cluster node-apiserver traffic](#flavors-for-dev-using-internal-load-balancer-ilb-for-intra-cluster-node-apiserver-traffic)
2426
- [Viewing Telemetry](#viewing-telemetry)
2527
- [Debugging](#debugging)
2628
- [Manual Testing](#manual-testing)
@@ -151,6 +153,17 @@ development will span both CAPZ and CAPI, then follow the [CAPI and CAPZ instruc
151153

152154
#### Tilt for dev in CAPZ
153155

156+
<aside class="note warning">
157+
<h2>Warning</h2>
158+
<p>
159+
To use an internal load balancer (ILB) intra-cluster node-apiserver traffic in your workload cluster, follow the
160+
instructions in the
161+
<a href="#tilt-for-dev-using-internal-load-balancer-ilb-for-intra-cluster-node-apiserver-traffic">
162+
Tilt for Dev: Internal LB for Cluster VNet Communication
163+
</a> section.
164+
</p>
165+
</aside>
166+
154167
If you want to develop in CAPZ and get a local development cluster working quickly, this is the path for you.
155168

156169
Create a file named `tilt-settings.yaml` in the root of the CAPZ repository with the following contents:
@@ -247,6 +260,36 @@ make delete-workload-cluster
247260

248261
> Check out the [self-managed](../self-managed/troubleshooting.md) and [managed](../managed/troubleshooting.md) troubleshooting guides for common errors you might run into.
249262
263+
#### Tilt for dev using internal load balancer (ILB) for intra-cluster node-apiserver traffic
264+
265+
This flow is for developers who want to leverage the internal load balancer for intra-cluster node-apiserver traffic.
266+
You can achieve this by setting the `EXP_APISERVER_ILB` environment variable to `true` in your shell (run `export EXP_APISERVER_ILB=true`) and then create the CAPZ management cluster.
267+
268+
We also encourage you to use AKS cluster as your management cluster.
269+
270+
Outline of the steps:
271+
- `make clean`
272+
- `make generate`
273+
- Set `REGISTRY` in your env. Preferably an Azure Container Registry.
274+
- Run `docker-build-all` to build all the images.
275+
- Run `make acr-login` to login to your ACR.
276+
- Run `docker-push-all` to push all the images to your ACR.
277+
- Run `make aks-create` to create an AKS cluster. _Notice the changes that get applied to the `tilt-settings.yaml` file._
278+
- Run `export EXP_APISERVER_ILB=true` in your shell.
279+
- Run `make tilt-up` to start Tilt.
280+
281+
```
282+
TODO:
283+
1. Come up with a shorter make target to do all the above steps for MS Tenants.
284+
2. VNet peering should be exported out as a shell script for users to run.
285+
```
286+
287+
##### Flavors for dev using internal load balancer (ILB) for intra-cluster node-apiserver traffic
288+
289+
There are two flavors available for development in CAPZ for MSFT Tenant:
290+
- [apiserver-ilb](../../../../templates/cluster-template-apiserver-ilb.yaml): VM based default flavor that brings up native K8s clusters with Linux nodes.
291+
- [apiserver-ilb-windows](../../../../templates/cluster-template-windows-apiserver-ilb.yaml): VM based flavor that brings up native K8s clusters with Linux and Windows nodes.
292+
250293
#### Viewing Telemetry
251294

252295
The CAPZ controller emits tracing and metrics data. When run in Tilt, the KinD management cluster is

feature/feature.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ const (
5252
// owner: @nojnhuh
5353
// alpha: v1.15
5454
ASOAPI featuregate.Feature = "ASOAPI"
55+
56+
// APIServerILB is a CAPZ feature gate to create an internal LB for the API Server of the workload cluster.
57+
// Defaults to false.
58+
// owner: @nawazkh
59+
// alpha: v1.18
60+
APIServerILB featuregate.Feature = "APIServerILB"
5561
)
5662

5763
func init() {
@@ -66,4 +72,5 @@ var defaultCAPZFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
6672
AKSResourceHealth: {Default: false, PreRelease: featuregate.Alpha},
6773
EdgeZone: {Default: false, PreRelease: featuregate.Alpha},
6874
ASOAPI: {Default: true, PreRelease: featuregate.Alpha},
75+
APIServerILB: {Default: false, PreRelease: featuregate.Alpha},
6976
}

hack/observability/opentelemetry/controller-manager-patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ spec:
1212
- "--diagnostics-address=:8080"
1313
- "--insecure-diagnostics"
1414
- "--leader-elect"
15-
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=true},AKSResourceHealth=${EXP_AKS_RESOURCE_HEALTH:=false},EdgeZone=${EXP_EDGEZONE:=false},ASOAPI=${EXP_ASO_API:=true}"
15+
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=true},AKSResourceHealth=${EXP_AKS_RESOURCE_HEALTH:=false},EdgeZone=${EXP_EDGEZONE:=false},ASOAPI=${EXP_ASO_API:=true},APIServerILB=${EXP_APISERVER_ILB:=false}"
1616
- "--enable-tracing"

0 commit comments

Comments
 (0)