Skip to content

🌱 Update examples & code snippets in Cluster API book to v1beta2 for Cluster #12483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ You best watch the Kubernetes pods with something like `k9s -A` or `watch kubect
Let's try our cluster out. We'll make some simple YAML:

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: hello-mailgun
Expand All @@ -149,7 +149,7 @@ spec:
pods:
cidrBlocks: ["192.168.0.0/16"]
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
apiGroup: infrastructure.cluster.x-k8s.io
kind: MailgunCluster
name: hello-mailgun
---
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/security/pod-security-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ It is also possible to disable this patch or configure different levels for the
using variables.

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: "my-cluster"
Expand Down
6 changes: 3 additions & 3 deletions docs/book/src/tasks/bootstrap/kubeadm-bootstrap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ infrastructure object.

```yaml
kind: DockerCluster
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
Copy link
Member

@fabriziopandini fabriziopandini Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is docker cluster; are you planning a follow up PR taking care of all the other occurrences of DockerCluster/DockerClusterTemplate?

metadata:
name: my-cluster-docker
---
kind: Cluster
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
metadata:
name: my-cluster
spec:
infrastructureRef:
kind: DockerCluster
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiGroup: infrastructure.cluster.x-k8s.io
name: my-cluster-docker
```

Expand Down
4 changes: 2 additions & 2 deletions docs/book/src/tasks/bootstrap/microk8s-bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Cluster API bootstrap provider MicroK8s (CABPM) is a component responsible for g
MicroK8s defines a `MicroK8sControlPlane` definition as well as the `MachineDeployment` to configure the control plane and worker nodes respectively. The `MicroK8sControlPlane` is linked in the cluster definition as shown in the following example:

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
spec:
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
apiGroup: controlplane.cluster.x-k8s.io
kind: MicroK8sControlPlane
name: capi-aws-control-plane
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ apiVersion: hooks.runtime.cluster.x-k8s.io/v1alpha1
kind: BeforeClusterCreateRequest
settings: <Runtime Extension settings>
cluster:
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: test-cluster
Expand Down Expand Up @@ -89,7 +89,7 @@ apiVersion: hooks.runtime.cluster.x-k8s.io/v1alpha1
kind: AfterControlPlaneInitializedRequest
settings: <Runtime Extension settings>
cluster:
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: test-cluster
Expand Down Expand Up @@ -130,7 +130,7 @@ apiVersion: hooks.runtime.cluster.x-k8s.io/v1alpha1
kind: BeforeClusterUpgradeRequest
settings: <Runtime Extension settings>
cluster:
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: test-cluster
Expand Down Expand Up @@ -179,7 +179,7 @@ apiVersion: hooks.runtime.cluster.x-k8s.io/v1alpha1
kind: AfterControlPlaneUpgradeRequest
settings: <Runtime Extension settings>
cluster:
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: test-cluster
Expand Down Expand Up @@ -216,7 +216,7 @@ apiVersion: hooks.runtime.cluster.x-k8s.io/v1alpha1
kind: AfterClusterUpgradeRequest
settings: <Runtime Extension settings>
cluster:
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: test-cluster
Expand Down Expand Up @@ -252,7 +252,7 @@ apiVersion: hooks.runtime.cluster.x-k8s.io/v1alpha1
kind: BeforeClusterDeleteRequest
settings: <Runtime Extension settings>
cluster:
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: test-cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Note: We enforce that variable conflicts have to be resolved by ClusterClass aut
Variables that are defined with external variable definitions can be set like regular variables in Cluster `.spec.topology.variables`.

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
#metadata
spec:
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/tasks/using-kustomize.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Add the following content to the `namereference.yaml` transformer configuration:
```yaml
- kind: Cluster
group: cluster.x-k8s.io
version: v1alpha3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this was really old! Nice catch!

version: v1beta2
fieldSpecs:
- path: spec/clusterName
kind: MachineDeployment
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/tasks/workload-bootstrap-gitops.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Follow the quickstart setup guide for your provider but ensure that CAAPH is ins
Add the labels `argoCDChart: enabled` and `guestbook: enabled` to your desired workload cluster yaml file in the `Cluster` metadata section, for example:

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: my-cluster
Expand Down
4 changes: 2 additions & 2 deletions docs/book/src/user/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ a target [management cluster] on the selected [infrastructure provider].
```bash
cat > kind-cluster-with-extramounts.yaml <<EOF
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
apiVersion: kind.x-k8s.io/v1beta2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kind.x-k8s.io/v1alpha4 should not be bumped (it is still the current API version for kind configuration)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same below

networking:
ipFamily: dual
nodes:
Expand Down Expand Up @@ -127,7 +127,7 @@ a target [management cluster] on the selected [infrastructure provider].
```bash
cat <<EOF > kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
apiVersion: kind.x-k8s.io/v1beta2
networking:
# the default CNI will not be installed
disableDefaultCNI: true
Expand Down