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
@@ -17,61 +17,8 @@ This repository is used to store infrastructure code for deploying OpenCRVS.
17
17
18
18
---
19
19
20
-
# Running OpenCRVS on Kubernetes
21
-
22
-
## Prerequisites for Kubernetes Cluster
23
-
24
-
### Storage
25
-
26
-
Ensure your cluster has a storage class with encryption, or encryption is implemented at the filesystem level:
27
-
28
-
-**For existing OpenCRVS installations:**
29
-
Make sure the cluster has at least the `hostpath` storage class configured and directories on the filesystem should point to encrypted partitions.
30
-
`hostpath` is the best option for migration from Docker Swarm to Kubernetes; it allows data to remain untouched. Data can be migrated to more robust storage later, such as `local` or `nfs` volumes after OpenCRVS migration to Kubernetes.
31
-
32
-
-**For new installations:**
33
-
- Please check the available storage options in the official documentation: [Kubernetes Volumes Documentation](https://kubernetes.io/docs/concepts/storage/volumes/) and [Kubernetes Storage Classes Documentation](https://kubernetes.io/docs/concepts/storage/storage-classes/#provisioner).
34
-
- The recommended storage class for new installations is NFS.
35
-
36
-
Additionally, explore all possible options for CSI (Container Storage Interface) at the [CSI GitHub repository](https://github.com/kubernetes-csi/).
37
-
38
-
**NOTE:** Depending on your available hardware resources, you may optimize the installation by splitting data across different types of volumes. For example:
39
-
-`Hostpath` works better for Elasticsearch.
40
-
-`NFS` is the best option for MinIO and Mongo (or Postgres).
41
-
42
-
---
43
-
44
-
45
-
## [🚧 ] Manual deployment guide
46
-
47
-
1. Create yaml file with custom values for your installation:
48
-
```yaml
49
-
# Kubernetes load balancer domain used by traefik as entrypoint
50
-
hostname: opencrvs.<you domain>
51
-
# OpenCRVS Core image tag
52
-
image:
53
-
tag: local
54
-
# Your country image repository and tag
55
-
countryconfig:
56
-
image:
57
-
name: opencrvs/ocrvs-countryconfig
58
-
tag: develop
59
-
```
60
-
2. Add helm repository:
61
-
```
62
-
helm repo add ...
63
-
```
64
-
3. Install OpenCRVS:
65
-
```
66
-
helm install ... opencrvs
67
-
```
68
-
**NOTE:** Data seed will run only on `install`, don't use `update --install`.
69
-
70
-
# [🚧 Coming soon] Server environment migration
71
-
72
-
TODO: Migration from docker swarm to kubernetes guide
73
20
74
-
# Development with Kubernetes
21
+
# Developing OpenCRVS with Kubernetes
75
22
76
23
## Prerequisites
77
24
@@ -112,7 +59,7 @@ You need to clone the [opencrvs-core](https://github.com/opencrvs/opencrvs-core)
112
59
```
113
60
6. [Temporary Step] Switch to the k8s-version branch:
114
61
```bash
115
-
git checkout k8s-version
62
+
git checkout k8s-refresh
116
63
```
117
64
7. Run Tilt:
118
65
```bash
@@ -123,27 +70,55 @@ You need to clone the [opencrvs-core](https://github.com/opencrvs/opencrvs-core)
123
70
124
71
---
125
72
126
-
## [🚧 Coming soon] For OpenCRVS Country Configuration Developers
73
+
## For OpenCRVS Country Config Developers
127
74
128
-
You need to fork the [opencrvs-countryconfig](https://github.com/opencrvs/opencrvs-countryconfig) repository and clone the [infrastructure](https://github.com/opencrvs/infrastructure) repository. If these repositories are already on your laptop, ensure they are in the same folder.
75
+
Please follow official documentation how to setup your own country configuration at [Set-up your own, local, country configuration](https://documentation.opencrvs.org/setup/3.-installation/3.2-set-up-your-own-country-configuration).
76
+
You need to fork (clone) the [opencrvs-countryconfig](https://github.com/opencrvs/opencrvs-countryconfig) repository and clone the [infrastructure](https://github.com/opencrvs/infrastructure) repository. If repositories are already on your laptop, ensure they are in the same parent folder, for example:
77
+
```
78
+
repositories/
79
+
infrastructure
80
+
opencrvs-countryconfig
81
+
...
82
+
```
129
83
130
-
1. Create a new folder or use an existing folder to store the repositories.
84
+
**Step by step instruction**
85
+
86
+
1. Create a new folder or use an existing folder to store the repositories. For example folder could be located at your home directory or in documents:
87
+
```bash
88
+
mkdir ~/Documents/repository
89
+
```
131
90
2. Open a terminal (command line) and navigate to the folder.
132
-
3. Clone your fork of the OpenCRVS Country Configuration repository:
### Login/Client service is not responding: Check login logs
188
+
```
189
+
2025/03/19 07:53:38 [error]15#15: *1 upstream timed out (110: Connection timed out) while connecting to upstream, client: 10.1.3.102, server: localhost, request: "GET /api/countryconfig/login-config.js HTTP/1.1", upstream: "http://10.100.14.175:3040/login-config.js", host: "login.opencrvs.localhost", referrer: "https://login.opencrvs.localhost/"
190
+
```
191
+
192
+
Solution: restart nginx inside login container or delete login pod
193
+
```
194
+
nginx -s reload
195
+
```
196
+
197
+
198
+
---
199
+
200
+
# Running OpenCRVS on Kubernetes
201
+
202
+
## Prerequisites for Kubernetes Cluster
203
+
204
+
### Storage
205
+
206
+
Ensure your cluster has a storage class with encryption, or encryption is implemented at the filesystem level:
207
+
208
+
- **For existing OpenCRVS installations:**
209
+
Make sure the cluster has at least the `hostpath` storage class configured and directories on the filesystem should point to encrypted partitions.
210
+
`hostpath` is the best option for migration from Docker Swarm to Kubernetes; it allows data to remain untouched. Data can be migrated to more robust storage later, such as `local` or `nfs` volumes after OpenCRVS migration to Kubernetes.
211
+
212
+
- **For new installations:**
213
+
- Please check the available storage options in the official documentation: [Kubernetes Volumes Documentation](https://kubernetes.io/docs/concepts/storage/volumes/) and [Kubernetes Storage Classes Documentation](https://kubernetes.io/docs/concepts/storage/storage-classes/#provisioner).
214
+
- The recommended storage class for new installations is NFS.
215
+
216
+
Additionally, explore all possible options for CSI (Container Storage Interface) at the [CSI GitHub repository](https://github.com/kubernetes-csi/).
217
+
218
+
**NOTE:** Depending on your available hardware resources, you may optimize the installation by splitting data across different types of volumes. For example:
219
+
- `Hostpath` works better for Elasticsearch.
220
+
- `NFS` is the best option for MinIO and Mongo (or Postgres).
166
221
167
222
---
168
223
169
224
225
+
## [🚧 ] Manual deployment guide
226
+
227
+
1. Create yaml file with custom values for your installation:
228
+
```yaml
229
+
# Kubernetes load balancer domain used by traefik as entrypoint
230
+
hostname: opencrvs.<you domain>
231
+
# OpenCRVS Core image tag
232
+
image:
233
+
tag: local
234
+
# Your country image repository and tag
235
+
countryconfig:
236
+
image:
237
+
name: opencrvs/ocrvs-countryconfig
238
+
tag: develop
239
+
```
240
+
2. Add helm repository:
241
+
```
242
+
helm repo add ...
243
+
```
244
+
3. Install OpenCRVS:
245
+
```
246
+
helm install ... opencrvs
247
+
```
248
+
**NOTE:** Data seed will run only on `install`, don't use `update --install`.
249
+
250
+
# [🚧 Coming soon] Server environment migration
251
+
252
+
TODO: Migration from docker swarm to kubernetes guide
<td>Elasticsearch configuration, including the hostname and port. TODO: Consider defining the port as a separate variable.</td>
21
+
<td>Elasticsearch configuration, including the hostname and port.<br> <b>NOTE</b>: Some services require authentication, please use secrets to redefine ES_HOST variable if needed.</td>
22
22
</tr>
23
23
<tr>
24
24
<td>influxdb.host</td>
@@ -55,6 +55,11 @@ Helm chart to deploy all OpenCRVS services on Kubernetes cluster.
@@ -80,26 +85,17 @@ Helm chart to deploy all OpenCRVS services on Kubernetes cluster.
80
85
<td>{}</td>
81
86
<td>Mapping kubernetes secrets as environment variables. For more information see [Mapping secrets](#mapping-secrets)</td>
82
87
</tr>
88
+
<tr>
89
+
<td>data_seeder.enabled</td>
90
+
<td>true</td>
91
+
<td>Seed data as post-install step, data seeder is executed only once while `helm install`. In some cases when data is already seeded, e/g upgrade, this value must be set to false. **Note**: default user is used for data seeding, it will fail anyway on database with non-default data.</td>
Helm chart allows to define environment variables in following scopes:
91
-
-**Global variables** are defined at top level of values file and is added to all containers. See `env` key in [values.yaml](values.yaml)
92
-
-**Service level variables** are defined for each particular service. See `<service_name>.env` key in [values.yaml](values.yaml)
93
-
-**Secret environment variables** are defined at service level as `<service_name>.secrets` key, see [values.yaml](values.yaml).
94
96
95
97
# Mapping secrets
96
98
97
-
Suppose we need to store ES_HOST variable as a secret since it contains url with login and password for Elastic search.
98
-
Kubernetes secret is key/value object usually created from `.env` file, for example:
99
-
```
100
-
ES_HOST=user:randompass@elasticsearch:9200
101
-
```
102
-
103
99
Mapping needs to be added for particular service to access variable inside workload (service), e/g for `search` service to access ES_HOST following configuration is needed:
104
100
```
105
101
search:
@@ -117,4 +113,37 @@ secrets:
117
113
Summary:
118
114
-`secret_name`, name of Kubernetes secret object
119
115
-`secret_key`, key (variable name) inside Kubernetes secret data property
120
-
-`environment_variable`, environment variable name inside container. If `secret_key` value `environment_variable` are the same, last one can be omitted.
116
+
-`environment_variable`, environment variable name inside container. If `secret_key` value `environment_variable` are the same, last one can be omitted.
117
+
118
+
**Step by step example**
119
+
120
+
Suppose we need to store ES_HOST variable as a secret and provide variable value to service `search`.
0 commit comments