• Login
Saturday, March 7, 2026
The Cloud Guru
  • Home
  • AWS
  • Data Center
  • GCP
  • Technology
  • Tutorials
  • Blog
    • Blog
    • Reviews
No Result
View All Result
Saturday, March 7, 2026
  • Home
  • AWS
  • Data Center
  • GCP
  • Technology
  • Tutorials
  • Blog
    • Blog
    • Reviews
No Result
View All Result
The Cloud Guru
No Result
View All Result

Backing up and Restoring Kubernetes Data in etcd

Team TCG by Team TCG
October 2, 2022
in Kubernetes
0 0
0
Home Kubernetes
0
SHARES
6
VIEWS
Share on FacebookShare on Twitter

Introduction

Backups are an important part of any resilient system. Kubernetes is no exception. In this lab, you will have the opportunity to practice your skills by backing up and restoring a Kubernetes cluster state stored in etcd. This will help you get comfortable with the steps involved in backing up Kubernetes data.

Learning Objectives

Back Up the etcd Data

Restore the etcd Data from the Backup

Solution

Log in to the provided lab server using the credentials provided:

ssh <user>@<IP_ADDRESS>

Back Up the etcd Data

  1. Look up the value for the key cluster.name in the etcd cluster:
    • ETCDCTL_API=3 etcdctl get cluster.name \
    • --endpoints=https://10.0.1.101:2379 \
    • --cacert=/home/cloud_user/etcd-certs/etcd-ca.pem \
    • --cert=/home/cloud_user/etcd-certs/etcd-server.crt \
    • --key=/home/cloud_user/etcd-certs/etcd-server.key
  2. The returned value should be your Clustername.
  3. Back up etcd using etcdctl and the provided etcd certificates:
    • ETCDCTL_API=3 etcdctl snapshot save /home/cloud_user/etcd_backup.db \
    • --endpoints=https://10.0.1.101:2379 \
    • --cacert=/home/cloud_user/etcd-certs/etcd-ca.pem \
    • --cert=/home/cloud_user/etcd-certs/etcd-server.crt \
    • --key=/home/cloud_user/etcd-certs/etcd-server.key
  4. Reset etcd by removing all existing etcd data:
    • sudo systemctl stop etcd sudo rm -rf /var/lib/etcd

Restore the etcd Data from the Backup

  1. Restore the etcd data from the backup (this command spins up a temporary etcd cluster, saving the data from the backup file to a new data directory in the same location where the previous data directory was):
    • sudo ETCDCTL_API=3 etcdctl snapshot restore /home/cloud_user/etcd_backup.db \
    • --initial-cluster etcd-restore=https://10.0.1.101:2380 \
    • --initial-advertise-peer-urls https://10.0.1.101:2380 \
    • --name etcd-restore \ --data-dir /var/lib/etcd
  2. Set ownership on the new data directory:
    • sudo chown -R etcd:etcd /var/lib/etcd
  3. Start etcd:
    • sudo systemctl start etcd
  4. Verify the restored data is present by looking up the value for the key cluster.name again:
    • ETCDCTL_API=3 etcdctl get cluster.name \
    • --endpoints=https://10.0.1.101:2379 \
    • --cacert=/home/cloud_user/etcd-certs/etcd-ca.pem \
    • --cert=/home/cloud_user/etcd-certs/etcd-server.crt \
    • --key=/home/cloud_user/etcd-certs/etcd-server.key
  5. The returned value should be Clustername as noted before.
Previous Post

Cybersecurity vs Information Security: What’s the Difference??

Next Post

Controlling Access in Kubernetes with RBAC

Team TCG

Team TCG

Related Posts

GCP

Distributed Load Testing Using Kubernetes

Activate Cloud Shell Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB...

by Team TCG
October 1, 2023
GCP

Deploying Memcached on Kubernetes Engine

Overview In this lab, you'll learn how to deploy a cluster of distributed Memcached servers on Kubernetes Engine using Kubernetes, Helm, and Mcrouter. Memcached is one of...

by Team TCG
October 1, 2023
GCP

Continuous Delivery Pipelines with Spinnaker and Kubernetes Engine

Overview This post shows you how to create a continuous delivery pipeline using Google Kubernetes Engine, Google Cloud Source Repositories,...

by Team TCG
October 1, 2023
2 Minute Tutorials

Setting up Jenkins on Kubernetes Engine on GCP

