github.com/kubernetes-incubator/kube-aws@v0.16.4/docs/add-ons/cluster-resource-backup-to-s3.md (about)

     1  # Kubernetes Resource Backup / Autosave
     2  
     3  A feature to backup of Kubernetes resources can be enabled by specifying the following in `cluster.yaml`: 
     4  
     5  ```yaml
     6  kubeResourcesAutosave:
     7      enabled: true
     8  ```
     9  
    10  When active, a kube-system Deployment schedules a single pod to take and upload snapshots of all Kubernetes resources to S3.
    11  - Backups are taken and exported when the pod (re)starts and then continues to backup in 24 hours intervals.
    12  - Each snapshot resides in a timestamped folder
    13  - The resources have several fields omitted such as status , uid, etc ... this is to allow the possibility of restoring resources inside a fresh cluster
    14  - Resources that reside within namespaces are grouped inside folders labeled with the namespace name
    15  - Resources outside namespaces are grouped at the same directory level as the namespace folders
    16  - The backups are exported to the S3 URI: ```s3://<your-bucket-name>/.../<your-cluster-name>/backup/*```
    17  
    18  # Example
    19  
    20  A Kubernetes environment has the namespaces:
    21   - kube-system
    22   - alpha
    23   - beta
    24   
    25  A backup is created on 04/05/2017 at 13:48:33.
    26  
    27  The backup is exported to S3 to the path: 
    28  
    29  ```
    30  s3://my-bucket-name/my-cluster-name/backup/17-05-04_13-48-33
    31  ```
    32  
    33  Inside the ```17-05-04_13-48-33``` directory are be several .json files of the Kubernetes resources that reside outside namespaces, in addition to a number of folders with names matching the namespaces:
    34  
    35  ```
    36  17-05-04_13-48-33/kube-system
    37  17-05-04_13-48-33/alpha
    38  17-05-04_13-48-33/beta
    39  17-05-04_13-48-33/persistentvolumes.json
    40  17-05-04_13-48-33/storageclasses.json
    41  ...
    42  ...
    43  ...
    44  
    45  ```
    46  Inside each namespace folder are be several .json files of the Kubernetes resources that reside inside the respective namespace
    47  ```
    48  17-05-04_13-48-33/kube-system/deployments.json
    49  17-05-04_13-48-33/kube-system/statefulsets.json
    50  ...
    51  ...
    52  ...
    53  
    54  ```
    55  
    56  # Notes
    57  
    58  - The exportation/synchronisation of the backup files to S3 is not guaranteed to succeed every time, because of this there may be few instances of the pusher container reporting the error: `Could not connect to the endpoint URL: "https://......"`. This is an AWS issue.
    59  If such an error does occur then the pushing process will be attempted at the next push interval - default: 1 minute later.
    60  Please see [#591](https://github.com/kubernetes-incubator/kube-aws/issues/591) for more information