Commit Graph

11 Commits

Author SHA1 Message Date
2aa00b6639 chore: update apk repository URL
- Change the APK repository URL to use a mirror site
- This ensures better availability and potentially faster downloads

The update to the repository URL is intended to improve the
reliability of package installations in the daemonset's
configuration.
2025-04-26 11:17:59 +08:00
aef5c35ab8 feat: add support for additional S3 providers
- Introduce S3_PROVIDER variable in cm-script.yaml
- Update s3cmd configuration to include provider
- Modify daemonset.yaml to support tencent-gz1 and tencent-sh1 in node affinity

These changes allow the backup system to utilize multiple S3 providers, enhancing its compatibility and deployment options across different cloud environments.
2025-04-26 11:12:50 +08:00
31c0176813 feat: add S3_PROVIDER to daemonset and secret
- Introduce S3_PROVIDER environment variable in daemonset.yaml
- Update secret.yaml to include provider information

This change allows the application to specify the S3 provider type, improving
flexibility in storage configuration. The new variable is sourced from the
existing s3-credentials secret, ensuring secure access to the provider
information.
2025-04-26 11:07:57 +08:00
dda3e92a63 feat: add automated backup system with Kubernetes
- Create ConfigMaps for backup configuration and scripts
- Define Secrets for S3 credentials
- Implement Role and RoleBinding for access control
- Set up a DaemonSet for running backup containers
- Add a CronJob to schedule backups daily

This commit establishes a comprehensive backup solution within the Kubernetes cluster, allowing for automated backups of specified directories to S3 storage. It includes necessary configurations and scripts to ensure proper execution and notification of backup status.
2025-04-25 17:47:39 +08:00
e5fb117a5e fix: update storage class and node selector
- Change provisioner name in zgo-us1.yaml to match the correct
  provisioner.
- Update node selector in multiple statefulset manifests to
  ensure they target the correct nodes.
- Replace storage class name from nfs-zgo-us1 to local-vkus2
  for better resource management.

These changes ensure that the application components are
correctly configured to use the appropriate storage and
node resources, improving deployment stability and
performance.
2025-04-23 23:51:27 +08:00
3c256f1575 feat: update backup script with cleanup logic
- Adjust the script to include logic for cleaning up old backups
- Added support for handling PostgreSQL data directories
- Ensure temporary directories are cleaned after use

This update improves the backup process by ensuring that old backups
are properly cleaned up to save storage space and enhance efficiency.
It also includes logic to handle specific cases for PostgreSQL
directories, providing a more robust backup operation.
2025-04-23 11:15:04 +08:00
f27876c6ab feat: add node affinity for DaemonSet scheduling
- Implement node affinity to prevent scheduling on vkvm-us2
- Update affinity section in daemonset.yaml
- Ensure that the DaemonSet runs only on specific nodes

This change introduces a node affinity rule to the DaemonSet configuration,
allowing it to avoid scheduling on nodes labeled with `kubernetes.io/hostname`
set to `vkvm-us2`. This helps to ensure resource allocation and performance
by restricting the DaemonSet to the desired nodes.
2025-04-22 16:06:51 +08:00
e5e9bfd9f3 fix: update backup script for better directory handling
- Change TEMP_DIR to use a more structured temporary path
- Adjust rsync command to reflect the new directory structure
- Improve MSG_TEXT formatting for better clarity
- Add 'jq' to the dependencies for JSON processing

These changes address issues with the previous temporary directory location and enhance the output messages for a more informative backup success notification.
2025-04-22 15:48:17 +08:00
1203a57641 feat: add Feishu webhook notification for backups
- Include a webhook URL to send notifications after backups.
- Capture and log the duration and size of the backups.
- Create a new Kubernetes secret for storing the Feishu webhook URL.
- Enhance the backup script to notify users of backup success with details.

This change improves monitoring and user notification of backup events,
allowing for better awareness and response times in case of failure or
success of the backup processes.
2025-04-22 15:11:04 +08:00
6d2acdcd1e feat: add backup system with cron and daemon
- Create a new namespace for the backup system
- Implement a cron job for scheduled backups
- Add a daemon set to handle backup tasks across nodes
- Introduce necessary service accounts, roles, and role bindings
- Include environment variable handling and configuration via secrets and config maps
- Ensure triggering and execution workflow for backups is efficient

This commit establishes a new backup system that utilizes both a cron job and a daemon set to automate backups. It organizes the configurations and credentials needed for S3-compatible storage, allowing for seamless backup management across the specified nodes in the Kubernetes cluster.
2025-04-22 14:49:02 +08:00
ba98dbb1b8 feat: add cronjob for node backups
- Create a cronjob to back up node1 data to node8
- Define schedule for daily backups at 3:00 AM
- Include error handling and notifications via Feishu
- Use SSH and rsync for secure and efficient data transfer

This commit introduces a new cronjob that automates the backup process
for node1 to node8, enabling easier management and recovery of data.
The setup includes necessary security measures and proper logging of backups,
ensuring smoother operation and notifications in case of failures.
2025-04-22 14:04:42 +08:00