{"id":1467,"date":"2023-05-23T10:27:38","date_gmt":"2023-05-23T10:27:38","guid":{"rendered":"http:\/\/patriciocerda.com\/?p=1467"},"modified":"2023-05-26T09:54:34","modified_gmt":"2023-05-26T09:54:34","slug":"openshift-etcd-backup-and-restore-with-kasten-k10","status":"publish","type":"post","link":"https:\/\/patriciocerda.com\/?p=1467","title":{"rendered":"OpenShift ETCD backup and Restore with Kasten K10 &#8211; Part 1"},"content":{"rendered":"<p>Hi all and welcome back.\u00a0 In this blog post I\u2019ll talk about the need (or not) of backing up ETCD in a Kubernetes cluster, and how to do it.<\/p>\n<p>Kubernetes is an orchestration tool whose tasks involve managing application container workloads, their configuration, deployments, service discovery, load balancing, scheduling, scaling, and monitoring, and many more tasks which might spread across multiple machines across many locations. Kubernetes needs to maintain coordination between all the components involved.<\/p>\n<p>To achieve that coordination, Kubernetes needs a data store that can help with the information about all the components, their required configuration, state data, etc. \u00a0\u00a0In Kubernetes, that job is done by ETCD. \u00a0\u00a0ETCD is a key-value data store used to store and manage the critical information that distributed systems need for their operations. It provides a reliable way of storing the configuration data.<\/p>\n<p>So, in simple words, in a Kubernetes cluster, the expected state for every Kubernetes component (Pods, Deployments, Secrets, PVCs, etc), is stored in the ETCD instance running in the Kubernetes Control Plane.<\/p>\n<p>So, in theory we could just backup this ETCD instance to protect the entire cluster and being able to restore it whenever it\u2019s necessary.\u00a0\u00a0 This could be correct, but it\u2019s not the best approach for a Data Protection and Disaster Recovery strategy for multiple reasons such as:<\/p>\n<ul>\n<li>ETCD just keeps the cluster configuration and expected state of every component, so it\u2019s capable of restoring, for instance, all the Kubernetes workloads to a specific point in time (PIT), but remember Kubernetes workloads could be stateful, and this approach doesn\u2019t take in consideration the persistent data of stateful applications.<\/li>\n<li>ETCD backups don\u2019t allow for granular restore operations, so we can just restore the entire cluster or nothing at all. What if I just need to restore a single application, or a single component?\u00a0 Well, that is not possible.<\/li>\n<li>Automating ETCD backups can be achieve only by using scripts, which add extra complexity to this option.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Furthermore, even the <a href=\"https:\/\/docs.openshift.com\/container-platform\/4.13\/backup_and_restore\/control_plane_backup_and_restore\/disaster_recovery\/scenario-2-restoring-cluster-state.html\" target=\"_blank\" rel=\"noopener\">RedHat OpenShift documentation<\/a> provide the following warning:<\/p>\n<p><em>You can use an etcd backup to restore your cluster to a previous state. This can be used to recover from the following situations:<\/em><\/p>\n<ul>\n<li><em>The cluster has lost the majority of control plane hosts (quorum loss).<\/em><\/li>\n<li><em>An administrator has deleted something critical and must restore to recover the cluster.<\/em><\/li>\n<\/ul>\n<p><em>Restoring to a previous cluster state <strong>is a destructive and destablizing action<\/strong> to take on a running cluster. This should only be used as a <strong>last resort<\/strong>.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>Using a Kubernetes native backup solution as Kasten K10, it is possible to backup all applications running in our Kubernetes clusters (alongside with the application\u2019s data of course), and in addition it is possible to backup the cluster-wide resources like ClusterRoles or ClusterRoleBindings, and others.\u00a0\u00a0\u00a0 Kasten allows to restore entire applications, and also allows to restore individual artifacts, including cluster-wide resources.<\/p>\n<p>Therefore, protecting the entire Kubernetes cluster with Kasten K10 is much more efficient than using ETCD Backups, as you can see in the following image:<\/p>\n<p><a href=\"https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/Captura-de-pantalla-2023-05-23-a-las-12.22.11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1470\" src=\"https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/Captura-de-pantalla-2023-05-23-a-las-12.22.11-300x119.png\" alt=\"\" width=\"557\" height=\"221\" srcset=\"https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/Captura-de-pantalla-2023-05-23-a-las-12.22.11-200x80.png 200w, https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/Captura-de-pantalla-2023-05-23-a-las-12.22.11-300x119.png 300w, https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/Captura-de-pantalla-2023-05-23-a-las-12.22.11-400x159.png 400w, https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/Captura-de-pantalla-2023-05-23-a-las-12.22.11-600x239.png 600w, https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/Captura-de-pantalla-2023-05-23-a-las-12.22.11-768x306.png 768w, https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/Captura-de-pantalla-2023-05-23-a-las-12.22.11-800x319.png 800w, https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/Captura-de-pantalla-2023-05-23-a-las-12.22.11-1024x408.png 1024w, https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/Captura-de-pantalla-2023-05-23-a-las-12.22.11-1200x478.png 1200w, https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/Captura-de-pantalla-2023-05-23-a-las-12.22.11-1536x612.png 1536w\" sizes=\"(max-width: 557px) 100vw, 557px\" \/><\/a><\/p>\n<p>Still, what if you still want to have a method to backup and restore ETCD?\u00a0 In the <a title=\"OpenShift ETCD backup and Restore with Kasten K10 \u2013 Part 2\" href=\"https:\/\/patriciocerda.com\/?p=1475\" target=\"_blank\" rel=\"noopener\">second part of this blog<\/a> we will going to describe the process of backup and in <a title=\"OpenShift ETCD backup and Restore with Kasten K10 \u2013 Part 3-Final\" href=\"https:\/\/patriciocerda.com\/?p=1487\" target=\"_blank\" rel=\"noopener\">the third part<\/a> we will describe the restore ETCD in an OpenShift cluster, by using Kasten K10.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi all and welcome back.\u00a0 In this blog post I\u2019ll<\/p>\n","protected":false},"author":1,"featured_media":1471,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[25,67,27,68,43],"tags":[37,83,33,32,29,31,69,38],"aioseo_notices":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>OpenShift ETCD backup and Restore with Kasten K10 - Part 1 - vLatam<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/patriciocerda.com\/?p=1467\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OpenShift ETCD backup and Restore with Kasten K10 - Part 1 - vLatam\" \/>\n<meta property=\"og:description\" content=\"Hi all and welcome back.\u00a0 In this blog post I\u2019ll\" \/>\n<meta property=\"og:url\" content=\"https:\/\/patriciocerda.com\/?p=1467\" \/>\n<meta property=\"og:site_name\" content=\"vLatam\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-23T10:27:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-26T09:54:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/IntroBlog1467.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"pcerda\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pcerda\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/patriciocerda.com\/?p=1467\",\"url\":\"https:\/\/patriciocerda.com\/?p=1467\",\"name\":\"OpenShift ETCD backup and Restore with Kasten K10 - Part 1 - vLatam\",\"isPartOf\":{\"@id\":\"https:\/\/patriciocerda.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/patriciocerda.com\/?p=1467#primaryimage\"},\"image\":{\"@id\":\"https:\/\/patriciocerda.com\/?p=1467#primaryimage\"},\"thumbnailUrl\":\"https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/IntroBlog1467.png\",\"datePublished\":\"2023-05-23T10:27:38+00:00\",\"dateModified\":\"2023-05-26T09:54:34+00:00\",\"author\":{\"@id\":\"https:\/\/patriciocerda.com\/#\/schema\/person\/613aa192d7dbcedcd20e08318891aa2a\"},\"breadcrumb\":{\"@id\":\"https:\/\/patriciocerda.com\/?p=1467#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/patriciocerda.com\/?p=1467\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/patriciocerda.com\/?p=1467#primaryimage\",\"url\":\"https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/IntroBlog1467.png\",\"contentUrl\":\"https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/IntroBlog1467.png\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/patriciocerda.com\/?p=1467#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/patriciocerda.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"OpenShift ETCD backup and Restore with Kasten K10 &#8211; Part 1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/patriciocerda.com\/#website\",\"url\":\"https:\/\/patriciocerda.com\/\",\"name\":\"vLatam\",\"description\":\"El Blog de Patricio Cerda\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/patriciocerda.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/patriciocerda.com\/#\/schema\/person\/613aa192d7dbcedcd20e08318891aa2a\",\"name\":\"pcerda\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/patriciocerda.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/patriciocerda.com\/wp-content\/litespeed\/avatar\/ce92117b9294544adeaad229a8fbac13.jpg?ver=1776167859\",\"contentUrl\":\"https:\/\/patriciocerda.com\/wp-content\/litespeed\/avatar\/ce92117b9294544adeaad229a8fbac13.jpg?ver=1776167859\",\"caption\":\"pcerda\"},\"url\":\"https:\/\/patriciocerda.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"OpenShift ETCD backup and Restore with Kasten K10 - Part 1 - vLatam","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/patriciocerda.com\/?p=1467","og_locale":"en_US","og_type":"article","og_title":"OpenShift ETCD backup and Restore with Kasten K10 - Part 1 - vLatam","og_description":"Hi all and welcome back.\u00a0 In this blog post I\u2019ll","og_url":"https:\/\/patriciocerda.com\/?p=1467","og_site_name":"vLatam","article_published_time":"2023-05-23T10:27:38+00:00","article_modified_time":"2023-05-26T09:54:34+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/IntroBlog1467.png","type":"image\/png"}],"author":"pcerda","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pcerda","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/patriciocerda.com\/?p=1467","url":"https:\/\/patriciocerda.com\/?p=1467","name":"OpenShift ETCD backup and Restore with Kasten K10 - Part 1 - vLatam","isPartOf":{"@id":"https:\/\/patriciocerda.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/patriciocerda.com\/?p=1467#primaryimage"},"image":{"@id":"https:\/\/patriciocerda.com\/?p=1467#primaryimage"},"thumbnailUrl":"https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/IntroBlog1467.png","datePublished":"2023-05-23T10:27:38+00:00","dateModified":"2023-05-26T09:54:34+00:00","author":{"@id":"https:\/\/patriciocerda.com\/#\/schema\/person\/613aa192d7dbcedcd20e08318891aa2a"},"breadcrumb":{"@id":"https:\/\/patriciocerda.com\/?p=1467#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/patriciocerda.com\/?p=1467"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/patriciocerda.com\/?p=1467#primaryimage","url":"https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/IntroBlog1467.png","contentUrl":"https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/IntroBlog1467.png","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/patriciocerda.com\/?p=1467#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/patriciocerda.com\/"},{"@type":"ListItem","position":2,"name":"OpenShift ETCD backup and Restore with Kasten K10 &#8211; Part 1"}]},{"@type":"WebSite","@id":"https:\/\/patriciocerda.com\/#website","url":"https:\/\/patriciocerda.com\/","name":"vLatam","description":"El Blog de Patricio Cerda","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/patriciocerda.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/patriciocerda.com\/#\/schema\/person\/613aa192d7dbcedcd20e08318891aa2a","name":"pcerda","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/patriciocerda.com\/#\/schema\/person\/image\/","url":"https:\/\/patriciocerda.com\/wp-content\/litespeed\/avatar\/ce92117b9294544adeaad229a8fbac13.jpg?ver=1776167859","contentUrl":"https:\/\/patriciocerda.com\/wp-content\/litespeed\/avatar\/ce92117b9294544adeaad229a8fbac13.jpg?ver=1776167859","caption":"pcerda"},"url":"https:\/\/patriciocerda.com\/?author=1"}]}},"jetpack_featured_media_url":"https:\/\/patriciocerda.com\/wp-content\/uploads\/2023\/05\/IntroBlog1467.png","_links":{"self":[{"href":"https:\/\/patriciocerda.com\/index.php?rest_route=\/wp\/v2\/posts\/1467"}],"collection":[{"href":"https:\/\/patriciocerda.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/patriciocerda.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/patriciocerda.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/patriciocerda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1467"}],"version-history":[{"count":5,"href":"https:\/\/patriciocerda.com\/index.php?rest_route=\/wp\/v2\/posts\/1467\/revisions"}],"predecessor-version":[{"id":1499,"href":"https:\/\/patriciocerda.com\/index.php?rest_route=\/wp\/v2\/posts\/1467\/revisions\/1499"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/patriciocerda.com\/index.php?rest_route=\/wp\/v2\/media\/1471"}],"wp:attachment":[{"href":"https:\/\/patriciocerda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/patriciocerda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/patriciocerda.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}