github.com/kubernetes-incubator/kube-aws@v0.16.4/contrib/cluster-backup/README.md (about) 1 # Restore 2 Restoring a Kubernetes environment (from a previous backup) may be executed through the use of the bash script: [kubernetes-on-aws-restore.sh](/contrib/cluster-backup/restore.sh) 3 4 The script was designed to be used by the cluster provisioner and assumes that their local machine has: 5 - 'kubectl' installed locally 6 - 'aws' installed locally 7 - 'jq' installed locally 8 - 'kubeconfig' configured correctly 9 - 'jq' configured correctly 10 - cluster is reachable 11 12 The script will **(kubectl) create** Kubernetes resources per namespace. All namespaces (and associated resources) are restored by default with the exception of namespaces: 'kube-system' and 'default'. 13 To whitelist namespaces, include the desired namespace names as additional arguments after the initial BUCKET_URI argument. 14 The BUCKET_URI argument is the URL of the timestamped folder. 15 16 ## Implementation 17 1) The script will initially validate that the namespaces it is to restore are not already existing. 18 2) Kubernetes resources common to all namespaces (such as *StorageClass*) are created. 19 3) For each namespace to restore, the namespace is created and Kubernetes resources within the namespace are created. 20 21 ### Considerations 22 - Restoring *PersistentVolumes* does not provision new volumes from AWS - it assumes such volumes already exist in AWS. 23 - You may have to tailor the script for your specific needs. 24 25 26 ### Example 27 28 Following the deletion of a cluster, another newly created cluster is to be restored with the same Kubernetes environment. 29 30 A backup was previously exported to S3 to the path: 31 ``` 32 s3://my-bucket-name/my-cluster-name/backup/17-05-04_13-48-33 33 ``` 34 After the new cluster has been provisioned and all nodes are up and operational, the provisioner restores the cluster: 35 ``` 36 $ kubernetes-on-aws-restore.sh s3://my-bucket-name/my-cluster-name/backup/17-05-04_13-48-33 37 ```