Backup & Restore #11
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[submodule "vendor/ark"]
|
||||||
|
path = vendor/ark
|
||||||
|
url = git@github.com:heptio/ark.git
|
36
doc/backup-and-restore.md
Normal file
36
doc/backup-and-restore.md
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# Backups
|
||||||
|
|
||||||
|
We're using [Ark][1] for backing up Kubernetes config and GKE resources. It is
|
||||||
|
available as a Git submodule in the `vendor/` folder (incl. the `ark`
|
||||||
|
executable).
|
||||||
|
|
||||||
|
In order to initialize and update submodules in your local repo, run once:
|
||||||
|
|
||||||
|
git submodule update --init
|
||||||
|
|
||||||
|
Then, to fetch/update the modules, run:
|
||||||
|
|
||||||
|
git submodule update
|
||||||
|
|
||||||
|
The Ark service is running on the Sidamo cluster and was set up using the
|
||||||
|
[official docs' GCP instructions and config files][4]. There's a daily backup
|
||||||
|
schedule in effect for Gitea (using the label `app=gitea`).
|
||||||
|
|
||||||
|
Please refer to Ark's [ Getting Started ][5] doc for all backup and restore
|
||||||
|
commands.
|
||||||
|
|
||||||
|
## Backup location
|
||||||
|
|
||||||
|
Cluster configuration (including all live resources) is backed up to [a Google
|
||||||
|
Cloud Storage container][3].
|
||||||
|
|
||||||
|
## Persistent volumes
|
||||||
|
|
||||||
|
Persistent volumes are just GCE disks. Thus, with the current config, Ark
|
||||||
|
creates volume snapshots as native [GCE disk snapshots][2].
|
||||||
|
|
||||||
|
[1]: https://heptio.github.io/ark/v0.10.0
|
||||||
|
[2]: https://console.cloud.google.com/compute/snapshots?organizationId=772167872692&project=fluted-magpie-218106&tab=snapshots&snapshotssize=50
|
||||||
|
[3]: https://console.cloud.google.com/storage/browser/sidamo-backups?project=fluted-magpie-218106&organizationId=772167872692
|
||||||
|
[4]: https://heptio.github.io/ark/v0.10.0/gcp-config
|
||||||
|
[5]: https://heptio.github.io/ark/v0.10.0/get-started
|
@ -2,6 +2,8 @@ apiVersion: extensions/v1beta1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: gitea-db
|
name: gitea-db
|
||||||
|
labels:
|
||||||
|
app: gitea
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
strategy:
|
strategy:
|
||||||
@ -10,6 +12,7 @@ spec:
|
|||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
name: gitea-db
|
name: gitea-db
|
||||||
|
app: gitea
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- env:
|
- env:
|
||||||
@ -48,6 +51,7 @@ metadata:
|
|||||||
name: gitea-db-data
|
name: gitea-db-data
|
||||||
labels:
|
labels:
|
||||||
name: gitea-db-data
|
name: gitea-db-data
|
||||||
|
app: gitea
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
@ -61,6 +65,7 @@ metadata:
|
|||||||
name: gitea-db
|
name: gitea-db
|
||||||
labels:
|
labels:
|
||||||
service: gitea-db
|
service: gitea-db
|
||||||
|
app: gitea
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
name: gitea-db
|
name: gitea-db
|
||||||
|
@ -2,12 +2,15 @@ apiVersion: extensions/v1beta1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: gitea-server
|
name: gitea-server
|
||||||
|
labels:
|
||||||
|
app: gitea
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
name: gitea-server
|
name: gitea-server
|
||||||
|
app: gitea
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: init-config
|
- name: init-config
|
||||||
@ -54,6 +57,8 @@ apiVersion: v1
|
|||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: gitea-server-data
|
name: gitea-server-data
|
||||||
|
labels:
|
||||||
|
app: gitea
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
@ -67,6 +72,7 @@ metadata:
|
|||||||
name: gitea-server
|
name: gitea-server
|
||||||
labels:
|
labels:
|
||||||
name: gitea-server
|
name: gitea-server
|
||||||
|
app: gitea
|
||||||
spec:
|
spec:
|
||||||
type: LoadBalancer
|
type: LoadBalancer
|
||||||
# preserves the client source IP
|
# preserves the client source IP
|
||||||
|
1
vendor/ark
vendored
Submodule
1
vendor/ark
vendored
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 0fd7872ef48ce617e561e6e45f8ccb0f11637f58
|
Reference in New Issue
Block a user