You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/capi-aws.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,12 +63,17 @@ kind: AWSCluster
63
63
metadata:
64
64
name: k0s-aws-test
65
65
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.
66
68
spec:
67
69
region: eu-central-1
68
70
sshKeyName: jhennig-key
69
71
network:
70
72
vpc:
71
73
id: vpc-12345678901234567 # default VPCs ID
74
+
subnets:
75
+
- id: subnet-099730c9ea2e42134
76
+
availabilityZone: eu-central-1a
72
77
---
73
78
apiVersion: cluster.x-k8s.io/v1beta1
74
79
kind: Machine
@@ -118,7 +123,9 @@ spec:
118
123
---
119
124
```
120
125
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:
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