diff options
author | Santo Cariotti <santo@dcariotti.me> | 2024-12-27 08:39:21 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2024-12-27 08:39:21 +0100 |
commit | 5b7b5126e0c8bd8fa0e808288f7457a3374c6a5d (patch) | |
tree | 73c5fde9b5864f9422d5b37cf518f450cf9e87eb | |
parent | c65448415aae1f5602104aed75340307b5c437bc (diff) |
Add readme
-rw-r--r-- | README.md | 44 |
1 files changed, 39 insertions, 5 deletions
@@ -13,18 +13,52 @@ This represents a orchestration of: ## Set up -You can run Kubernetes via Minikube or K3s. After the installation (we suggest -you Minikube in this case) you have to set up the environment: +You can run Kubernetes via Minikube or something else. For this project we +used KinD. If you install KinD do not forget to also install a Load Balancer for +Kubernetes: [Cloud Provider +KinD](https://kind.sigs.k8s.io/docs/user/loadbalancer/) is what we used. + +Now, you can proceed to set up some environment variables: - `JWT_SECRET`: the base64 version of the secret used for JWT tokens. - `EXPO_ACCESS_TOKEN`: the base64 version of the [Expo](https://expo.dev) access token. - `UNREALSPEECH_TOKEN`: the base64 version of the [Unrealspeech](https://unrealspeech.com/) access token. - `RUST_LOG`: level of Rust logging -- `AUDIO_PATH`: path for the audio folder -- `ALLOWED_HOST`: host for the app -After that just run +Meanwhile the followings are setted up by default. + +- `AUDIO_PATH`: "./assets" +- `ALLOWED_HOST`: "0.0.0.0:8000" + +After that just run the `run.sh` script. ```sh ./run.sh apply ``` + +After that, you'll be able to see what the external IP for the load balancer is. + +``` +$ k get svc +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +cas-service LoadBalancer 10.96.25.163 172.18.0.3 80:30358/TCP 11m +``` + +For the IP above you can test if it works by a HTTP request. + +``` +$ curl -X POST http://172.18.0.3/graphql \ +-H "Content-Type: application/json" \ +-d '{ + "query": "mutation Login($input: LoginCredentials!) { login(input: $input) { accessToken tokenType userId } }", + "variables": { + "input": { + "email": "info@cas-4.github", + "password": "mysuperpassword" + } + } +}' +``` + +If you receive a network error you just need to wait until the +`cloud-provider-kind` works. |