Skip to content

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

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
6 changes: 3 additions & 3 deletions docs/book/src/security/pod-security-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ By adding the following variables and patches Pod Security Standards can be adde
### Adding the variables to a ClusterClass

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: ClusterClass
spec:
variables:
Expand Down Expand Up @@ -62,7 +62,7 @@ Use this patch if the following keys **already exist** inside the `KubeadmContro
- `.spec.template.spec.kubeadmConfigSpec.files`

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: ClusterClass
spec:
...
Expand Down Expand Up @@ -128,7 +128,7 @@ Use this patches if the following keys **do not** exist inside the `KubeadmContr
> **Attention:** Existing values inside the `KubeadmControlPlaneTemplate` at the mentioned keys will be replaced by this patch.

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: ClusterClass
spec:
...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,15 @@ This means in the following example the Cluster topology controller will always
patches for the infrastructure ref, even if the `DockerClusterTemplate` already has a `v1beta2` apiVersion.

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: ClusterClass
metadata:
name: quick-start
namespace: default
spec:
infrastructure:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
templateRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerClusterTemplate
...
```
Expand All @@ -307,14 +307,14 @@ apiVersion of the referenced CRD. The following example shows how to upgrade the

ClusterClass with the old apiVersion:
```yaml
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: ClusterClass
metadata:
name: quick-start
spec:
infrastructure:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
templateRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerClusterTemplate
...
patches:
Expand All @@ -334,13 +334,13 @@ spec:

ClusterClass with the new apiVersion:
```yaml
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: ClusterClass
metadata:
name: quick-start
spec:
infrastructure:
ref:
templateRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 # apiVersion updated
kind: DockerClusterTemplate
...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,34 @@ metadata:
name: docker-clusterclass-v0.1.0
spec:
controlPlane:
ref:
templateRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
kind: KubeadmControlPlaneTemplate
name: docker-clusterclass-v0.1.0
namespace: default
machineInfrastructure:
ref:
templateRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerMachineTemplate
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
name: docker-clusterclass-v0.1.0
namespace: default
infrastructure:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
templateRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerClusterTemplate
name: docker-clusterclass-v0.1.0-control-plane
namespace: default
workers:
machineDeployments:
- class: default-worker
template:
bootstrap:
ref:
templateRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
kind: KubeadmConfigTemplate
name: docker-clusterclass-v0.1.0-default-worker
namespace: default
infrastructure:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
templateRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerMachineTemplate
name: docker-clusterclass-v0.1.0-default-worker
namespace: default
```

The following example shows a Cluster using this ClusterClass. In this case a `KubeadmControlPlane`
Expand Down Expand Up @@ -144,13 +139,13 @@ spec:
- class: default-worker
template:
bootstrap:
ref:
templateRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
kind: KubeadmConfigTemplate
name: quick-start-default-worker-bootstraptemplate
infrastructure:
ref:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
templateRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerMachinePoolTemplate
name: quick-start-default-worker-machinepooltemplate
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ External variable definitions are discovered by calling the DiscoverVariables ru
Once discovered the variable definitions are validated and stored in ClusterClass status.

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: ClusterClass
# metadata
spec:
Expand Down