From c71f93142a1bdfc433b66cd395ae51e0b31cf5aa Mon Sep 17 00:00:00 2001 From: Sebastiaan van Steenis Date: Tue, 12 Mar 2019 21:58:12 +0100 Subject: [PATCH] Add recovering etcd steps --- .../restoring-downstream/_index.md | 34 ------------------- .../cluster-members/_index.md | 3 +- .../k8s-in-rancher/editing-clusters/_index.md | 2 +- .../k8s-in-rancher/recovering-etcd/_index.md | 34 +++++++++++++++++++ 4 files changed, 37 insertions(+), 36 deletions(-) delete mode 100644 content/rancher/v2.x/en/backups/restorations/restoring-downstream/_index.md rename content/rancher/v2.x/en/{cluster-provisioning => k8s-in-rancher}/cluster-members/_index.md (92%) create mode 100644 content/rancher/v2.x/en/k8s-in-rancher/recovering-etcd/_index.md diff --git a/content/rancher/v2.x/en/backups/restorations/restoring-downstream/_index.md b/content/rancher/v2.x/en/backups/restorations/restoring-downstream/_index.md deleted file mode 100644 index 8523050c72a..00000000000 --- a/content/rancher/v2.x/en/backups/restorations/restoring-downstream/_index.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Restoring Downstream Kubernetes Cluster -weight: 370 -aliases: - - /rancher/v2.x/en/installation/after-installation/restoring-downstream-cluster/ ---- - -Before version 2.2.x Rancher doesn't support backup and restoration of etcd snapshots, to be able to restore etcd cluster on a downstream kubenretes cluster you can run the following procedure: - -1- If etcd lose quorum then the Kubernetes cluster will report a failure in Rancher, the first thing to do is to remove all other etcd nodes and leave only one etcd node in the cluster. - -2- On the remaining node, run the following: - -``` -docker run --rm -v /var/run/docker.sock:/var/run/docker.sock assaflavie/runlike etcd -``` - -This command will get the running command for etcd, you should save this command for later. - -3- Now we need to stop and rename the old etcd: - -``` -$ docker stop etcd -$ docker rename etcd etcd-old -``` - -4- Now we need to make two changes to the running command from step 2: - -- If you originally had more than 1 etcd node, then you need to change `--initial-cluster` to contain only this node. -- Add `--force-new-cluster` to the end of the command. - -5- Run the command after the changes in step 3. - -6- Its recommended to add new nodes, if you are using a custom cluster and you will re-add the old node its essential to clean the nodes first before adding them back, See [Node Cleanup](https://rancher.com/docs/rancher/v2.x/en/faq/cleaning-cluster-nodes/) for the procedure. diff --git a/content/rancher/v2.x/en/cluster-provisioning/cluster-members/_index.md b/content/rancher/v2.x/en/k8s-in-rancher/cluster-members/_index.md similarity index 92% rename from content/rancher/v2.x/en/cluster-provisioning/cluster-members/_index.md rename to content/rancher/v2.x/en/k8s-in-rancher/cluster-members/_index.md index 3b0c3425578..2831010a798 100644 --- a/content/rancher/v2.x/en/cluster-provisioning/cluster-members/_index.md +++ b/content/rancher/v2.x/en/k8s-in-rancher/cluster-members/_index.md @@ -1,8 +1,9 @@ --- title: Adding Users to Clusters -weight: 2500 +weight: 100 aliases: - /rancher/v2.x/en/tasks/clusters/adding-managing-cluster-members/ + - /rancher/v2.x/en/cluster-provisioning/cluster-members/ --- If you want to provide a user with access and permissions to _all_ projects, nodes, and resources within a cluster, assign the user a cluster membership. diff --git a/content/rancher/v2.x/en/k8s-in-rancher/editing-clusters/_index.md b/content/rancher/v2.x/en/k8s-in-rancher/editing-clusters/_index.md index 3c7717bce77..e5ced9bac94 100644 --- a/content/rancher/v2.x/en/k8s-in-rancher/editing-clusters/_index.md +++ b/content/rancher/v2.x/en/k8s-in-rancher/editing-clusters/_index.md @@ -1,6 +1,6 @@ --- title: Editing Clusters -weight: 3015 +weight: 200 --- After you provision a Kubernetes cluster using Rancher, you can still edit options and settings for the cluster. To edit your cluster, open the **Global** view, make sure the **Clusters** tab is selected, and then select **Ellipsis (...) > Edit** for the cluster that you want to edit. diff --git a/content/rancher/v2.x/en/k8s-in-rancher/recovering-etcd/_index.md b/content/rancher/v2.x/en/k8s-in-rancher/recovering-etcd/_index.md new file mode 100644 index 00000000000..d3dcec393de --- /dev/null +++ b/content/rancher/v2.x/en/k8s-in-rancher/recovering-etcd/_index.md @@ -0,0 +1,34 @@ +--- +title: Recovering etcd +weight: 300 +--- + +> **Note:** Recovering etcd is only applicable to [Rancher Launched Kubernetes]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/rke-clusters/) + +If the etcd cluster loses quorum (see [Count of etcd Nodes]({{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/production/#count-of-etcd-nodes)), the Kubernetes cluster will report a failure in Rancher because no operations can be executed in the Kubernetes cluster (operations like deploying workloads or scaling workloads). If you want to recover your etcd cluster, you can follow the steps below. + +1- Remove all other etcd nodes and leave only one etcd node in the cluster. + +2- On the single remaining etcd node, run the following command: + +``` +docker run --rm -v /var/run/docker.sock:/var/run/docker.sock assaflavie/runlike etcd +``` + +This command will get the running command for etcd, you should save this command for later. + +3- Now we need to stop the etcd container and rename it to `etcd-old`: + +``` +$ docker stop etcd +$ docker rename etcd etcd-old +``` + +4- Use the command retrieved in step 2 and make the following changes in the command: + +- If you originally had more than 1 etcd node, then you need to change `--initial-cluster` to contain only this node. +- Add `--force-new-cluster` to the end of the command. + +5- Run the command after the changes in step 4. + +6- It is recommended to add new nodes with the etcd role. If you are using a custom cluster and you want to reuse the old node, it is essential to clean the nodes first before adding them back. See [Node Cleanup]({{< baseurl >}}/rancher/v2.x/en/faq/cleaning-cluster-nodes/) for the procedure.