nová verze

This commit is contained in:
2026-08-13 09:10:21 +02:00
parent 76f3e68805
commit 69b0216521
120 changed files with 20366 additions and 0 deletions
+167
View File
@@ -0,0 +1,167 @@
[KUBE](../../README.md)  /  [k3s](../k3s.md)  /  MariaDB
# Resource MariaDB
> [!NOTE]
> A replica of two pods `mariadb-master` and `mariadb-slave` is created. Each of the pods has a separate storage. When configuring the connection, the host is specified: `mariadb-master`.
- [Install](#install)
- [Remove](#remove)
- [Status](#status)
- [Info](#info)
- [Version](#version)
- [Database list](#database-list)
- [User list](#user-list)
- [Dump](#dump)
***
## Install
### Processing
1. Preparation.
- Recreate the secret with the passwords `root-password` and `replication-password`.
2. Creation.
- Prepare the import file.
- Import the YAML.
3. Post-processing.
- Initialize the replica.
Command:
```bash
sudo kube.sh --mariadb install
```
Example of log:
```bash
🔹[K3S] Resource add | mariadb
✅[MariaDB] | Delete old Secret: OK
✅[MariaDB] | Create new Secret: OK
🔹[MariaDB] Preparing /app/kube/assets/yaml/mariadb.yaml
🔹[K3S] Applying YAML /app/kube/data/yaml/mariadb.yaml
💡[K3S] Waiting for pods to be ready... | 2 not ready
💡[K3S] Waiting for pods to be ready... | 1 not ready
✅[MariaDB] Applied /app/kube/data/yaml/mariadb.yaml
🔹[MariaDB] Replica initialization...
✅[MariaDB] Master node | Create replication user: OK
✅[MariaDB] Master node | Status: OK
✅[MariaDB] Slave node | Change master: OK
✅[MariaDB] Slave node | Status: OK | Delay 0s
✅[MariaDB] Replica initialization completed successfully
```
***
## Remove
Command:
```bash
sudo kube.sh --mariadb remove
```
***
## Status
Command:
```bash
sudo kube.sh --mariadb status
```
Example of log:
```bash
🔹[MariaDB] Status
✅[MariaDB] Databases: 10 | Users: 10 | Size: 1.234 Gb
✅[MariaDB] Master node | Running
✅[MariaDB] Slave node | Running
```
***
## Info
Command:
```bash
sudo kube.sh --mariadb info
```
Example of log:
```bash
🔹[MariaDB] Info
🔹[MariaDB] Master node
mysql-bin.000025 10341
🔹[MariaDB] Slave node
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: mariadb-master
Master_User: replication_user
Master_Port: 3306
...
```
***
## Version
Command:
```bash
sudo kube.sh --mariadb version
```
Example of log:
```bash
🔹[MariaDB] Version
✅[MariaDB] Master node | mariadb from 11.7.2-MariaDB, client 15.2 for debian-linux-gnu (x86_64) using EditLine wrapper
✅[MariaDB] Slave node | mariadb from 11.7.2-MariaDB, client 15.2 for debian-linux-gnu (x86_64) using EditLine wrapper
```
***
## Database list
> [!NOTE]
> List of databases (except for service databases: `information_schema`, `performance_schema`, `mysql`, `sys`)
Command:
```bash
sudo kube.sh --mariadb database
```
Example of log:
```bash
🔹[MariaDB] Database list
us1_example_com
us2_example_com
us3_example_com
```
***
## User list
> [!NOTE]
> List of users (except for service users `root`, `replication_user`)
Command:
```bash
sudo kube.sh --mariadb user
```
Example of log:
```bash
🔹[MariaDB] User list
us1_example_com
us2_example_com
us3_example_com
```
***
## Dump
Command:
```bash
sudo kube.sh --mariadb dump
sudo kube.sh --mariadb dump dump.sql
sudo kube.sh --mariadb dump dump.sql us1_example_com
```
Example of log:
```bash
🔹[MariaDB] Dump
✅[MariaDB] Dump: /app/kube/data/mariadb/2025-10-27_10-10-58.sql.tar.gz
```
@@ -0,0 +1,179 @@
[KUBE](../../README.md)  /  [k3s](../k3s.md)  /  OpenLiteSpeed
# Resource OpenLiteSpeed
> [!NOTE]
> Two (you can specify a different number) pods are created. They work simultaneously. If one pod fails, the second pod starts processing all requests until a replacement for the failed pod is brought up. When changes are made to the virtual host configuration, OpenLiteSpeed is restarted sequentially in all pods.
>
> The administration panel OpenLiteSpeed is available at an address:
> - `<domain>:31080` (local and remote)
> - `<server ip>:31080` (remote)
> - `<node ip>:7080` (local, `<node ip>` can be found upon request: `kube.sh --info | grep 7080`)
- [Install](#install)
- [Remove](#remove)
- [Status](#status)
- [Info](#info)
- [Version](#version)
- [Restart](#restart)
- [Site list](#site-list)
- [Site unlock](#site-unlock)
- [Site lock](#site-lock)
- [Config](#config-test)
***
## Install
### Processing
1. Creation.
- Prepare the import file.
- Import the YAML.
2. Post-processing.
- Initialization.
Command:
```bash
sudo kube.sh --ols install
```
Example of log:
```bash
🔹[OpenLiteSpeed] Install
🔹[OpenLiteSpeed] Preparing /app/kube/assets/yaml/openlitespeed.yaml
🔹[K3S] Applying YAML /app/kube/data/yaml/openlitespeed.yaml
💡[K3S] Waiting for pods to be ready... | 1 not ready
💡[K3S] Waiting for pods to be ready... | 1 not ready
✅[OpenLiteSpeed] Applied /app/kube/data/yaml/openlitespeed.yaml
🔹[OpenLiteSpeed] Initialization...
🔹[OpenLiteSpeed] Authorization parameters updated
service/traefik patched
🔹[OpenLiteSpeed] Pod: openlitespeed-0 | Restart...
🔹[OpenLiteSpeed] Pod: openlitespeed-1 | Restart...
✅[OpenLiteSpeed] Initialization completed successfully
```
***
## Remove
Command:
```bash
sudo kube.sh --ols remove
```
***
## Status
Command:
```bash
sudo kube.sh --ols status
```
Example of log:
```bash
🔹[OpenLiteSpeed] Status
✅[OpenLiteSpeed] openlitespeed-0 | Running | PID 251
✅[OpenLiteSpeed] openlitespeed-1 | Running | PID 216
```
***
## Info
Command:
```bash
sudo kube.sh --ols info
```
Example of log:
```bash
🔹[OpenLiteSpeed] Info
🔹[OpenLiteSpeed] openlitespeed-0
litespeed is running with PID 251.
🔹[OpenLiteSpeed] openlitespeed-1
litespeed is running with PID 216.
```
***
## Version
Command:
```bash
sudo kube.sh --ols version
```
Example of log:
```bash
🔹[OpenLiteSpeed] Version
✅[OpenLiteSpeed] openlitespeed-0 | LiteSpeed/1.8.3 Open (BUILD built: Fri Feb 28 16:33:02 UTC 2025)
✅[OpenLiteSpeed] openlitespeed-0 | PHP: 8.3.17
✅[OpenLiteSpeed] openlitespeed-1 | LiteSpeed/1.8.3 Open (BUILD built: Fri Feb 28 16:33:02 UTC 2025)
✅[OpenLiteSpeed] openlitespeed-1 | PHP: 8.3.17
```
***
## Restart
Command:
```bash
sudo kube.sh --ols restart
```
Example of log:
```bash
🔹[OpenLiteSpeed] Restart
🔹[OpenLiteSpeed] Pod: openlitespeed-0 | Restart...
🔹[OpenLiteSpeed] Pod: openlitespeed-1 | Restart...
```
***
## Site list
Command:
```bash
sudo kube.sh --ols list [option]
```
Options:
- all - All sites (colored up/down) (default)
- all - All sites
- up - Unlocked sites
- down - Locked sites
Example of log:
```bash
example1.com
example2.com
example3.com
```
***
## Site unlock
> [!NOTE]
> Unlock domain (Resume site operation in OpenLiteSpeed).
Command:
```bash
sudo kube.sh --ols up <domain>
```
***
## Site lock
> [!NOTE]
> Lock domain (Pause the site in OpenLiteSpeed).
>
> The OpenLiteSpeed page will be displayed with a 403 error when the domain is accessed.
Command:
```bash
sudo kube.sh --ols down <domain>
```
***
## Config test
Command:
```bash
sudo kube.sh --ols config
```
+121
View File
@@ -0,0 +1,121 @@
[KUBE](../../README.md) &nbsp;/&nbsp; [k3s](../k3s.md) &nbsp;/&nbsp; Postfix
# Resource Postfix
- [Install](#install)
- [Remove](#remove)
- [Status](#status)
- [Add domain](#add-domain-)
- [Get DKIM key](#get-dkim-key-for-dns-record-domain-or-dkim-record-lists)
- [Check DNS records](#check-dns-records-for--or-mta)
- [Get template of DNS records](#get-template-of-dns-records)
***
## Install
Command:
```bash
sudo kube.sh --postfix install
```
Example of log:
```bash
🔹[Postfix] Install
🔹[Postfix] Preparing /app/kube/assets/yaml/postfix.yaml
🔹[K3S] Applying YAML /app/kube/data/yaml/postfix.yaml
💡[K3S] Waiting for pods to be ready... | 1 not ready
💡[K3S] Waiting for pods to be ready... | 1 not ready
💡[K3S] Waiting for pods to be ready... | 1 not ready
💡[K3S] Waiting for pods to be ready... | 1 not ready
✅[Postfix] Applied /app/kube/data/yaml/postfix.yaml
```
***
## Remove
Command:
```bash
sudo kube.sh --postfix remove
```
***
## Status
> [!NOTE]
> In progress...
Command:
```bash
sudo kube.sh --postfix status
```
Example of log:
```bash
???
```
***
## Add domain <domain>
> [!NOTE]
> In progress...
Command:
```bash
sudo kube.sh --postfix add <domain>
```
***
## Get DKIM key for DNS record domain or DKIM record lists
Command:
```bash
sudo ube.sh --postfix dkim [domain]
```
Example of log:
```bash
[Postfix] DKIM key for DNS
selector1._domainkey IN TXT ( "v=DKIM1; h=sha256; k=rsa; s=email; "
"p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6rCyqEvQ1...FQIDAQAB" ) ; ----- DKIM key selector1 for krumax.cz
```
***
## Check DNS records for <domain> or MTA
Command:
```bash
sudo kube.sh --postfix dns [domain]
```
Example of log:
```bash
🔹[Postfix] Check DNS records
✅[Postfix] A record: mta.krumax.cz | 31.31.73.67
✅[Postfix] SPF record: mta.krumax.cz | "v=spf1 a -all"
✅[Postfix] PTR record: mta.krumax.cz | mta.krumax.cz.
```
***
## Get template of DNS records
Command:
```
sudo kube.sh --postfix template
```
Example of log:
```bash
🔹[Postfix] Template
🔹[Postfix] For MTA ==============
🔹[Postfix] IN A 31.31.73.67
🔹[Postfix] IN TXT v=spf1 a -all
🔹[Postfix] PTR -> mta.krumax.cz
🔹[Postfix] For site =============
🔹[Postfix] IN A 31.31.73.67
🔹[Postfix] IN MX 10 mta.krumax.cz.
🔹[Postfix] IN TXT v=spf1 mx ~all
🔹[Postfix] IN TXT v=DKIM1; ...
🔹[Postfix] IN TXT v=DMARC1; ...
```
+163
View File
@@ -0,0 +1,163 @@
[KUBE](../../README.md) &nbsp;/&nbsp; [k3s](../k3s.md) &nbsp;/&nbsp; Redis
# Resource Redis
> [!NOTE]
> A replica of three pods is created: 1 master (`redis-0`) + 2 slaves (`redis-1`, `redis-2`). A cluster of three RedisSentinel is created to manage the replica. When configuring the connection, the host is specified: redis-0.redis.
> [!WARNING]
> In the current configuration, when changing the RedisSentinel master node of the replica, there is no automatic change of connection to the new master node. Solution: adding HAProxy to automatically redirect requests to the current Redis master node.
- [Install](#install)
- [Remove](#remove)
- [Status](#status)
- [Info](#info)
- [Version](#version)
- [User list](#user-list)
***
## Install
### Processing
1. Preparation.
- Recreate the secret with the passwords `root-password`.
2. Creation.
- Prepare the import file.
- Import the YAML.
Command:
```bash
sudo kube.sh --redis install
```
Example of log:
```bash
🔹[Redis] Install
✅[Redis] Delete old Secret: OK
✅[Redis] Create new Secret: OK
🔹[Redis] Preparing /app/kube/assets/yaml/redis.yaml
🔹[K3S] Applying YAML /app/kube/data/yaml/redis.yaml
💡[K3S] Waiting for pods to be ready... | 2 not ready
💡[K3S] Waiting for pods to be ready... | 1 not ready
✅[Redis] Applied /app/kube/data/yaml/redis.yaml
```
***
## Remove
Command:
```bash
sudo kube.sh --redis remove
```
***
## Status
Command:
```bash
sudo kube.sh --redis status
```
Example of log:
```bash
🔹[Redis] Status
✅[Redis] redis-0 | Role: Master | Slaves: 2
✅[Redis] redis-1 | Role: Slave | Master: redis-0.redis
✅[Redis] redis-2 | Role: Slave | Master: redis-0.redis
✅[RedisSentinel] redis-sentinel-0 | Master: mymaster [redis-0.redis:6379] | Slaves: 2 | Other sentinels: 2 | Quorum: 2
✅[RedisSentinel] redis-sentinel-0 | Slave: 10.42.0.16:6379 [10.42.0.16:6379] | Master: redis-0.redis
✅[RedisSentinel] redis-sentinel-0 | Slave: 10.42.0.14:6379 [10.42.0.14:6379] | Master: redis-0.redis
✅[RedisSentinel] redis-sentinel-1 | Master: mymaster [redis-0.redis:6379] | Slaves: 2 | Other sentinels: 2 | Quorum: 2
✅[RedisSentinel] redis-sentinel-1 | Slave: 10.42.0.16:6379 [10.42.0.16:6379] | Master: redis-0.redis
✅[RedisSentinel] redis-sentinel-1 | Slave: 10.42.0.14:6379 [10.42.0.14:6379] | Master: redis-0.redis
✅[RedisSentinel] redis-sentinel-2 | Master: mymaster [redis-0.redis:6379] | Slaves: 2 | Other sentinels: 2 | Quorum: 2
✅[RedisSentinel] redis-sentinel-2 | Slave: 10.42.0.16:6379 [10.42.0.16:6379] | Master: redis-0.redis
✅[RedisSentinel] redis-sentinel-2 | Slave: 10.42.0.14:6379 [10.42.0.14:6379] | Master: redis-0.redis
```
***
## Info
Command:
```bash
sudo kube.sh --redis info
```
Example of log:
```bash
🔹[Redis] Info
🔹[Redis] redis-0
# Replication
role:master
connected_slaves:2
slave0:ip=10.42.0.14,port=6379,state=online,offset=1092850,lag=0
slave1:ip=10.42.0.16,port=6379,state=online,offset=1092714,lag=1
...
🔹[Redis] redis-1
# Replication
role:slave
master_host:redis-0.redis
master_port:6379
master_link_status:up
...
🔹[Redis] redis-2
# Replication
role:slave
master_host:redis-0.redis
master_port:6379
master_link_status:up
...
🔹[RedisSentinel] redis-sentinel-0
# Sentinel
sentinel_masters:1
...
master0:name=mymaster,status=ok,address=redis-0.redis:6379,slaves=2,sentinels=3
🔹[RedisSentinel] redis-sentinel-1
# Sentinel
sentinel_masters:1
...
master0:name=mymaster,status=ok,address=redis-0.redis:6379,slaves=2,sentinels=3
🔹[RedisSentinel] redis-sentinel-2
# Sentinel
sentinel_masters:1
...
master0:name=mymaster,status=ok,address=redis-0.redis:6379,slaves=2,sentinels=3
```
***
## Version
Command:
```bash
sudo kube.sh --redis version
```
Example of log:
```bash
🔹[Redis] Version
✅[Redis] redis-0 | 7.4.2
✅[Redis] redis-1 | 7.4.2
✅[Redis] redis-2 | 7.4.2
✅[RedisSentinel] redis-sentinel-0 | 7.4.2
✅[RedisSentinel] redis-sentinel-1 | 7.4.2
✅[RedisSentinel] redis-sentinel-2 | 7.4.2
```
***
## User list
Command:
```bash
sudo kube.sh --redis user
```
Example of log:
```bash
🔹[Redis] User list
default
us1_example_com
us2_example_com
us3_example_com
```
+121
View File
@@ -0,0 +1,121 @@
[KUBE](../../README.md) &nbsp;/&nbsp; [k3s](../k3s.md) &nbsp;/&nbsp; Worker
# Resource Transfer
- [Install](#install)
- [Remove](#remove)
- [Transfer site](#transfer-site)
- [Pause for Agent to receive new tasks from the API](#pause-for-agent-to-receive-new-tasks-from-the-api)
- [Removing the pause for Agent to receive new tasks from the API](#removing-the-pause-for-agent-to-receive-new-tasks-from-the-api)
- [Tasks list](#tasks-list)
- [Update ENV](#update-env)
***
## Install
Command:
```bash
sudo kube.sh --worker install
```
Example of log:
```bash
🔹[Worker] Install
🔹[Worker] Preparing /app/kube/assets/yaml/worker.yaml
🔹[K3S] Applying YAML /app/kube/data/yaml/worker.yaml
💡[K3S] Waiting for pods to be ready... | 1 not ready
💡[K3S] Waiting for pods to be ready... | 1 not ready
```
***
## Remove
Command:
```bash
sudo kube.sh --Worker remove
```
***
## Execute task
Command:
```bash
sudo kube.sh --worker task <file> [domain]
```
Example of log:
```bash
🔹[Worker] Task: /_data/worker/tasks/6d5b3169-a15f-4007-8cc7-ebfc8d75e3b2.task
🔹[Worker] Action: test
🔹[Worker] Database URL: https://wp.krumax.cz/transfer_36b91e68-53d3-49ac-922a-0031e664125b/0bf26901-c12d-4015-9bbe-cefc5c1a92d6.sql.zip
🔹[Worker] Files URL: https://wp.krumax.cz/transfer_36b91e68-53d3-49ac-922a-0031e664125b/0bf26901-c12d-4015-9bbe-cefc5c1a92d6.zip
🔹[Worker] Download archive database --> /app/transfers/us00.krumax.cz/us00.krumax.cz.sql.zip
🔹[Worker] Download archive files --> /app/transfers/us00.krumax.cz/us00.krumax.cz.zip
🔹[Worker] Create site: us00.krumax.cz
🔹Files source: /app/transfers/us00.krumax.cz/us00.krumax.cz.zip
🔹Database source: /app/transfers/us00.krumax.cz/us00.krumax.cz.sql.zip
🔹[OpenLiteSpeed] Pod: openlitespeed-0 | Restart...
🔹[OpenLiteSpeed] Pod: openlitespeed-1 | Restart...
✅[Worker] Action: test | Success
```
***
## Tasks list
Command:
```bash
sudo kube.sh --worker list
```
Example of log:
```bash
🔹[Worker] Task list
# | Task | Action | Status | Time, sec
---------------------------------------------------------------------------
1 | d580040f-b3b8-43e1-af7a-8e35c80a688c | test | new | ?
2 | pause | pause | execution | 691175
```
***
## Pause for Agent to receive new tasks from the API (pause)
Command:
```bash
sudo kube.sh --worker down
```
Example of log:
```bash
🔹[Worker] Put on pause...
```
***
## Removing the pause for Agent to receive new tasks from the API (unpause)
Command:
```bash
sudo kube.sh --worker up
```
Example of log:
```bash
🔹[Worker] Resuming from pause...
```
***
## Reload
Command:
```bash
sudo kube.sh --worker reload
```
Example of log:
```bash
🔹[Worker] Reload...
🔹[Worker] Updated ENV:
API_URL: http://api.sodew.ai/api/tasks
WORKER_ID: worker-dev
GETTING_PAUSE: 30
SENDING_PAUSE: 15
```