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
<li>Review the prequisites for installing Layer5 Cloud on Kubernetes. (<a href="#prerequisites">docs</a>)</li>
13
+
<li>Prepare INIT_CONFIG parameters for initial setup</li>
14
+
<li>Install Layer5 Cloud on Kubernetes using Helm. Deploy it's services in Kubernetes in-cluster. (<a href="#installation">docs</a>)</li>
15
+
<li>Meshery deployments are separate from <a href="https://docs.meshery.io/extensibility/providers">Remote Provider</a> deployments (Layer5 Cloud). Deploy Meshery in Kubernetes in-cluster (or out-of-cluster). (<a href="https://docs.meshery.io/installation/quick-start">docs</a>)</li>
16
+
<li>Configure Meshery Server point to your Remote Provider. Learn more about the Meshery Server registration process with Remote Providers. (<a href="https://docs.meshery.io/extensibility/providers#meshery-server-registration">docs</a>)</li>
17
+
</ol>
18
+
19
+
### Kubernetes-based Installation with Helm
20
+
21
+
Layer5 offers on-premises installation of its [Meshery Remote Provider](https://docs.meshery.io/extensibility/providers): Layer5 Cloud. Available in the [Layer5 Helm repository](https://docs.layer5.io/charts) is the layer5-cloud chart, which contains two subcharts. See the Helm repo [index](https://docs.layer5.io/charts/index.yaml) for details.
22
+
23
+
#### Prerequisites
24
+
25
+
Before you begin ensure the following are installed:
26
+
- Helm.
27
+
- An ingress controller like `ingress-nginx`.
28
+
- A certificate manager like `cert-manager`.
29
+
30
+
##### 1. Create dedicated namespaces
31
+
32
+
This deployment uses two namespaces, `cnpg-postgres` for hosting the PostgreSQL database using CloudNativePG operator and `layer5-cloud` namespace for the Layer5 Cloud. You can also choose to keep all components in the same namespace.
33
+
```bash
34
+
kubectl create ns cnpg-postgres
35
+
kubectl create ns layer5-cloud
36
+
```
37
+
38
+
##### 2. Prepare for data persistence (Persistent Volume)
39
+
40
+
Layer5 uses PostgreSQL database that requires a persistent storage. It can be configured in many different ways in a Kubernetes cluster. Here we are using _local path provisioner from Rancher_ which automatically creates a PV using a set local path. Running the follwing command to deploy the local path provisioner:
This creates a default storage class called `local-path` which stores data by default in `/opt/local-path-provisioner` and has the reclaim policy set to `Delete`.
47
+
48
+
> **_NOTE:_** It is recommended you create a new storage class that uses a different path with ample storage and uses `Retain` reclaim policy.
49
+
50
+
For this guide, we will use the defaults.
51
+
52
+
##### 3. Install an ingress controller
53
+
54
+
This example deployment uses ingress-nginx but you may choose to use an ingress controller of your choice.
The `INIT_CONFIG` environment variable allows you to configure the initial setup of your self-hosted Layer5 Cloud provider. This variable accepts a JSON string that defines the provider initialization configuration.
16
63
17
-
#### Purpose
64
+
#####Purpose
18
65
19
66
`INIT_CONFIG` enables you to:
20
67
- Pre-configure provider settings during deployment
21
68
- Automate initial setup for consistent deployments
22
69
- Define custom provider configurations without manual intervention
23
70
24
-
#### Usage
71
+
#####Usage
25
72
26
73
Set the `INIT_CONFIG` environment variable with a JSON configuration string:
27
74
@@ -48,92 +95,139 @@ env:
48
95
The INIT_CONFIG variable is only processed during the initial startup. Subsequent restarts will not reprocess this configuration.
49
96
{{< /alert >}}
50
97
51
-
#### Configuration Schema
98
+
##### Configuration Schema
52
99
53
100
The `INIT_CONFIG` JSON structure supports the following fields:
54
101
55
102
- `provider.name`: The name of your provider instance
56
103
- `provider.settings`: Custom provider settings specific to your deployment
57
104
58
105
59
-
<ol>
60
-
<li>Review the prequisites for installing Layer5 Cloud on Kubernetes. (<a href="#prerequisites">docs</a>)</li>
61
-
</li>
62
-
<li>Install Layer5 Cloud on Kubernetes using Helm. Deploy it's services in Kubernetes in-cluster. (<a href="#installation">docs</a>)</li>
63
-
<li>Meshery deployments are separate from <a href="https://docs.meshery.io/extensibility/providers">Remote Provider</a> deployments (Layer5 Cloud). Deploy Meshery in Kubernetes in-cluster (or out-of-cluster). (<a href="https://docs.meshery.io/installation/quick-start">docs</a>)</li>
64
-
<li>Configure Meshery Server point to your Remote Provider. Learn more about the Meshery Server registration process with Remote Providers. (<a href="https://docs.meshery.io/extensibility/providers#meshery-server-registration">docs</a>)</li>
65
-
</ol>
66
-
67
-
### Kubernetes-based Installation with Helm
106
+
#### Installation
68
107
69
-
Layer5 offers on-premises installation of its [Meshery Remote Provider](https://docs.meshery.io/extensibility/providers): Layer5 Cloud. Contained in the [Layer5 Helm repository](https://docs.layer5.io/charts) is one chart with two subcharts (see repo [index](https://docs.layer5.io/charts/index.yaml)).
108
+
You will install the Postgres database first or configure connection details to your existing Postgres v12+ database server, followed by the rest of Layer5 Cloud's containers.
70
109
71
-
#### Prerequisites
110
+
##### 1. Deploy PostgreSQL using CloudNativePG
72
111
73
-
##### 1. Prepare a Persistent Volume
112
+
In this example, we are using CloudNativePG's operator based approach to create a PostgreSQL cluster. You can choose a different approach of your choice.
74
113
75
-
A persistent volume to store the Postgres database is necessary to prepare prior to deployment. If your target cluster does not have a persistent volume readily available (or not configured for automatic PV provisioning and binding of PVCs to PV), we suggest to apply the following configuration to your cluster.
114
+
PostgreSQL requires persistent storage which can be configured in many different ways in a Kubernetes cluster. Here we are using _local path provisioner from Rancher_ which automatically creates a PV using a set local path. Running the follwing command to deploy the local path provisioner:
##### 2. Prepare a dedicated namespace and add the chart repo to your helm configuration
120
+
This creates a default storage class called `local-path` which stores data by default in `/opt/local-path-provisioner`. You can create a new storage class that uses a different path. For this deployment, we will use the defaults.
82
121
83
-
*You may choose to use an alternative namespace, but the following instructions assume the use of `layer5` namespace.*
122
+
Add and install CloudNativePG operator using the following commands:
The first service to install is the Postgres database. The following command installs the Postgres database and initializes it's dataset. The dataset is used by the Layer5 Cloud server and the Layer5 Cloud identity provider.
Layer5 Cloud `postgres` database requires [pg_cron](https://github.com/citusdata/pg_cron) extension to be enabled and configured to execute on a schedule. The Cloud instance is bundled with both Data Definition Language (DDL) to iniatilze the schema and with Data Manipulation Language (DML) that support both greenfield deployments and upgrades of existing deployments.
143
+
For this documentation, we use the following manifests to deploy a PostgreSQL cluster:
144
+
```yaml
145
+
# cluster.yaml
146
+
apiVersion: postgresql.cnpg.io/v1
147
+
kind: Cluster
148
+
metadata:
149
+
name: cnpg-postgres
150
+
namespace: cnpg-postgres
151
+
spec:
152
+
instances: 2
153
+
# Persistent storage configuration
154
+
storage:
155
+
storageClass: local-path
156
+
size: 10Gi
157
+
158
+
superuserSecret:
159
+
name: cnpg-superuser
160
+
bootstrap:
161
+
initdb:
162
+
database: meshery
163
+
owner: meshery
164
+
secret:
165
+
name: meshery-user
166
+
postInitSQL:
167
+
- create database hydra owner meshery;
168
+
- create database kratos owner meshery;
169
+
- create extension "uuid-ossp";
170
+
- ALTER ROLE meshery WITH SUPERUSER;
171
+
postInitApplicationSQLRefs:
172
+
configMapRefs:
173
+
- name: extra-init
174
+
key: init.sql
175
+
---
176
+
# extra-init.yaml
177
+
apiVersion: v1
178
+
kind: ConfigMap
179
+
metadata:
180
+
name: extra-init
181
+
namespace: cnpg-postgres
182
+
data:
183
+
init.sql: |
184
+
GRANT ALL PRIVILEGES ON DATABASE meshery to meshery;
185
+
GRANT ALL PRIVILEGES ON DATABASE hydra to meshery;
186
+
GRANT ALL PRIVILEGES ON DATABASE kratos to meshery;
187
+
```
103
188
104
-
##### 1. Install Postgres database
189
+
CloudNativePG provides a curated list of [samples](https://github.com/cloudnative-pg/cloudnative-pg/blob/main/docs/src/samples.md) showing configuration options that can be used as a reference.
105
190
191
+
Apply the YAML file. You should notice two cnpg pods shortly thereafter.
--set-file 'kratos.kratos.emailTemplates.recovery.valid.subject'=<path to the email templates to override>/valid/email-recover-subject.body.gotmpl \
119
-
--set-file 'kratos.kratos.emailTemplates.recovery.valid.body'=<path to the email templates to override>/valid/email-recover.body.gotmpl \
120
-
--set-file 'kratos.kratos.emailTemplates.verification.valid.subject'=<path to the email templates to override>/valid/email-verify-subject.body.gotmpl \
121
-
--set-file 'kratos.kratos.emailTemplates.verification.valid.body'=<path to the email templates to override>/valid/email-verify.body.gotmpl
0 commit comments