These exercises are designed to reinforce your understanding of the local K3s and Terraform tutorial. Complete these tasks to practice and expand upon the concepts covered in the main tutorial.
Modify the React frontend to include a “Clear All Messages” button. This button should make an API call to a new endpoint on the backend that clears all messages from the database.
frontend/src/App.js.server.js file.Instead of hardcoding the database credentials, use environment variables in the backend application.
server.js to use environment variables for database connection.Add liveness and readiness probes to your backend deployment.
/health endpoint in your backend application.Modify the Terraform configuration to allow easy scaling of the backend deployment.
Integrate Redis as a caching layer between your backend and database.
If you’re feeling adventurous, implement an Ingress resource to route traffic to your frontend and backend services.
Remember to test your changes thoroughly and ensure that your Terraform configuration remains valid throughout these exercises.
Feeling stuck? Click here to see the solution