Hi!
Kubernetes course: CH7 L6
If you do things faster than you read the instructions you can end up with a confusing (user) error.
Recreation steps:
- Create the PVC like the instructions
- Add the PVC to the crawler deployment instead of the api deployment
- Update the configMap for the crawler deployment with
CRAWLER_DB_PATH: "/persist/db.json"
- kubectl apply both
- Read instructions and realize your fault
- Revert changes in step 2 and 3.
- Add pvc to api-deployment and update the synergychat-api-configmap with the:
API_DB_FILEPATH: "/persist/db.json"
- Apply everything and test synchat.internal, get error when pressing Send :
synchat.internal says
Sorry, something went wrong. The API Service is not responding.
- Access http://synchatapi.internal/healthz and get:
- kubectl logs synergychat-api-****
2025/05/09 17:17:11 API_DB_FILEPATH found! Using filesystem database
2025/05/09 17:17:11 Serving on: http://localhost:8080
- kubectl exec -it synergychat-api-*** -- /bin/bash and inspect the /persist/db.json
- db.json is a folder since it was initially used as a cache for the crawler and contains the json files for the books.
The fix was of course to just to remove the pvc and recreate it.
I'm not sure how many people will even run into this? The api server could validate that the API_DB_FILEPATH is writable and is a file and not a folder on start and if not output an error to http://synchatapi.internal/healthz and the stdout?
Hi!
Kubernetes course: CH7 L6
If you do things faster than you read the instructions you can end up with a confusing (user) error.
Recreation steps:
{ "status": "ok" }2025/05/09 17:17:11 API_DB_FILEPATH found! Using filesystem database 2025/05/09 17:17:11 Serving on: http://localhost:8080The fix was of course to just to remove the pvc and recreate it.
I'm not sure how many people will even run into this? The api server could validate that the API_DB_FILEPATH is writable and is a file and not a folder on start and if not output an error to http://synchatapi.internal/healthz and the stdout?