Skip to content

Commit f42d58d

Browse files
committed
#8 - Improve RMK context switch documentation.
1 parent 8b082ad commit f42d58d

File tree

5 files changed

+65
-19
lines changed

5 files changed

+65
-19
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Release](https://img.shields.io/github/v/release/edenlabllc/rmk.svg?style=for-the-badge)](https://github.com/edenlabllc/rmk/releases/latest)
44
[![Software License](https://img.shields.io/github/license/edenlabllc/rmk.svg?style=for-the-badge)](LICENSE)
5-
[![Powered By: GoReleaser](https://img.shields.io/badge/powered%20by-edenlab-8A2BE2.svg?style=for-the-badge)](https://edenlab.io)
5+
[![Powered By: Edenlab](https://img.shields.io/badge/powered%20by-edenlab-8A2BE2.svg?style=for-the-badge)](https://edenlab.io)
66

77
Command line tool for reduced management and provisioning of Kubernetes clusters and environments, Helm secrets and releases.
88

commands/project_generation_category.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ helmfiles: ` + escapeOpen + `{{ env "HELMFILE_` + escapeClose + `{{ .TenantNameE
112112
helmfileCommonLabels = `commonLabels:
113113
scope: {{ .TenantName }}
114114
namespace: {{ .TenantName }}
115-
bin: ` + escapeOpen + `{{ env "HELMFILE_` + escapeClose + `{{ .TenantNameEnvStyle }}` + escapeOpen + `_HOOKS_DIR" | default (env "HELMFILE_HOOKS_DIR") }}/bin` + escapeClose + `
115+
bin: ` + escapeOpen + `{{ env "HELMFILE_` + escapeClose + `{{ .TenantNameEnvStyle }}` + escapeOpen + `_HOOKS_DIR" }}/bin` + escapeClose + `
116116
repo: core-charts
117117
appChartVersion: 1.6.0
118118
host: ` + escapeOpen + `{{ env "ROOT_DOMAIN" }}` + escapeClose + `

docs/configuration/cluster-management/cluster-management.md

+59-13
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,66 @@ RMK uses [Terraform](https://www.terraform.io/) and [K3D](https://k3d.io) for cl
55
RMK is suitable for both simple and complex Kubernetes deployments, enabling multi-level project inheritance through native Helmfile functionality.
66

77
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.
1010

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
1268

1369
Currently, the following cluster providers are supported by RMK:
1470
- [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:
88144
rmk cluster destroy
89145
```
90146

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-
101147
### Create or delete K3D Kubernetes clusters
102148

103149
RMK supports managing single-node Kubernetes clusters using [K3D](https://k3d.io).

docs/configuration/rmk-configuration-management.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# RMK configuration management
22

33
To start working with Kubernetes clusters, RMK needs to initialize the configuration for the current environment.
4-
At the time of configuration initialization launch, the RMK prepares
4+
At the time of configuration initialization launch, RMK prepares
55
the state in the form of the current environment config with all the required attributes for further work.
66
It also downloads and resolves and installs all necessary dependencies and tools described
77
in the [project.yaml](project-management/preparation-of-project-repository.md#projectyaml) file in the root of the project repository.
@@ -50,9 +50,9 @@ based on their values. Otherwise, the interactive mode will begin.
5050

5151
### Support for Multi-Factor Authentication (MFA)
5252

53-
The RMK automatically check for an MFA device, when the following command is executed: `rmk config init`.
53+
RMK automatically check for an MFA device, when the following command is executed: `rmk config init`.
5454

55-
To setup an MFA device, if it is required by the administrator, the following actions should be executed:
55+
To set up an MFA device, if it is required by the administrator, the following actions should be executed:
5656

5757
1. First, sign in to the AWS Management Console.
5858
2. Then, go to the following page to set up security

docs/configuration/secrets-management/secrets-management.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ needed for secrets encryption or decryption.
6464

6565
## Generating all secrets from scratch in a batch manner using the RMK secrets manager
6666

67-
In case of a creating tenant from scratch all the needed directories like `etc/<scope>/<env>/secrets/` should first
67+
In case of a creating tenant from scratch all the needed directories, such as `etc/<scope>/<env>/secrets/` should first
6868
be populated with an empty `.sops.yaml` file (acts as an indicator that this scope and environment will have the secrets).
6969
Also, before generating the secret files, you must create or complete a secret `.spec.yaml.gotmpl` file per each scope.
7070
`.spec.yaml.gotmpl` is a template that runs the [sprig](https://masterminds.github.io/sprig) engine with additional functions.

0 commit comments

Comments
 (0)