Skip to content

Commit b76bdfa

Browse files
docs(cloud): update deployment guide headings and add comprehensive YAML config details
Co-authored-by: pontusringblom <170570911+pontusringblom@users.noreply.github.com>
1 parent 30615c4 commit b76bdfa

File tree

2 files changed

+103
-2
lines changed

2 files changed

+103
-2
lines changed

content/en/cloud/self-hosted/deployment/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ weight: 2
88

99
## High-level List of Deployment Tasks
1010

11-
## Environment Variables
11+
## High-level List of Deployment Tasks
1212

1313
### INIT_CONFIG
1414

@@ -32,6 +32,7 @@ export INIT_CONFIG='{"provider": {"name": "my-provider", "settings": {...}}}'
3232
For Docker deployments:
3333

3434
```bash
35+
# example
3536
docker run -e INIT_CONFIG='{"provider": {"name": "my-provider"}}' layer5/meshery-cloud
3637
```
3738

content/en/cloud/self-hosted/planning/_index.md

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,106 @@ Before deploying, plan your configuration approach:
1717
3. **Configuration Management**: Decide how configuration will be managed (environment variables, secrets, config files)
1818
4. **Update Strategy**: Plan for configuration updates and changes over time
1919

20+
### Provider Admin Organization Initialization
21+
22+
The Provider Admin organization is a special organization identified by the hardcoded UUID `11111111-1111-1111-1111-111111111111`. It represents the root administrative organization for the cloud platform.
23+
24+
#### Configuration Format
25+
26+
The `INIT_CONFIG` environment variable accepts a YAML configuration with the following structure:
27+
28+
```yaml
29+
organization:
30+
name: "Layer5"
31+
description: "The uber organization for all things Layer5."
32+
country: "United States"
33+
region: "North America"
34+
35+
user:
36+
first_name: "Admin"
37+
last_name: "User"
38+
email: "admin@layer5.io"
39+
username: "admin@layer5.io" # Optional, defaults to email if not provided
40+
password: "change-me-on-first-login" # Required
41+
```
42+
43+
#### Setting the Environment Variable
44+
45+
To enable Provider Admin organization initialization, set the `INIT_CONFIG` environment variable with the entire YAML configuration as its value:
46+
47+
```bash
48+
INIT_CONFIG='organization:
49+
name: "Layer5"
50+
description: "The uber organization for all things Layer5."
51+
country: "United States"
52+
region: "North America"
53+
54+
user:
55+
first_name: "Admin"
56+
last_name: "User"
57+
email: "admin@layer5.io"
58+
username: "admin@layer5.io"
59+
password: "change-me-on-first-login"'
60+
```
61+
62+
#### Required and Optional Fields
63+
64+
**Organization:**
65+
- `name`: Name of the provider organization (required)
66+
- `description`: Description of the organization (optional)
67+
- `country`: Country where the organization is located (optional)
68+
- `region`: Region where the organization is located (optional)
69+
70+
**User:**
71+
- `first_name`: First name of the provider admin user (required)
72+
- `last_name`: Last name of the provider admin user (required)
73+
- `email`: Email address of the provider admin user (required)
74+
- `username`: Username for the provider admin user (optional, defaults to email)
75+
- `password`: Password for the provider admin user (required)
76+
77+
#### Initialization Process
78+
79+
When the server starts and `INIT_CONFIG` is set:
80+
81+
1. The YAML configuration is parsed and validated
82+
2. The system checks if the provider organization already exists (by UUID `11111111-1111-1111-1111-111111111111`)
83+
3. If the organization exists, initialization is skipped
84+
4. If the organization does not exist:
85+
- Kratos identity is created with password credentials for authentication
86+
- Provider admin user is created
87+
- Admin and MeshMap roles are assigned to the user
88+
- Provider organization is created with the hardcoded UUID
89+
- User is added to the provider organization with organization admin role
90+
91+
#### Idempotency
92+
93+
The initialization process is idempotent:
94+
- Running the server multiple times with the same configuration will not create duplicate organizations
95+
- If the provider organization already exists, the initialization is skipped
96+
- No errors are thrown if the organization already exists
97+
98+
#### Error Handling
99+
100+
If initialization fails:
101+
- Errors are logged using MeshKit logger
102+
- The server continues to start (non-fatal error)
103+
- All database operations are wrapped in a transaction for atomicity
104+
- If any step fails, all changes are rolled back
105+
106+
### Deployment Options
107+
108+
You can set the `INIT_CONFIG` environment variable using several methods:
109+
110+
**Option A (Helm with inline values)**: Include `initConfig` in the Helm `values.yaml` file with the YAML configuration as a multiline string
111+
112+
**Option B (Helm with --set-file flag)**: Use `--set-file` to load configuration from a separate file:
113+
```bash
114+
helm install meshery-cloud ./install/kubernetes/helm/layer5-cloud \
115+
--set-file env.initConfig=./config/provider-init.yaml.example
116+
```
117+
118+
**Option C (Direct environment variable)**: Set the `INIT_CONFIG` environment variable with the YAML content as a string
119+
20120
### Using INIT_CONFIG for Automated Setup
21121

22122
The `INIT_CONFIG` environment variable allows you to pre-configure your provider during deployment, eliminating manual setup steps. This is particularly valuable for:
@@ -25,7 +125,7 @@ The `INIT_CONFIG` environment variable allows you to pre-configure your provider
25125
- **CI/CD Integration**: Automate deployments with predefined configurations
26126
- **Infrastructure as Code**: Manage provider configuration alongside your infrastructure
27127

28-
For detailed usage and examples, see the [Deployment Guide](/cloud/self-hosted/deployment/#init_config).
128+
For detailed configuration options, see the configuration schema below.
29129

30130
{{< alert type="warning" title="Important" >}}
31131
Plan your INIT_CONFIG carefully as it is only processed during initial startup. Changes require redeployment or manual configuration updates.

0 commit comments

Comments
 (0)