Kubernetes cluster with multiple namespaces. These namespaces should be stopped at specific time every working day and started manually by user request.
Namespace should be stopped by cronjob
at specific time if it has scheduler=enabled
label. All namespaces should have the same scheduled shutdown time (for now it's hardcoded in template and can be found in src/templates/cronjob.py
).
cronjob is created automatically and should be active when:
- we create a new namespace without label
- we label a namespace with
scheduler=enabled
cronjob should be paused when:
- namespace has been created with
scheduler=disabled
- namespace has been relabeled with
scheduler=disabled
Additional cronjob should reset shutdown time in all namespaces to default one every morning.
CREATE
and UPDATE
kubernetes events on namespace should be managed by AdmissionWebHook
. (see app-scaler/controllers/cronjob_controller.py`).
EC2 or RDS instances should be stopped or started if they have the same labels. For instance,
namespace: dev1
scheduler: enabled
We should have a possibility to run static
pod for management purpose. Request should consist of memory size of a pod (like XS,S,M etc).
There should be at least 3 types of notifications before environment is going to shutdown: 1 hour before, 30 and 15 mins before shutdown.
Commands should send default payload to scaler api; that means it will scale all deployments and stateful sets to 0 replicas as stop/start commands.
Namespace can be prolongated: user can modify (add hours) shutdown time by invoking command / prolongate for . Example:
/devenv prolongate dev1 for 1h
Namespace can be started manually by user request by invoking command / start . Example:
/devenv start dev1
Namespace can be stopped manually by user request by invoking command / stop . Example:
/devenv stop dev1
We can track actual status of specific deployment (based on kubernetes deployment status) via / status . Example:
/devenv status dev1
Slash command should have help command which will return actual help message for all commands via / help. Example:
/devenv help
Slack command to start and stop manage pod. / support start
/devenv support start manage1 XL
/devenv support stop manage1
OpenAPI scheme is on /docs
url.
Purpose is to save ec2 and rds instances with provided labels into dynamodb as cache location. Written in Golang
.
A proxy for scaler service because AdmissionWebhook needs a ssl endpoint.