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: content/en/cloud/self-hosted/planning/_index.md
+101-1Lines changed: 101 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,106 @@ Before deploying, plan your configuration approach:
17
17
3.**Configuration Management**: Decide how configuration will be managed (environment variables, secrets, config files)
18
18
4.**Update Strategy**: Plan for configuration updates and changes over time
19
19
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:
**Option C (Direct environment variable)**: Set the `INIT_CONFIG` environment variable with the YAML content as a string
119
+
20
120
### Using INIT_CONFIG for Automated Setup
21
121
22
122
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
25
125
- **CI/CD Integration**: Automate deployments with predefined configurations
26
126
- **Infrastructure as Code**: Manage provider configuration alongside your infrastructure
27
127
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.
29
129
30
130
{{< alert type="warning" title="Important" >}}
31
131
Plan your INIT_CONFIG carefully as it is only processed during initial startup. Changes require redeployment or manual configuration updates.
0 commit comments