Activate Cloud Shell Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB...

by Team TCG
October 1, 2023
books

Protected: Kubernetes

by Team TCG
May 15, 2023
Kubernetes

Controlling Access in Kubernetes with RBAC

Introduction Role-based access control is an important component when it comes to managing a Kubernetes cluster securely. The more users...

by Team TCG
October 7, 2022
Next Post

Controlling Access in Kubernetes with RBAC

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Trending
  • Comments
  • Latest

Azure Compliance: Policy, Blueprints, and Compliance Manager

September 21, 2025

Understanding Azure Subscriptions and Resource Groups

December 23, 2024

Azure Sphere: Securing IoT Devices

October 21, 2025

Azure Case Study: How Spotify Uses Azure

January 15, 2025

AWS SnowMobile

0

Passwordless Login Using SSH Keygen in 5 Easy Steps

0

Create a new swap partition on RHEL system

0

Configuring NTP using chrony

0

Cloud Monitoring: CloudWatch vs Azure Monitor vs Operations Suite

December 31, 2025

Infrastructure as Code: CloudFormation vs ARM Templates vs Deployment Manager

December 31, 2025

Cloud CLI Tools: AWS CLI vs Azure CLI vs gcloud

December 30, 2025

Hybrid Cloud Solutions: AWS Outposts, Azure Stack, and GCP Anthos

December 30, 2025

Recommended

Cloud Monitoring: CloudWatch vs Azure Monitor vs Operations Suite

December 31, 2025

Infrastructure as Code: CloudFormation vs ARM Templates vs Deployment Manager

December 31, 2025

Cloud CLI Tools: AWS CLI vs Azure CLI vs gcloud

December 30, 2025

Hybrid Cloud Solutions: AWS Outposts, Azure Stack, and GCP Anthos

December 30, 2025

About Us

Let's Simplify the cloud for everyone. Whether you are a technologist or a management guru, you will find something very interesting. We promise.

Categories

  • 2 Minute Tutorials (7)
  • AI (3)
  • Ansible (1)
  • Architecture (3)
  • Artificial Intelligence (3)
  • AWS (508)
  • Azure (3)
  • books (2)
  • Consolidation (4)
  • Containers (1)
  • Data Analytics (1)
  • Data Center (11)
  • Design (1)
  • GCP (13)
  • HOW To's (17)
  • Innovation (1)
  • Kubernetes (8)
  • LifeStyle (2)
  • LINUX (6)
  • Microsoft (2)
  • news (3)
  • People (4)
  • Reviews (1)
  • RHEL (2)
  • Security (2)
  • Self-Improvement and Professional Development (1)
  • Serverless (2)
  • Social (2)
  • Switch (1)
  • Technology (473)
  • Terraform (3)
  • Tools (1)
  • Tutorials (13)
  • Uncategorized (9)
  • Video (1)
  • Videos (1)

Tags

2Min's (7) Agile (1) AI (5) Appication Modernization (1) Application modernization (1) Architecture (1) AWS (43) AZURE (4) BigQuery (1) books (2) Case Studies (17) CI/CD (1) Cloud Computing (525) Cloud Optimization (1) Comparo (17) Consolidation (1) Courses (1) Data Analytics (1) Data Center (8) Emerging (1) GCP (11) Generative AI (1) How to (14) Hybrid Cloud (5) Innovation (2) Kubernetes (4) LINUX (5) lunch&learn (473) memcache (1) Microsoft (1) monitoring (1) NEWS (2) NSX (1) Opinion (3) SDDC (2) security (1) Self help (2) Shorties (1) Stories (1) Team Building (1) Technology (3) Tutorials (20) vmware (3) vSAN (1) Weekend Long Read (1)
  • About
  • Advertise
  • Privacy & Policy

© 2023 The Cloud Guru - Let's Simplify !!

No Result
View All Result
  • Home
  • AWS
  • HOW To’s
  • Tutorials
  • GCP
  • 2 Minute Tutorials
  • Data Center
  • Artificial Intelligence
  • Azure
  • Videos
  • Innovation

© 2023 The Cloud Guru - Let's Simplify !!

Welcome Back!

Sign In with Facebook
Sign In with Google
Sign In with Linked In
OR

Login to your account below

Forgotten Password?

Create New Account!

Sign Up with Facebook
Sign Up with Google
Sign Up with Linked In
OR

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In