Skip to content

Commit a1e7dbf

Browse files
authored
Merge pull request #196 from jnummelin/fix/aws-docs
Add missing annotation for self managed AWSCluster infra
2 parents 4d0d1f2 + 35531d5 commit a1e7dbf

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

docs/capi-aws.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,17 @@ kind: AWSCluster
6363
metadata:
6464
name: k0s-aws-test
6565
namespace: default
66+
annotations:
67+
cluster.x-k8s.io/managed-by: k0smotron # This marks the base infra to be self managed. The value of the annotation is irrelevant, as long as there is a value.
6668
spec:
6769
region: eu-central-1
6870
sshKeyName: jhennig-key
6971
network:
7072
vpc:
7173
id: vpc-12345678901234567 # default VPCs ID
74+
subnets:
75+
- id: subnet-099730c9ea2e42134
76+
availabilityZone: eu-central-1a
7277
---
7378
apiVersion: cluster.x-k8s.io/v1beta1
7479
kind: Machine
@@ -118,7 +123,9 @@ spec:
118123
---
119124
```
120125

121-
Once you apply the manifests to the management cluster it'll take couple of minutes to provision everything. In the end you should see something like this:
126+
As we are using self-managed infrastructure we need to manually mark the infrastructure ready. This can be done with `kubectl patch AWSCluster k0s-aws-test --type=merge --subresource status --patch 'status: {ready: true}'`.
127+
128+
Once you apply the manifests to the management cluster and mark the infrastructure ready it'll take couple of minutes to provision everything. In the end you should see something like this:
122129

123130
```shell
124131
% kubectl get cluster,machine
@@ -131,4 +138,8 @@ machine.cluster.x-k8s.io/k0s-aws-test-0 k0s-aws-test aws:///eu-ce
131138

132139
## Accessing the workload cluster
133140

134-
To access the workload (a.k.a child) cluster we can get the kubeconfig for it with `clusterctl get kubeconfig k0s-aws-test`. You can then save it to disk and/or import to your favorite tooling like [Lens](https://k8slens.dev)
141+
To access the workload (a.k.a child) cluster we can get the kubeconfig for it with `clusterctl get kubeconfig k0s-aws-test`. You can then save it to disk and/or import to your favorite tooling like [Lens](https://k8slens.dev)
142+
143+
## Deleting the cluster
144+
145+
When deleting the cluster, do **NOT** use `kubectl delete -f my-aws-cluster.yaml` as that'll easily result into dangling AWS resources. Instead only delete the top level `Cluster` object. Deleting the top level `Cluster` object will propagate the deletion of all child resources and with a proper ordering.

0 commit comments

Comments
 (0)