Main idea that project to create simple utility scripts to used them in routine jobs.
If you want just test utilities or run it in your machine without docker containers you can just install local dev environment
> sudo apt install python3.10
> sudo apt install python3.10-venv
> python3.10 -m venv .dev-3.10
> source .dev-3.10/bin/activate
> python -m pip install -r setup/requirements_dev.txt
> docker build -f setup/notify.Dockerfile -t notify_changed_ip:latest .
We use pydantic approach for parsing .env file. Supported parameters:
Currently we support only PostgreDB. Parameters for setting connect to database:
DB_SETTINGS__HOST = "127.0.0.1"
DB_SETTINGS__PORT = 5432
DB_SETTINGS__DB = "notifier"
DB_SETTINGS__USER = "user"
DB_SETTINGS__PASSWORD = "passowrd"
Parameters for setting email notification:
EMAIL_SETTINGS__SMTP_INSTANCE = "smtp.gmail.com"
EMAIL_SETTINGS__SMTP_PORT = 587
EMAIL_SETTINGS__SENDER_ADDRESS = "[email protected]"
EMAIL_SETTINGS__SENDER_PASSWORD = "sender_password"
EMAIL_SETTINGS__TARGET_ADDRESS = "[email protected]"
> python src/notify_changed_ip/app.py
This utility used like as job. So it's pass only once. Before run you also should create .env file with your parameters and place it next to docker-compose.yml
> docker-compose -f setup/docker-compose/docker-compose.yml up
This utility used like as job. So it's pass only once by crone. First of all you need to create .env file with your parameters and place it next to kubernetes yamls
Then if you try to use in local machine then Before run kubernates yamls you need to start minikube
> minikube start
After that you can go to k8s falder start kubernetes by bash script
> cd setup/k8s
> ./start.sh