Skip to content

Commit 368aae6

Browse files
authored
Docs and examples updated to v1beta2 (#1384)
Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com>
1 parent edebe5b commit 368aae6

44 files changed

Lines changed: 402 additions & 427 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,24 +306,21 @@ crdoc: $(CRDOC) ## Download crdoc locally if necessary. If wrong version is inst
306306
$(CRDOC): Makefile.variables | $(LOCALBIN)
307307
GOBIN=$(LOCALBIN) go install fybrik.io/crdoc@$(CRDOC_VERSION)
308308

309-
.PHONY: docs-generate-bootstrap docs-generate-controlplane docs-generate-infrastructure docs-generate-k0smotron-v1beta1 docs-generate-k0smotron-v1beta2 docs-generate-reference
309+
.PHONY: docs-generate-bootstrap docs-generate-controlplane docs-generate-infrastructure docs-generate-k0smotron-v1beta2 docs-generate-reference
310310
docs-generate-bootstrap: $(CRDOC) ## Generate docs for bootstrap CRDs
311-
$(CRDOC) --resources config/clusterapi/bootstrap/crd/bases --output docs/resource-reference/bootstrap.cluster.x-k8s.io-v1beta1.md
311+
$(CRDOC) --resources config/clusterapi/bootstrap/crd/bases --output docs/resource-reference/bootstrap.cluster.x-k8s.io-v1beta2.md
312312

313313
docs-generate-controlplane: $(CRDOC) ## Generate docs for controlplane CRDs
314-
$(CRDOC) --resources config/clusterapi/controlplane/crd/bases --output docs/resource-reference/controlplane.cluster.x-k8s.io-v1beta1.md
314+
$(CRDOC) --resources config/clusterapi/controlplane/crd/bases --output docs/resource-reference/controlplane.cluster.x-k8s.io-v1beta2.md
315315

316316
docs-generate-infrastructure: $(CRDOC) ## Generate docs for infrastructure CRDs
317317
$(CRDOC) --resources config/clusterapi/infrastructure/crd/bases --output docs/resource-reference/infrastructure.cluster.x-k8s.io-v1beta1.md
318318

319-
docs-generate-k0smotron-v1beta1: $(CRDOC) ## Generate docs for k0smotron CRDs
320-
$(CRDOC) --resources config/standalone/crd/bases --output docs/resource-reference/k0smotron.io-v1beta1.md
321-
322319
docs-generate-k0smotron-v1beta2: $(CRDOC) ## Generate docs for k0smotron CRDs
323320
$(CRDOC) --resources config/standalone/crd/bases --output docs/resource-reference/k0smotron.io-v1beta2.md
324321

325322
# Generate docs for all CRDs apis
326-
docs-generate-reference: docs-generate-bootstrap docs-generate-controlplane docs-generate-infrastructure docs-generate-k0smotron-v1beta1 docs-generate-k0smotron-v1beta2 ## Generate docs for all CRDs apis
323+
docs-generate-reference: docs-generate-bootstrap docs-generate-controlplane docs-generate-infrastructure docs-generate-k0smotron-v1beta2 ## Generate docs for all CRDs apis
327324

328325
## Generate all code, manifests, documentation, and release artifacts
329326
.PHONY: generate-all

config/samples/_v1beta1_k0smotroncluster.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: k0smotron.io/v1beta2
2+
kind: Cluster
3+
metadata:
4+
labels:
5+
app.kubernetes.io/name: cluster
6+
app.kubernetes.io/instance: sample
7+
app.kubernetes.io/part-of: k0smotron
8+
app.kubernetes.io/component: cluster
9+
app.kubernetes.io/managed-by: kustomize
10+
app.kubernetes.io/created-by: k0smotron
11+
name: sample
12+
spec:
13+
# Example etcd configuration
14+
storage:
15+
type: etcd
16+
etcd:
17+
# Default etcd image to use (required)
18+
image: quay.io/k0sproject/etcd:v3.5.13
19+
# etcd persistence settings
20+
persistence: {}
21+
# Specify resource requests and limits for etcd
22+
resources:
23+
requests:
24+
cpu: 100m
25+
memory: 128Mi
26+
limits:
27+
cpu: 200m
28+
memory: 256Mi

config/samples/bootstrap_v1beta1_k0sworkerconfig_with_secretmetadata.yaml renamed to config/samples/bootstrap_v1beta2_k0sworkerconfig_with_secretmetadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
1+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
22
kind: K0sWorkerConfig
33
metadata:
44
name: worker-config-with-metadata

config/samples/capi/capi-controlplane-hetzner.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: cluster.x-k8s.io/v1beta1
1+
apiVersion: cluster.x-k8s.io/v1beta2
22
kind: Cluster
33
metadata:
44
name: cp-test
@@ -11,15 +11,15 @@ spec:
1111
cidrBlocks:
1212
- 10.96.0.0/12
1313
controlPlaneRef:
14-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
14+
apiGroup: controlplane.cluster.x-k8s.io
1515
kind: K0smotronControlPlane # This would somehow map to k0smotron
1616
name: cp-test
1717
infrastructureRef:
18-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
18+
apiGroup: infrastructure.cluster.x-k8s.io
1919
kind: HetznerCluster
2020
name: cp-test
2121
---
22-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
22+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
2323
kind: K0smotronControlPlane # This would somehow map to k0smotron
2424
metadata:
2525
name: cp-test
@@ -34,7 +34,7 @@ spec:
3434
annotations:
3535
load-balancer.hetzner.cloud/location: fsn1
3636
---
37-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
37+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
3838
kind: HetznerCluster
3939
metadata:
4040
name: cp-test
@@ -51,24 +51,24 @@ spec:
5151
key:
5252
hcloudToken: hcloud
5353
---
54-
apiVersion: cluster.x-k8s.io/v1beta1
54+
apiVersion: cluster.x-k8s.io/v1beta2
5555
kind: Machine
5656
metadata:
5757
name: cp-test-0
5858
spec:
5959
clusterName: cp-test
6060
bootstrap:
6161
configRef: # This triggers our controller to create cloud-init secret
62-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
62+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
6363
kind: K0sWorkerConfig
6464
name: cp-test-0
6565
infrastructureRef:
66-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
66+
apiGroup: infrastructure.cluster.x-k8s.io
6767
kind: HCloudMachine
6868
name: cp-test-0
6969

7070
---
71-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
71+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
7272
kind: HCloudMachine
7373
metadata:
7474
name: cp-test-0
@@ -78,7 +78,7 @@ spec:
7878
sshKeys:
7979
- name: jnummelin@mirantis.com
8080
---
81-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
81+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
8282
kind: K0sWorkerConfig
8383
metadata:
8484
name: cp-test-0

config/samples/capi/docker/cluster-with-machinedeployment.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: cluster.x-k8s.io/v1beta1
1+
apiVersion: cluster.x-k8s.io/v1beta2
22
kind: Cluster
33
metadata:
44
name: docker-md-test
@@ -13,15 +13,15 @@ spec:
1313
cidrBlocks:
1414
- 10.128.0.0/12
1515
controlPlaneRef:
16-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
16+
apiGroup: controlplane.cluster.x-k8s.io
1717
kind: K0smotronControlPlane
1818
name: docker-md-test
1919
infrastructureRef:
20-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
20+
apiGroup: infrastructure.cluster.x-k8s.io
2121
kind: DockerCluster
2222
name: docker-md-test
2323
---
24-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
24+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
2525
kind: K0smotronControlPlane
2626
metadata:
2727
name: docker-md-test
@@ -32,14 +32,14 @@ spec:
3232
service:
3333
type: NodePort
3434
---
35-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
35+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
3636
kind: DockerCluster
3737
metadata:
3838
name: docker-md-test
3939
namespace: default
4040
spec:
4141
---
42-
apiVersion: cluster.x-k8s.io/v1beta1
42+
apiVersion: cluster.x-k8s.io/v1beta2
4343
kind: MachineDeployment
4444
metadata:
4545
name: docker-md-test
@@ -61,15 +61,15 @@ spec:
6161
clusterName: docker-md-test
6262
bootstrap:
6363
configRef:
64-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
64+
apiGroup: bootstrap.cluster.x-k8s.io
6565
kind: K0sWorkerConfigTemplate
6666
name: docker-md-test
6767
infrastructureRef:
68-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
68+
apiGroup: infrastructure.cluster.x-k8s.io
6969
kind: DockerMachineTemplate
7070
name: docker-md-test
7171
---
72-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
72+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
7373
kind: K0sWorkerConfigTemplate
7474
metadata:
7575
name: docker-md-test
@@ -79,7 +79,7 @@ spec:
7979
spec:
8080
version: v1.27.2+k0s.0
8181
---
82-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
82+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
8383
kind: DockerMachineTemplate
8484
metadata:
8585
name: docker-md-test

config/samples/capi/docker/docker-cluster.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: cluster.x-k8s.io/v1beta1
1+
apiVersion: cluster.x-k8s.io/v1beta2
22
kind: Cluster
33
metadata:
44
name: docker-test
@@ -13,15 +13,15 @@ spec:
1313
cidrBlocks:
1414
- 10.128.0.0/12
1515
controlPlaneRef:
16-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
16+
apiGroup: controlplane.cluster.x-k8s.io
1717
kind: K0smotronControlPlane
1818
name: docker-test
1919
infrastructureRef:
20-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
20+
apiGroup: infrastructure.cluster.x-k8s.io
2121
kind: DockerCluster
2222
name: docker-test
2323
---
24-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
24+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
2525
kind: K0smotronControlPlane
2626
metadata:
2727
name: docker-test
@@ -32,14 +32,14 @@ spec:
3232
service:
3333
type: NodePort
3434
---
35-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
35+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
3636
kind: DockerCluster
3737
metadata:
3838
name: docker-test
3939
namespace: default
4040
spec:
4141
---
42-
apiVersion: cluster.x-k8s.io/v1beta1
42+
apiVersion: cluster.x-k8s.io/v1beta2
4343
kind: Machine
4444
metadata:
4545
name: docker-test-0
@@ -48,23 +48,23 @@ spec:
4848
clusterName: docker-test
4949
bootstrap:
5050
configRef:
51-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
51+
apiGroup: bootstrap.cluster.x-k8s.io
5252
kind: K0sWorkerConfig
5353
name: docker-test-0
5454
infrastructureRef:
55-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
55+
apiGroup: infrastructure.cluster.x-k8s.io
5656
kind: DockerMachine
5757
name: docker-test-0
5858
---
59-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
59+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
6060
kind: K0sWorkerConfig
6161
metadata:
6262
name: docker-test-0
6363
namespace: default
6464
spec:
6565
version: v1.27.2+k0s.0
6666
---
67-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
67+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
6868
kind: DockerMachine
6969
metadata:
7070
name: docker-test-0

config/samples/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
## Append samples of your project ##
22
resources:
3-
- _v1beta1_k0smotroncluster.yaml
3+
- _v1beta2_k0smotroncluster.yaml
44
#+kubebuilder:scaffold:manifestskustomizesamples

docs/capi-adoption.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Create the `Cluster`, `K0sControlPlane`, `RemoteCluster`, and `RemoteMachineTemp
139139
The `RemoteMachineTemplate` is referenced by `K0sControlPlane.spec.machineTemplate` and defines the pool from which k0smotron draws machines when scaling or replacing control plane nodes. The existing nodes are represented by direct `Machine` and `RemoteMachine` objects (Steps 6–7), not by this pool.
140140

141141
```yaml
142-
apiVersion: cluster.x-k8s.io/v1beta1
142+
apiVersion: cluster.x-k8s.io/v1beta2
143143
kind: Cluster
144144
metadata:
145145
name: my-cluster
@@ -159,15 +159,15 @@ spec:
159159
host: 1.2.3.4 # replace with your control plane endpoint
160160
port: 6443
161161
controlPlaneRef:
162-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
162+
apiGroup: controlplane.cluster.x-k8s.io
163163
kind: K0sControlPlane
164164
name: my-cluster
165165
infrastructureRef:
166-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
166+
apiGroup: infrastructure.cluster.x-k8s.io
167167
kind: RemoteCluster
168168
name: my-cluster
169169
---
170-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
170+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
171171
kind: K0sControlPlane
172172
metadata:
173173
name: my-cluster
@@ -181,10 +181,9 @@ spec:
181181
k0sConfigSpec: {}
182182
machineTemplate:
183183
infrastructureRef:
184-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
184+
apiGroup: infrastructure.cluster.x-k8s.io
185185
kind: RemoteMachineTemplate
186186
name: my-cluster-cp-template
187-
namespace: default
188187
---
189188
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
190189
kind: RemoteCluster
@@ -257,7 +256,7 @@ Setting `spec.bootstrap.dataSecretName` to the kubeconfig Secret tells CAPI that
257256

258257
```yaml
259258
# Repeat this block for each control plane node, changing the name and providerID
260-
apiVersion: cluster.x-k8s.io/v1beta1
259+
apiVersion: cluster.x-k8s.io/v1beta2
261260
kind: Machine
262261
metadata:
263262
name: my-cluster-cp-0
@@ -270,7 +269,7 @@ metadata:
270269
cluster.x-k8s.io/control-plane-name: my-cluster
271270
k0smotron.io/control-plane-worker-enabled: "true" # omit if CP nodes do not run workloads
272271
ownerReferences:
273-
- apiVersion: controlplane.cluster.x-k8s.io/v1beta1
272+
- apiVersion: controlplane.cluster.x-k8s.io/v1beta2
274273
kind: K0sControlPlane
275274
name: my-cluster
276275
uid: ${KCP_UID} # substitute with the value from above
@@ -283,7 +282,7 @@ spec:
283282
bootstrap:
284283
dataSecretName: my-cluster-kubeconfig # marks machine as already bootstrapped
285284
infrastructureRef:
286-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
285+
apiGroup: infrastructure.cluster.x-k8s.io
287286
kind: RemoteMachine
288287
name: my-cluster-cp-0
289288
```
@@ -436,7 +435,7 @@ Create a paused `Machine` and `RemoteMachine` for each worker node:
436435

437436
```yaml
438437
# Repeat for each worker node, changing name, providerID and address
439-
apiVersion: cluster.x-k8s.io/v1beta1
438+
apiVersion: cluster.x-k8s.io/v1beta2
440439
kind: Machine
441440
metadata:
442441
name: my-cluster-worker-0
@@ -452,7 +451,7 @@ spec:
452451
bootstrap:
453452
dataSecretName: my-cluster-kubeconfig # marks machine as already bootstrapped
454453
infrastructureRef:
455-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
454+
apiGroup: infrastructure.cluster.x-k8s.io
456455
kind: RemoteMachine
457456
name: my-cluster-worker-0
458457
---

0 commit comments

Comments
 (0)