

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Storage in Kubernetes
incomplete
2: Ephemeral Volumes
incomplete
3: Containers in Pods
incomplete
4: Persistence
incomplete
5: Attach Persistence
incomplete
6: Databases
incomplete
This lesson's interactive features are locked, please to keep using them
So far all we've done is create an empty persistent volume. Let's get the api application to use it.
Use your crawler deployment and the docs as a reference. Create a new volume in the api-deployment referencing your pvc:
volumes:
- name: synergychat-api-volume
persistentVolumeClaim:
claimName: synergychat-api-pvc
Then mount it in the container under the /persist directory:
volumeMounts:
- name: synergychat-api-volume
mountPath: /persist
Update the API_DB_FILEPATH environment variable you added earlier to instead use the new mount path: /persist/db.json
Apply the changes, then check to make sure all your pods are healthy:
kubectl get pods
With your tunnel running (minikube tunnel -c), open http://synchat.internal/ in your browser.
api pod.