Local dev environment for the COOPGO Technical Platform, using [Tilt](https://tilt.dev) and a local Kubernetes cluster (such as [Rancher Desktop](https://rancherdesktop.io/), K3D, ...)
Tested with Rancher Desktop.
## Quickstart
1. Install Rancher Dektop or K3D or any other local Kubernetes. Make your Kubernetes context point to this cluster
To avoid developing on another cluster than the one dedicated for dev, we whitelist the correct context. By default, the allowed context is 'rancher-desktop'. To change this, set ALLOWED_K8S_CONTEXT to the correct context name in .env :
```
ALLOWED_K8S_CONTEXT="k3d-devcluster"
```
You might also want to set the default container images used if/while your local source code folder doesn't exist.
4. Add `tilt-dev.svc.cluster.local parcoursmob.tilt-dev.svc.cluster.local mobility-accounts.tilt-dev.svc.cluster.local` to resolve `127.0.0.1` in your hosts config (`/etc/hosts` on Linux)
5. Run `tilt up`
6. After some time (you can see the services loading -or failing, if there is an error- through Tilt UI), PARCOURSMOB should be available on http://parcoursmob.tilt-dev.svc.cluster.local
To have this work, make sure port 80 is unprivileged if you're using Linux. This is described in Rancher Desktop documentation. If you're using something else to run Kubernetes, make sure you have the right port forwarding and an Ingress controller on your cluster to target port 80 on localhost.
Once you can acess PARCOURSMOB UI, you can connect with the initially created user :
- username: admin@parcoursmob.fr
- password: parcoursmob
Now, you're ready to code !
## What it does
Set up PARCOURSMOB along with the following dependencies :
Tilt handles livereloading Kubernetes pods when something changes in the code. You just have to checkout your code in the directory you've specified in .env (see quickstart), start developing on exsting microservices, and see the changes.
## Acess useful internal components for debugging/tests