Skip to content

Commit b787e47

Browse files
authored
Merge pull request #3578 from nawazkh/add_lb_to_flatcar_tests_1.9
[release-1.9] optional flatcar tests will create a loadbalancer
2 parents ad941b2 + 6ef8e50 commit b787e47

File tree

5 files changed

+37
-1
lines changed

5 files changed

+37
-1
lines changed

Tiltfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,9 @@ def deploy_worker_templates(template, substitutions):
376376
flavor_cmd += "; " + helm_cmd + " repo add projectcalico https://docs.tigera.io/calico/charts; " + helm_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig install calico projectcalico/tigera-operator -f " + calico_values + " --namespace tigera-operator --create-namespace"
377377
if "intree-cloud-provider" not in flavor_name:
378378
flavor_cmd += "; " + helm_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig install --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure --generate-name --set infra.clusterName=${CLUSTER_NAME}"
379+
if "flatcar" in flavor_name: # append caCetDir location to the cloud-provider-azure helm install command for flatcar flavor
380+
flavor_cmd += " --set-string cloudControllerManager.caCertDir=/usr/share/ca-certificates"
381+
379382
local_resource(
380383
name = flavor_name,
381384
cmd = flavor_cmd,

docs/book/src/topics/addons.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ Then install the Helm chart on the workload cluster:
168168
helm install --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure --generate-name --set infra.clusterName=${CLUSTER_NAME} --set "cloudControllerManager.clusterCIDR=${CCM_CIDR_BLOCK}"
169169
```
170170

171+
- **Note**:
172+
When working with **Flatcar machines**, append `--set-string cloudControllerManager.caCertDir=/usr/share/ca-certificates` to the `cloud-provider-azure` _helm_ command. The helm command to install cloud provider azure for Flatcar-flavored workload cluster will be:
173+
174+
```bash
175+
helm install --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure --generate-name --set infra.clusterName=${CLUSTER_NAME} --set "cloudControllerManager.clusterCIDR=${CCM_CIDR_BLOCK}" --set-string "cloudControllerManager.caCertDir=/usr/share/ca-certificates"
176+
```
177+
171178
The Helm chart will pick the right version of `cloud-controller-manager` and `cloud-node-manager` to work with the version of Kubernetes your cluster is running.
172179

173180
After running `helm install`, you should eventually see a set of pods like these in a `Running` state:

docs/book/src/topics/flatcar.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ If you would like customize your images please refer to the documentation on bui
3939
## Trying it out
4040

4141
To create a cluster using Flatcar Container Linux, use `flatcar` cluster flavor.
42+
43+
- Note: When working with **Flatcar machines**, append `--set-string cloudControllerManager.caCertDir=/usr/share/ca-certificates` to the `cloud-provider-azure` _helm_ command. Refer ["External Cloud Provider's Note for flatcar-flavored machine"](https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/764aa1e8bd02d150dff90ff6bc7f8daa2b38810f/docs/book/src/topics/addons.md#external-cloud-provider)
44+
- However, no changes are needed when using tilt to bring up flatcar-flavored workload clusters.

test/e2e/azure_test.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ var _ = Describe("Workload cluster creation", func() {
297297
Context("Creating a Flatcar cluster [OPTIONAL]", func() {
298298
It("With Flatcar control-plane and worker nodes", func() {
299299
clusterName = getClusterName(clusterNamePrefix, "flatcar")
300-
301300
clusterctl.ApplyClusterTemplateAndWait(ctx, createApplyClusterTemplateInput(
302301
specName,
303302
withFlavor("flatcar"),
@@ -309,7 +308,27 @@ var _ = Describe("Workload cluster creation", func() {
309308
withControlPlaneWaiters(clusterctl.ControlPlaneWaiters{
310309
WaitForControlPlaneInitialized: EnsureControlPlaneInitialized,
311310
}),
311+
withPostMachinesProvisioned(func() {
312+
EnsureDaemonsets(ctx, func() DaemonsetsSpecInput {
313+
return DaemonsetsSpecInput{
314+
BootstrapClusterProxy: bootstrapClusterProxy,
315+
Namespace: namespace,
316+
ClusterName: clusterName,
317+
}
318+
})
319+
}),
312320
), result)
321+
322+
By("can create and access a load balancer", func() {
323+
AzureLBSpec(ctx, func() AzureLBSpecInput {
324+
return AzureLBSpecInput{
325+
BootstrapClusterProxy: bootstrapClusterProxy,
326+
Namespace: namespace,
327+
ClusterName: clusterName,
328+
SkipCleanup: skipCleanup,
329+
}
330+
})
331+
})
313332
})
314333
})
315334

test/e2e/cloud-provider-azure.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ func InstallCalicoAndCloudProviderAzureHelmChart(ctx context.Context, input clus
6161
options.StringValues = append(options.StringValues, fmt.Sprintf("cloudNodeManager.imageTag=%s", os.Getenv("IMAGE_TAG_CNM")))
6262
}
6363

64+
if input.ConfigCluster.Flavor == "flatcar" {
65+
options.StringValues = append(options.StringValues, "cloudControllerManager.caCertDir=/usr/share/ca-certificates")
66+
}
67+
6468
clusterProxy := input.ClusterProxy.GetWorkloadCluster(ctx, input.ConfigCluster.Namespace, input.ConfigCluster.ClusterName)
6569
InstallHelmChart(ctx, clusterProxy, defaultNamespace, cloudProviderAzureHelmRepoURL, cloudProviderAzureChartName, cloudProviderAzureHelmReleaseName, options)
6670

0 commit comments

Comments
 (0)