@@ -5,10 +5,66 @@ RMK uses [Terraform](https://www.terraform.io/) and [K3D](https://k3d.io) for cl
5
5
RMK is suitable for both simple and complex Kubernetes deployments, enabling multi-level project inheritance through native Helmfile functionality.
6
6
7
7
The 2 scenarios are:
8
- - ** A cluster has already been provisioned:** An existing Kubernetes context will be used by RMK.
9
- - ** A cluster will be provisioned from scratch using RMK** : Any of the supported cluster provider like AWS, K3D etc. will be utilized.
8
+ - ** A cluster has already been provisioned via a 3rd-party tool/service :** An existing Kubernetes context will be used by RMK.
9
+ - ** A cluster will be provisioned from scratch using RMK** : Any of the supported cluster providers for RMK, such as AWS, K3D, etc. will be utilized.
10
10
11
- ## RMK cluster providers
11
+ ## Switch the context to an existing Kubernetes cluster
12
+
13
+ Switching to an existing Kubernetes cluster depends on how it has been provisioned:
14
+
15
+ * ** Using a 3rd party tool:**
16
+
17
+ Create a context with the name matching the pattern:
18
+
19
+ ```
20
+ ^<project_name>-<environment>\b
21
+ ```
22
+
23
+ > The matching is ** case-insensitive** . \
24
+ > ` ^ ` means the beginning of text or a line. \
25
+ > ` \b ` means the ** ASCII word boundary** (` \w ` on one side and ` \W ` , ` \A ` , or ` \z ` on the other).
26
+
27
+ For example, if you are in the ` project1 ` repository in the ` develop ` branch, the following Kubernetes contexts might be accepted:
28
+
29
+ ```
30
+ project1-develop
31
+ PROJECT1-DEVELOP
32
+ project1-develop-eks
33
+ PROJECT1-DEVELOP-EKS
34
+ ```
35
+
36
+ * ** Using RMK cluster provider** :
37
+
38
+ Checkout to the branch from which the K8S cluster was previously created.
39
+
40
+ An [ initialization] ( ../rmk-configuration-management.md#initialization-of-rmk-configuration ) might be required,
41
+ if the RMK configuration for this cluster has not been created before:
42
+ ``` shell
43
+ rmk config init
44
+ ```
45
+
46
+ The next command depends on whether a remote cluster provider (e.g., AWS) or a local one (e.g., K3D) has been used:
47
+
48
+ * ** AWS:**
49
+
50
+ ``` shell
51
+ # --force might required to refresh the credentials after a long period of inactivity
52
+ rmk cluster switch --force
53
+ ```
54
+
55
+ * ** K3D:**
56
+
57
+ ` ` ` shell
58
+ rmk cluster switch
59
+ ` ` `
60
+
61
+ Finally, run an RMK release command to verify the preparation of the Kubernetes context, e.g.:
62
+
63
+ ` ` ` shell
64
+ rmk release list
65
+ ` ` `
66
+
67
+ # # Use RMK cluster providers to provision and destroy Kubernetes clusters
12
68
13
69
Currently, the following cluster providers are supported by RMK:
14
70
- [aws.provisioner.infra](https://github.com/edenlabllc/aws.provisioner.infra): Configuration for managing AWS EKS
@@ -88,16 +144,6 @@ To destroy a Kubernetes cluster, run the command:
88
144
rmk cluster destroy
89
145
` ` `
90
146
91
- #### Switch the kubectl context to an already created K8S cluster
92
-
93
- Checkout to the branch from which the K8S cluster was previously created, then run the following commands:
94
-
95
- ``` shell
96
- # required if the RMK configuration for this cluster has not been created before
97
- rmk config init
98
- rmk cluster switch --force
99
- ```
100
-
101
147
# ## Create or delete K3D Kubernetes clusters
102
148
103
149
RMK supports managing single-node Kubernetes clusters using [K3D](https://k3d.io).
0 commit comments