Giter Club home page Giter Club logo

etcd-backup-script's Introduction

ETCD Backup and Restore Scripts

Overview

This repository contains scripts for backing up and restoring the ETCD database in Kubernetes environments. These scripts facilitate the creation of timestamped backup files, handle their compression, and manage the retention of these backups by deleting older files.

Features

  • Automated backup of ETCD database.
  • Backup file compression.
  • Backup retention management.
  • Ansible playbook for easy deployment and execution.
  • Restoration script for ETCD data.

Prerequisites

  • Root access to a Kubernetes environment with ETCD (Masters).
  • Required tools: etcdctl, gzip, crontab, and standard Linux utilities (date, find, etc.).
  • Ansible for running playbooks.

Installation

  1. Clone the repository:
   git clone https://github.com/mk3-v8/etcd-backup-script.git
   cd etcd-backup-script

Usage

Backup

Deploy and run the backup script using Ansible:

ansible-playbook copy.yml

Restore

List backups and prompt for the backup file to restore:

ansible-playbook restore.yml

Environment Variables (optional)

  • RETENTION_DAYS: Number of days to retain the backup files.
  • BACKUP_DIR: Directory where backup files are stored.

Customization

You can modify the CRON_SCHEDULE variable within the script to set a custom schedule for the cron job.

Contribution

Contributions to this script are welcome. Please fork the repository and submit a pull request with your changes.

Tested

Tested in Kubespray Kubernetes Deployment Version v1.25.6

License

MIT License

Copyright (c) 2024 Mohammed Aladwani

Contact


Note: This script is provided as-is with no guarantees. Please ensure you test it in your environment before using it in production.

etcd-backup-script's People

Contributors

mk3-v8 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.