Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
Signed-off-by: JeffMboya <[email protected]>
  • Loading branch information
JeffMboya committed Sep 25, 2024
1 parent ead3498 commit ff62d01
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions scripts/vault/vault.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## How to Install and Configure `vault` with `certs`

### Prerequisites:

1. **Kubernetes Configuration**: Ensure your `KUBECONFIG` is set up to point to the Kubernetes cluster where you want to deploy `vault`. This can typically be done by running:
```bash
export KUBECONFIG=/path/to/your/kubeconfig
Expand All @@ -10,6 +11,7 @@
### Step 1: Install `vault` using Helm

1. **Navigate to the `magistrala` Helm chart directory**:

```bash
cd charts/magistrala
```
Expand All @@ -18,15 +20,24 @@
```bash
helm upgrade magistrala . -n mg --set vault.enabled=true
```
This command uses Helm to upgrade (or install) the `magistrala` release in the `mg` namespace with `vault` enabled.
This command uses Helm to upgrade (or install) the `magistrala` release in the `mg` namespace with `vault` enabled.

### Step 2: Initialize `vault`

1. **Navigate to the `vault` scripts directory**:
1. **Navigate to the `vault` Scripts Directory**:

If you are currently in the `charts/magistrala` directory, go up two levels to the root and then to the `vault` scripts directory by running:

```bash
cd ../../scripts/vault
```

If you are at the root of the repository, navigate to the `vault` scripts directory directly by running:

```bash
cd scripts/vault
```

2. **Run the `vault_init.sh` script**:
```bash
./vault_init.sh
Expand All @@ -36,12 +47,15 @@ This command uses Helm to upgrade (or install) the `magistrala` release in the `
### Step 3: Enable the `certs` Service and Apply Configuration

1. **Load Environment Variables**:

```bash
source .env
```
This command loads environment variables from the `.env` file into your current shell session. These variables are required for the next step to configure the `certs` service.

This command loads environment variables from the `.env` file into your current shell session. These variables are required for the next step to configure the `certs` service.

2. **Navigate back to the `magistrala` Helm chart directory**:

```bash
cd ../../charts/magistrala
```
Expand All @@ -52,5 +66,5 @@ This command uses Helm to upgrade (or install) the `magistrala` release in the `
--set certs.vault.url=$MG_VAULT_ADDR \
--set certs.vault.approleRoleid=$MG_VAULT_THINGS_CERTS_ISSUER_ROLEID \
--set certs.vault.approleSecret=$MG_VAULT_THINGS_CERTS_ISSUER_SECRET \
--set certs.vault.namespace=$MG_VAULT_NAMESPACE
--set certs.vault.namespace=$MG_VAULT_NAMESPACE
```

0 comments on commit ff62d01

Please sign in to comment.