Skip to content

Kubernetes course uncaught user-error #3

@morotsgurka

Description

@morotsgurka

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:

  1. Create the PVC like the instructions
  2. Add the PVC to the crawler deployment instead of the api deployment
  3. Update the configMap for the crawler deployment with
  CRAWLER_DB_PATH: "/persist/db.json"
  1. kubectl apply both
  2. Read instructions and realize your fault
  3. Revert changes in step 2 and 3.
  4. Add pvc to api-deployment and update the synergychat-api-configmap with the:
  API_DB_FILEPATH: "/persist/db.json"
  1. Apply everything and test synchat.internal, get error when pressing Send :
synchat.internal says
Sorry, something went wrong. The API Service is not responding.
  1. Access http://synchatapi.internal/healthz and get:
{
  "status": "ok"
}
  1. 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
  1. kubectl exec -it synergychat-api-*** -- /bin/bash and inspect the /persist/db.json
  2. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions