1"use strict";(self.webpackChunkspectro_cloud_docs=self.webpackChunkspectro_cloud_docs||[]).push([["13014"],{514351:function(e,s,t){t.r(s),t.d(s,{frontMatter:()=>l,toc:()=>a,default:()=>h,metadata:()=>r,assets:()=>i,contentTitle:()=>d});var r=JSON.parse('{"id":"clusters/cluster-management/backup-restore/enable-etcd-backup","title":"Configure etcd Backup","description":"Learn how to enable scheduled etcd backups.","source":"@site/docs/docs-content/clusters/cluster-management/backup-restore/enable-etcd-backup.md","sourceDirName":"clusters/cluster-management/backup-restore","slug":"/clusters/cluster-management/backup-restore/enable-etcd-backup","permalink":"/clusters/cluster-management/backup-restore/enable-etcd-backup","draft":false,"unlisted":false,"editUrl":"https://github.com/spectrocloud/librarium/blob/master/docs/docs-content/clusters/cluster-management/backup-restore/enable-etcd-backup.md","tags":[{"inline":true,"label":"clusters","permalink":"/tags/clusters"},{"inline":true,"label":"cluster management","permalink":"/tags/cluster-management"},{"inline":true,"label":"backup","permalink":"/tags/backup"}],"version":"current","lastUpdatedAt":1777826507000,"sidebarPosition":45,"frontMatter":{"sidebar_label":"Configure etcd Backup","title":"Configure etcd Backup","description":"Learn how to enable scheduled etcd backups.","hide_table_of_contents":false,"sidebar_position":45,"tags":["clusters","cluster management","backup"]},"sidebar":"docSidebar","previous":{"title":"Restore Cluster Backup","permalink":"/clusters/cluster-management/backup-restore/restore-cluster-backup"},"next":{"title":"Cert Manager Add-On","permalink":"/clusters/cluster-management/cert-manager-addon"}}'),n=t(474848),c=t(884429);let l={sidebar_label:"Configure etcd Backup",title:"Configure etcd Backup",description:"Learn how to enable scheduled etcd backups.",hide_table_of_contents:!1,sidebar_position:45,tags:["clusters","cluster management","backup"]},d,i={},a=[{value:"Prerequisite",id:"prerequisite",level:2},{value:"Configure etcd Backup",id:"configure-etcd-backup",level:2},{value:"Validate",id:"validate",level:2},{value:"Next Steps",id:"next-steps",level:2}];function o(e){let s={a:"a",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,c.R)(),...e.components},{TabItem:t,Tabs:r}=s;return t||u("TabItem",!0),r||u("Tabs",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"etcd backups are enabled by default and backups are performed on each etcd node. You can adjust the backup frequency,\nthe location of the backup files, and the maximum number of backup files to retain by editing the YAML file of your\ncluster profile's Kubernetes layer."}),"\n",(0,n.jsx)(s.h2,{id:"prerequisite",children:"Prerequisite"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["An active cluster in Palette using PXK, PXK-E, RKE2, or K3s as its Kubernetes layer.","\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"The MicroK8s distribution of Kubernetes uses dqlite3 instead of etcd for its data store by default, so these steps\nare not applicable to MicroK8s instances."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"configure-etcd-backup",children:"Configure etcd Backup"}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["Log in to ",(0,n.jsx)(s.a,{href:"https://console.spectrocloud.com",children:"Palette"}),"."]}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["From the ",(0,n.jsx)(s.strong,{children:"Main Menu"}),", select ",(0,n.jsx)(s.strong,{children:"Profiles"}),"."]}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"Select the profile you use to deploy clusters. And then, select the Kubernetes layer of your profile."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"Edit the YAML file of your Kubernetes layer and add the following configurations. Depending on your Kubernetes\ndistribution, different configuration parameters are available."}),"\n",(0,n.jsxs)(r,{group:"distribution",children:[(0,n.jsxs)(t,{value:"PXK",label:"PXK/PXK-E",children:[(0,n.jsxs)(s.p,{children:["In Palette eXtended Kubernetes (PXK), etcd backup is enabled by default and cannot be disabled. You also cannot\nchange the directory where the backups are stored, which is ",(0,n.jsx)(s.code,{children:"/var/lib/etcd"}),"."]}),(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{children:"Parameter"}),(0,n.jsx)(s.th,{children:"Description"}),(0,n.jsx)(s.th,{children:"Default"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"kubeadmconfig.etcd.local.extraArgs.snapshot-count"})}),(0,n.jsx)(s.td,{children:"The number of committed transactions required to trigger a snapshot."}),(0,n.jsx)(s.td,{children:"100000"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"kubeadmconfig.etcd.local.extraArgs.max-snapshots"})}),(0,n.jsx)(s.td,{children:"The maximum number of etcd backups to retain."}),(0,n.jsx)(s.td,{children:"5"})]})]})]}),(0,n.jsx)(s.p,{children:"For example,"}),(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:'kubeadmconfig:\n etcd:\n local:\n extraArgs:\n max-snapshots: 10\n snapshot-count: "10000"\n'})})]}),(0,n.jsxs)(t,{value:"rke2",label:"RKE2",children:[(0,n.jsx)(s.p,{children:"Use the following parameters to configure scheduled backups."}),(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{children:"Parameter"}),(0,n.jsx)(s.th,{children:"Description"}),(0,n.jsx)(s.th,{children:"Default"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"cluster.config.etcd-snapshot-schedule-cron"})}),(0,n.jsxs)(s.td,{children:["A cron expression that controls the time and frequency of scheduled backups. For example, the default value ",(0,n.jsx)(s.code,{children:"0 */1 * * *"})," means the scheduled backup runs every hour."]}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"0 */1 * * *"})})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"cluster.config.etcd-snapshot-retention"})}),(0,n.jsx)(s.td,{children:"The maximum number of etcd backups to retain."}),(0,n.jsx)(s.td,{children:"12"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"cluster.config.etcd-disable-snapsh
1ots"})}),(0,n.jsx)(s.td,{children:"Controls whether or not to disable scheduled etcd snapshots."}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"false"})})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"cluster.config.etcd-snapshot-dir"})}),(0,n.jsx)(s.td,{children:"Specifies the directory where the etcd snapshots are saved."}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"/var/lib/rancher/rke2/server/db/snapshots"})})]})]})]}),(0,n.jsx)(s.p,{children:"For example,"}),(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"cluster:\n config:\n etcd-snapshot-schedule-cron: 0 */1 * * *\n etcd-snapshot-retention: 12\n etcd-disable-snapshots: false\n etcd-snapshot-dir: /var/lib/rancher/rke2/server/db/snapshots\n"})})]}),(0,n.jsxs)(t,{value:"k3s",label:"K3S",children:[(0,n.jsx)(s.p,{children:"Use the following parameters to configure scheduled backups."}),(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{children:"Parameter"}),(0,n.jsx)(s.th,{children:"Description"}),(0,n.jsx)(s.th,{children:"Default"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"cluster.config.etcd-snapshot-schedule-cron"})}),(0,n.jsxs)(s.td,{children:["A cron expression that controls the time and frequency of scheduled backups. For example, the default value ",(0,n.jsx)(s.code,{children:"0 */1 * * *"})," means the scheduled backup runs every hour."]}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"0 */1 * * *"})})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"cluster.config.etcd-snapshot-retention"})}),(0,n.jsx)(s.td,{children:"The maximum number of etcd backups to retain."}),(0,n.jsx)(s.td,{children:"12"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"cluster.config.etcd-disable-snapshots"})}),(0,n.jsx)(s.td,{children:"Controls whether or not to disable scheduled etcd snapshots."}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"false"})})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"cluster.config.etcd-snapshot-dir"})}),(0,n.jsxs)(s.td,{children:["Specifies the directory where the etcd snapshots are saved. By default, this value is ",(0,n.jsx)(s.code,{children:"/var/lib/k3s/rancher/server/db/snapshots"}),"."]}),(0,n.jsx)(s.td,{children:(0,n.jsx)(s.code,{children:"/var/lib/rancher/k3s/server/db/snapshots"})})]})]})]}),(0,n.jsx)(s.p,{children:"For example,"}),(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"cluster:\n config:\n etcd-snapshot-schedule-cron: 0 */1 * * *\n etcd-snapshot-retention: 12\n etcd-disable-snapshots: false\n etcd-snapshot-dir: /var/lib/rancher/k3s/server/db/snapshots\n"})})]})]}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["If you have not deployed a cluster, finish the cluster profile creation and deploy a cluster. For more information,\nrefer to ",(0,n.jsx)(s.a,{href:"/profiles/cluster-profiles/create-cluster-profiles/create-full-profile",children:"Create Cluster Profile"}),"\nfor non-Edge and ",(0,n.jsx)(s.a,{href:"/clusters/edge/site-deployment/model-profile",children:"Model Cluster Profile"}),"."]}),"\n",(0,n.jsxs)(s.p,{children:["If you are editing the profile of an active cluster, updating the profile will trigger and update to the active\ncluster. We recommend that you publish a new version of the profile instead of updating a profile directly. For more\ninformation, refer to ",(0,n.jsx)(s.a,{href:"/clusters/cluster-management/cluster-updates",children:"Update a Cluster"}),"."]}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"validate",children:"Validate"}),"\n",(0,n.jsx)(s.p,{children:"To validate the snapshots are successfully configured, connect to any control plane node of the cluster via SSH and\nchange into the directory where the etcd snapshots are saved. Confirm that the snapshots are being created in the\ndirectory."}),"\n",(0,n.jsx)(s.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,n.jsxs)(s.p,{children:["If your cluster experiences data corruption issues, you can use the etcd snapshots to restore the cluster to working\nconditions. Restoring a cluster may be a challenging procedure, depending on your experience and technical skill level.\nThe restoration also requires SSH access to the node and intimate knowledge of etcd. If you have concerns or need\nassistance, contact us ",(0,n.jsx)(s.a,{href:"mailto:[email protected]",children:"[email protected]"})," for additional guidance."]}),"\n",(0,n.jsx)(s.p,{children:"The following is list of helpful resources that can help you understand disaster recovery for etcd:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://etcd.io/docs/v3.5/op-guide/recovery/",children:"Disaster recovery"})}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/",children:"Operating etcd clusters for Kubernetes"})}),"\n"]}),"\n"]})]})}function h(e={}){let{wrapper:s}={...(0,c.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(o,{...e})}):o(e)}function u(e,s){throw Error("Expected "+(s?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},884429:function(e,s,t){t.d(s,{R:()=>l,x:()=>d});var r=t(296540);let n={},c=r.createContext(n);function l(e){let s=r.useContext(c);return r.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:l(e.components),r.createElement(c.Provider,{value:s},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.