Skip to content

Commit e672a32

Browse files
authored
build: Use k8s v1.29.4 as default Kubernetes version (#646)
Update documentation to specify the version when creating the cluster. Depends on #645.
1 parent fec3595 commit e672a32

File tree

13 files changed

+106
-12
lines changed

13 files changed

+106
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ For example, the following command will create a Docker cluster with Cilium CNI
4444
```shell
4545
export CLUSTER_NAME=docker-cluster-cilium-helm-addon
4646
export CLUSTER_FILE=examples/capi-quick-start/docker-cluster-cilium-helm-addon.yaml
47-
export KUBERNETES_VERSION=v1.28.7
47+
export KUBERNETES_VERSION=v1.29.4
4848
```
4949

5050
```shell

devbox.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
"shell": {
4242
"scripts": {
4343
"preview-docs": [
44-
"cd docs && hugo server --buildFuture --buildDrafts"
44+
"make preview-docs"
4545
],
4646
"build-docs": [
47-
"cd docs && hugo --minify --baseURL \"${BASE_URL}\""
47+
"make build-docs"
4848
]
4949
}
5050
}

docs/content/getting-started/create-cluster/aws.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,18 @@ And create your cluster:
3232

3333
```shell
3434
clusterctl generate cluster my-cluster \
35-
--from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/aws-cluster-cilium-helm-addon.yaml | kubectl apply --server-side -f -
35+
--from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/aws-cluster-cilium-helm-addon.yaml \
36+
--kubernetes-version={{< param "defaultKubernetesVersion" >}} \
37+
--worker-machine-count=1 \
38+
| kubectl apply --server-side -f -
3639
```
3740

3841
To customize your cluster configuration prior to creation, generate the cluster definition to a file and edit it before applying:
3942

4043
```shell
4144
clusterctl generate cluster my-cluster \
42-
--from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/aws-cluster-cilium-helm-addon.yaml >mycluster.yaml
45+
--from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/aws-cluster-cilium-helm-addon.yaml \
46+
--kubernetes-version={{< param "defaultKubernetesVersion" >}} >mycluster.yaml
4347

4448
# EDIT mycluster.yaml
4549

docs/content/getting-started/create-cluster/docker.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ Export the required variables and any optional variables that you may want to se
2424

2525
```shell
2626
clusterctl generate cluster my-cluster \
27-
--from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/docker-cluster-cilium-helm-addon.yaml | kubectl apply --server-side -f -
27+
--from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/docker-cluster-cilium-helm-addon.yaml \
28+
--kubernetes-version={{< param "defaultKubernetesVersion" >}} \
29+
--worker-machine-count=1 \
30+
| kubectl apply --server-side -f -
2831
```
2932

3033
To customize your cluster configuration prior to creation, generate the cluster definition to a file and edit it before applying:
3134

3235
```shell
3336
clusterctl generate cluster my-cluster \
34-
--from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/docker-cluster-cilium-helm-addon.yaml >mycluster.yaml
37+
--from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/docker-cluster-cilium-helm-addon.yaml \
38+
--kubernetes-version={{< param "defaultKubernetesVersion" >}} >mycluster.yaml
3539

3640
# EDIT mycluster.yaml
3741

docs/content/getting-started/create-cluster/nutanix.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,18 @@ And create your cluster:
4242

4343
```shell
4444
clusterctl generate cluster my-cluster \
45-
--from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/nutanix-cluster-cilium-helm-addon.yaml | kubectl apply --server-side -f -
45+
--from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/nutanix-cluster-cilium-helm-addon.yaml \
46+
--kubernetes-version={{< param "defaultKubernetesVersion" >}} \
47+
--worker-machine-count=1 \
48+
| kubectl apply --server-side -f -
4649
```
4750

4851
To customize your cluster configuration prior to creation, generate the cluster definition to a file and edit it before applying:
4952

5053
```shell
5154
clusterctl generate cluster my-cluster \
52-
--from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/nutanix-cluster-cilium-helm-addon.yaml >mycluster.yaml
55+
--from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/nutanix-cluster-cilium-helm-addon.yaml \
56+
--kubernetes-version={{< param "defaultKubernetesVersion" >}} >mycluster.yaml
5357

5458
# EDIT mycluster.yaml
5559

docs/hugo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ enable = false
147147
name = "GitHub"
148148
url = "https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix"
149149
icon = "fab fa-github"
150-
desc = "Development takes place here!"
150+
desc = "Development takes place here!"
151151

152152
[[menu.main]]
153153
name = "GitHub"

make/all.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ include $(INCLUDE_DIR)dev.mk
1818
include $(INCLUDE_DIR)helm.mk
1919
include $(INCLUDE_DIR)examples.mk
2020
include $(INCLUDE_DIR)apis.mk
21+
include $(INCLUDE_DIR)docs.mk

make/docs.mk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2024 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
.PHONY: preview-docs
5+
preview-docs: ## Runs hugo server to locally preview docs
6+
preview-docs: export HUGO_PARAMS_defaultKubernetesVersion ?= $(E2E_DEFAULT_KUBERNETES_VERSION)
7+
preview-docs: ; $(info $(M) running hugo server to locally preview docs)
8+
cd docs && hugo server --buildFuture --buildDrafts
9+
10+
.PHONY: build-docs
11+
build-docs: ## Builds the docs
12+
build-docs: export HUGO_PARAMS_defaultKubernetesVersion ?= $(E2E_DEFAULT_KUBERNETES_VERSION)
13+
build-docs: ; $(info $(M) building docs with hugo)
14+
ifndef BASE_URL
15+
$(error BASE_URL is not set)
16+
endif
17+
cd docs && hugo --minify --baseURL "$(BASE_URL)"

make/go.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ E2E_PARALLEL_NODES ?= $(if $(filter $(E2E_DRYRUN),true),1,$(shell nproc --ignore
8080
E2E_FLAKE_ATTEMPTS ?= 1
8181
E2E_CONF_FILE ?= $(REPO_ROOT)/test/e2e/config/caren.yaml
8282
E2E_CONF_FILE_ENVSUBST ?= $(basename $(E2E_CONF_FILE))-envsubst.yaml
83-
export E2E_DEFAULT_KUBERNETES_VERSION ?= v1.28.7
83+
export E2E_DEFAULT_KUBERNETES_VERSION ?= v1.29.4
8484
ARTIFACTS ?= ${REPO_ROOT}/_artifacts
8585

8686
.PHONY: e2e-test

test/e2e/config/caren.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ variables:
166166
# Override Kubernetes version for test workload clusters for specific providers by setting the env variables
167167
# `KUBERNETES_VERSION_<PROVIDER>`, where `<PROVIDER>` is the uppercase provider name, e.g.
168168
# `KUBERNETES_VERSION_DOCKER: v1.29.4`.
169-
KUBERNETES_VERSION_DOCKER: "${KINDEST_IMAGE_TAG}"
169+
# KUBERNETES_VERSION_DOCKER: "${KINDEST_IMAGE_TAG}"
170170
SERVICE_CIDR: "10.128.0.0/12"
171171
POD_CIDR: "192.168.0.0/16"
172172
NODE_DRAIN_TIMEOUT: "60s"

test/e2e/coredns_helpers.go

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//go:build e2e
2+
3+
// Copyright 2024 Nutanix. All rights reserved.
4+
// SPDX-License-Identifier: Apache-2.0
5+
6+
package e2e
7+
8+
import (
9+
"context"
10+
11+
appsv1 "k8s.io/api/apps/v1"
12+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
13+
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
14+
"sigs.k8s.io/cluster-api/test/framework"
15+
)
16+
17+
type WaitForCoreDNSToBeReadyInWorkloadClusterInput struct {
18+
WorkloadCluster *clusterv1.Cluster
19+
ClusterProxy framework.ClusterProxy
20+
DeploymentIntervals []interface{}
21+
}
22+
23+
func WaitForCoreDNSToBeReadyInWorkloadCluster(
24+
ctx context.Context,
25+
input WaitForCoreDNSToBeReadyInWorkloadClusterInput,
26+
) {
27+
workloadClusterClient := input.ClusterProxy.GetWorkloadCluster(
28+
ctx, input.WorkloadCluster.Namespace, input.WorkloadCluster.Name,
29+
).GetClient()
30+
31+
WaitForDeploymentsAvailable(ctx, framework.WaitForDeploymentsAvailableInput{
32+
Getter: workloadClusterClient,
33+
Deployment: &appsv1.Deployment{
34+
ObjectMeta: metav1.ObjectMeta{
35+
Name: "coredns",
36+
Namespace: metav1.NamespaceSystem,
37+
},
38+
},
39+
}, input.DeploymentIntervals...)
40+
}

test/e2e/quick_start_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,18 @@ var _ = Describe("Quick start", Serial, func() {
165165
),
166166
},
167167
)
168+
169+
WaitForCoreDNSToBeReadyInWorkloadCluster(
170+
ctx,
171+
WaitForCoreDNSToBeReadyInWorkloadClusterInput{
172+
WorkloadCluster: workloadCluster,
173+
ClusterProxy: proxy,
174+
DeploymentIntervals: testE2EConfig.GetIntervals(
175+
flavour,
176+
"wait-deployment",
177+
),
178+
},
179+
)
168180
},
169181
}
170182
})

test/e2e/self_hosted_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ var _ = Describe("Self-hosted", Serial, func() {
100100
),
101101
},
102102
)
103+
104+
WaitForCoreDNSToBeReadyInWorkloadCluster(
105+
ctx,
106+
WaitForCoreDNSToBeReadyInWorkloadClusterInput{
107+
WorkloadCluster: workloadCluster,
108+
ClusterProxy: proxy,
109+
DeploymentIntervals: e2eConfig.GetIntervals(
110+
flavour,
111+
"wait-deployment",
112+
),
113+
},
114+
)
103115
},
104116
}
105117
})

0 commit comments

Comments
 (0)