This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yml
69 lines (58 loc) · 2.59 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
version: '3'
vars:
ANSIBLE_DIR: ./infrastructure/ansible
ANSIBLE_INVENTORY_DIR: '{{.ANSIBLE_DIR}}/inventory'
ANSIBLE_PLAYBOOK_DIR: '{{.ANSIBLE_DIR}}/playbooks'
ANSIBLE_GROUPS: nodes
env:
ANSIBLE_CONFIG: '{{.ANSIBLE_DIR}}/ansible.cfg'
silent: true
tasks:
ping:
desc: Ping all Kubernetes cluster nodes
cmds:
- ansible {{.ANSIBLE_GROUPS}} -i {{.ANSIBLE_INVENTORY_DIR}}/hosts.yaml --one-line -m ping
list:
desc: List all nodes in the cluster
cmds:
- ansible {{.ANSIBLE_GROUPS}} -i {{.ANSIBLE_INVENTORY_DIR}}/hosts.yaml --list-hosts
upgrade:
desc: Upgrade the cluster node operating systems
cmds:
- ansible-playbook -i {{.ANSIBLE_INVENTORY_DIR}}/hosts.yaml {{.ANSIBLE_PLAYBOOK_DIR}}/upgrade-nodes.yaml
scale-media:
desc: Scale down pods using PVCs
cmds:
- kubectl -n mediaserver scale deployment --replicas 0 sonarr
- kubectl -n mediaserver scale deployment --replicas 0 radarr
- kubectl -n mediaserver scale deployment --replicas 0 plex
scale-media-up:
desc: Scale down pods using PVCs
cmds:
- kubectl -n mediaserver scale deployment --replicas 1 sonarr
- kubectl -n mediaserver scale deployment --replicas 1 radarr
- kubectl -n mediaserver scale deployment --replicas 1 plex
scale-down:
desc: Scale down pods using PVCs
cmds:
- kubectl -n home scale deployment --replicas 0 homeassistant-db
- kubectl -n mediaserver scale deployment --replicas 0 overseerr
- kubectl -n mediaserver scale deployment --replicas 0 sonarr
- kubectl -n mediaserver scale deployment --replicas 0 radarr
- kubectl -n mediaserver scale deployment --replicas 0 plex
- kubectl -n monitoring scale deployment --replicas 0 thanos-compact
- kubectl -n mediaserver scale deployment --replicas 0 rclone
# - kubectl -n monitoring patch prometheus prom-prometheus --patch '{"spec": {"replicas": 0}}' --type=merge
- kubectl -n monitoring scale statefulset --replicas 0 loki-stack
scale-up:
desc: Scale down pods using PVCs
cmds:
- kubectl -n home scale deployment --replicas 1 homeassistant-db
- kubectl -n mediaserver scale deployment --replicas 1 overseerr
- kubectl -n mediaserver scale deployment --replicas 1 sonarr
- kubectl -n mediaserver scale deployment --replicas 1 radarr
- kubectl -n mediaserver scale deployment --replicas 1 plex
- kubectl -n monitoring scale deployment --replicas 1 thanos-compact
# - kubectl -n monitoring patch prometheus prom-prometheus --patch '{"spec": {"replicas": 0}}' --type=merge
- kubectl -n monitoring scale statefulset --replicas 1 loki-stack