Skip to content

mate-academy/devops_todolist_kubernetes_task_9_working_with_statefuset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django ToDo list

This is a to-do list web application with the basic features of most web apps, i.e., accounts/login, API, and interactive UI. To do this task, you will need:

Explore

Try it out by installing the requirements (the following commands work only with Python 3.8 and higher, due to Django 4):

pip install -r requirements.txt

Create a database schema:

python manage.py migrate

And then start the server (default is http://localhost:8000):

python manage.py runserver

You can now browse the API or start on the landing page.

Task

Create a Kubernetes manifest for a pod that will contain a ToDo app container:

  1. Fork this repository.
  2. Use kind to spin up a cluster from a cluster.yml configuration file.
  3. Create a statefulSet.yml file for StatefulSet to manage MySQL.
  4. StatefulSet requirement:
    1. StatefulSet should be deployed in a mysql namespace
    2. StatefulSet should have 3 replicas
    3. StatefulSet is reading sensitive data from a secret:
      1. MYSQL_ROOT_PASSWORD
      2. MYSQL_USER
      3. MYSQL_PASSWORD
    4. StatefulSet pods should have a livenessProbe and readinessProbe
    5. StatefulSet pods should have requests and limits for CPU and Memory
    6. MySQL db should be inited from an init.sql that should be propagated as a mounted volume in /docker-entrypoint-initdb.d
    7. StatefulSet should have volumeClaimTemplates
    8. StatefulSet should have a headless Service to expose db pods
  5. Deployment requirements:
    1. Update your application so it can connect to a 0 indexed db pod (mysql-0)
    2. The application should read db connection information from a Secret:
      1. NAME
      2. USER
      3. PASSWORD
      4. HOST
  6. bootstrap.sh should contain all the commands to deploy all the required resources in the cluster
  7. INSTRUCTION.md should have instructions on how to validate the changes
  8. Create PR with your changes and attach it for validation on a platform.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published