|
1 | | -# !!! Work in progress |
2 | 1 |
|
3 | | -Not all features available in docker swarm solution are supported now. |
| 2 | +# 🚧 Work in Progress |
4 | 3 |
|
5 | | -Limitations: |
6 | | -- Only manual helm installation and upgrade |
7 | | -- Manual initial users configuration for minio, mongodb, elastic search |
8 | | -- No data reset feature |
| 4 | +Please note that not all features from the Docker Swarm solution are supported yet. |
9 | 5 |
|
10 | | -# General information |
| 6 | +**Limitations:** |
| 7 | +- Manual Helm installation and upgrade only |
| 8 | +- Manual initial user configuration for MinIO, MongoDB, Elasticsearch |
| 9 | +- No data reset feature available |
11 | 10 |
|
12 | | -Repository to store infrastructure code for OpenCRVS deployment |
| 11 | +--- |
13 | 12 |
|
| 13 | +# General Information |
14 | 14 |
|
15 | | -# OpenCRVS on Kubernetes |
16 | | - |
17 | | -## Kubernetes cluster Prerequisites |
18 | | - |
19 | | -### Storage |
20 | | - |
21 | | -Storage class with encryption or respective encryption is implemented at filesystem level: |
22 | | -- For existing OpenCRVS installations make sure cluster has at least `hostpath` storage class configured and directories on file system are pointed to encrypted partitions. `hostpath` is the best option for drop-in replacement docker swarm to kubernetes, data will not be touched in that case. Later data can be migrated to more robust storage, e/g `local` or `nfs` volumes. |
23 | | -- For new installations please check available options at official documentation [[1]](https://kubernetes.io/docs/concepts/storage/volumes/), [[2]](https://kubernetes.io/docs/concepts/storage/storage-classes/#provisioner). Recommended storage class for new installations is NFS. |
24 | | - |
25 | | -Please also check all available options for CSI at: https://github.com/kubernetes-csi/ |
26 | | - |
27 | | -**NOTE:** Depending on available hardware resources it is also possible to optimize installation by splitting data into different types of volumes, e/g `hostpath` works better for Elasticsearch, while `NFS` is best option for `minio` and `mongo` (`postgres`) |
| 15 | +This repository is used to store infrastructure code for deploying OpenCRVS. |
28 | 16 |
|
| 17 | +--- |
29 | 18 |
|
| 19 | +# OpenCRVS on Kubernetes |
30 | 20 |
|
31 | | -# Links |
| 21 | +## Prerequisites for Kubernetes Cluster |
32 | 22 |
|
33 | | -[1] https://kubernetes.io/docs/concepts/storage/volumes/ |
| 23 | +### Storage |
34 | 24 |
|
35 | | -[2] https://kubernetes.io/docs/concepts/storage/storage-classes/#provisioner |
| 25 | +Ensure your cluster has a storage class with encryption, or encryption is implemented at the filesystem level: |
| 26 | + |
| 27 | +- **For existing OpenCRVS installations:** |
| 28 | + Make sure the cluster has at least the `hostpath` storage class configured and directories on the filesystem should point to encrypted partitions. |
| 29 | + `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. |
| 30 | + |
| 31 | +- **For new installations:** |
| 32 | + - 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). |
| 33 | + - The recommended storage class for new installations is NFS. |
| 34 | + |
| 35 | +Additionally, explore all possible options for CSI (Container Storage Interface) at the [CSI GitHub repository](https://github.com/kubernetes-csi/). |
| 36 | + |
| 37 | +**NOTE:** Depending on your available hardware resources, you may optimize the installation by splitting data across different types of volumes. For example: |
| 38 | +- `Hostpath` works better for Elasticsearch. |
| 39 | +- `NFS` is the best option for MinIO and Mongo (or Postgres). |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +# Development with Kubernetes |
| 44 | + |
| 45 | +## Prerequisites |
| 46 | + |
| 47 | +Ensure you have one of the following solutions installed on your laptop: |
| 48 | +- Docker Desktop (with Kubernetes enabled) |
| 49 | +- MicroK8s |
| 50 | +- Minikube |
| 51 | + |
| 52 | +You will also need the following tools for running the local development environment: |
| 53 | +- Git |
| 54 | +- Tilt |
| 55 | +- Helm |
| 56 | +- Kubectl |
| 57 | + |
| 58 | +**NOTE:** This guide does not cover the installation of these prerequisites. |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## For OpenCRVS Core Developers |
| 63 | + |
| 64 | +You need to clone the [opencrvs-core](https://github.com/opencrvs/opencrvs-core) and [infrastructure](https://github.com/opencrvs/infrastructure) repositories. If these repositories are already on your laptop, ensure they are in the same folder. |
| 65 | + |
| 66 | +1. Create a new folder or use an existing folder to store the repositories. |
| 67 | +2. Open a terminal (command line) and navigate to the folder. |
| 68 | +3. Clone the OpenCRVS Core repository: |
| 69 | + ```bash |
| 70 | + git clone [email protected]:opencrvs/opencrvs-core.git |
| 71 | + ``` |
| 72 | +4. Clone the Infrastructure repository: |
| 73 | + ```bash |
| 74 | + git clone [email protected]:opencrvs/infrastructure.git |
| 75 | + ``` |
| 76 | +5. Change directory to the OpenCRVS Core repository: |
| 77 | + ```bash |
| 78 | + cd opencrvs-core |
| 79 | + ``` |
| 80 | +6. [Temporary Step] Switch to the k8s-version branch: |
| 81 | + ```bash |
| 82 | + git checkout k8s-version |
| 83 | + ``` |
| 84 | +7. Run Tilt: |
| 85 | + ```bash |
| 86 | + tilt up |
| 87 | + ``` |
| 88 | +8. Navigate to [http://localhost:10350/](http://localhost:10350/) |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## For OpenCRVS Country Configuration Developers |
| 93 | + |
| 94 | +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. |
| 95 | + |
| 96 | +1. Create a new folder or use an existing folder to store the repositories. |
| 97 | +2. Open a terminal (command line) and navigate to the folder. |
| 98 | +3. Clone your fork of the OpenCRVS Country Configuration repository: |
| 99 | + ```bash |
| 100 | + git clone [email protected]:<your-github-account>/<your-repository>.git |
| 101 | + ``` |
| 102 | +4. Clone the Infrastructure repository: |
| 103 | + ```bash |
| 104 | + git clone [email protected]:opencrvs/infrastructure.git |
| 105 | + ``` |
| 106 | +5. Change directory to your forked repository: |
| 107 | + ```bash |
| 108 | + cd <your-repository> |
| 109 | + ``` |
| 110 | +6. [Temporary Step] Switch to the k8s-version branch: |
| 111 | + ```bash |
| 112 | + git checkout k8s-version |
| 113 | + ``` |
| 114 | +7. Run Tilt: |
| 115 | + ```bash |
| 116 | + tilt up |
| 117 | + ``` |
| 118 | +8. Navigate to [http://localhost:10350/](http://localhost:10350/) |
| 119 | + |
| 120 | +--- |
| 121 | + |
| 122 | +Feel free to let me know if you need any further adjustments or have additional questions! |
| 123 | +--- |
| 124 | + |
| 125 | + |
| 126 | +# Useful Links |
| 127 | + |
| 128 | +- [Kubernetes Volumes Documentation](https://kubernetes.io/docs/concepts/storage/volumes/) |
| 129 | +- [Kubernetes Storage Classes Documentation](https://kubernetes.io/docs/concepts/storage/storage-classes/#provisioner) |
0 commit comments