From 9e8370f577449b35a63609deea61c6b1fa15b4f2 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Wed, 2 Jan 2019 12:50:14 +0800 Subject: [PATCH 1/6] Add backup doc --- doc/backup-and-restore.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/backup-and-restore.md diff --git a/doc/backup-and-restore.md b/doc/backup-and-restore.md new file mode 100644 index 0000000..189294e --- /dev/null +++ b/doc/backup-and-restore.md @@ -0,0 +1,17 @@ +# Backups + +We're using [Ark][1] for backing up Kubernetes config and GKE resources. + +## 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 -- 2.25.1 From c3bf234cba67ba072cfa0b925ab7eed97deb0a28 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sat, 5 Jan 2019 10:14:49 +0800 Subject: [PATCH 2/6] Add Ark as submodule Heptio Ark is a Kubernetes backup solution. See docs. --- .gitmodules | 3 +++ vendor/ark | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 vendor/ark diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..f7d9090 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/ark"] + path = vendor/ark + url = git@github.com:heptio/ark.git diff --git a/vendor/ark b/vendor/ark new file mode 160000 index 0000000..0fd7872 --- /dev/null +++ b/vendor/ark @@ -0,0 +1 @@ +Subproject commit 0fd7872ef48ce617e561e6e45f8ccb0f11637f58 -- 2.25.1 From a16143a3f41b79fc79da301d3a57fb70b3068989 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sat, 5 Jan 2019 10:22:48 +0800 Subject: [PATCH 3/6] Add docs for Ark dependency --- doc/backup-and-restore.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/backup-and-restore.md b/doc/backup-and-restore.md index 189294e..49da412 100644 --- a/doc/backup-and-restore.md +++ b/doc/backup-and-restore.md @@ -1,6 +1,19 @@ # Backups -We're using [Ark][1] for backing up Kubernetes config and GKE resources. +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 submodules in your local repo, run once: + + git submodule 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]. ## Backup location @@ -15,3 +28,4 @@ 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 -- 2.25.1 From 3692204ce45a94c47123358c002a8a5963c124b7 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sat, 5 Jan 2019 11:09:25 +0800 Subject: [PATCH 4/6] Add app label for all Gitea resources This way one can address them all at once, like e.g. for Ark backups. --- kubernetes/gitea-db.yaml | 5 +++++ kubernetes/gitea-server.yaml | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/kubernetes/gitea-db.yaml b/kubernetes/gitea-db.yaml index 629c017..6b262cd 100644 --- a/kubernetes/gitea-db.yaml +++ b/kubernetes/gitea-db.yaml @@ -2,6 +2,8 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: name: gitea-db + labels: + app: gitea spec: replicas: 1 strategy: @@ -10,6 +12,7 @@ spec: metadata: labels: name: gitea-db + app: gitea spec: containers: - env: @@ -48,6 +51,7 @@ metadata: name: gitea-db-data labels: name: gitea-db-data + app: gitea spec: accessModes: - ReadWriteOnce @@ -61,6 +65,7 @@ metadata: name: gitea-db labels: service: gitea-db + app: gitea spec: selector: name: gitea-db diff --git a/kubernetes/gitea-server.yaml b/kubernetes/gitea-server.yaml index c5deea6..8a48bcd 100644 --- a/kubernetes/gitea-server.yaml +++ b/kubernetes/gitea-server.yaml @@ -2,12 +2,15 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: name: gitea-server + labels: + app: gitea spec: replicas: 1 template: metadata: labels: name: gitea-server + app: gitea spec: initContainers: - name: init-config @@ -54,6 +57,8 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: gitea-server-data + labels: + app: gitea spec: accessModes: - ReadWriteOnce @@ -67,6 +72,7 @@ metadata: name: gitea-server labels: name: gitea-server + app: gitea spec: type: LoadBalancer # preserves the client source IP -- 2.25.1 From cef013a40a072b5f1b46ff1f539ba5759f85d258 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sat, 5 Jan 2019 11:23:17 +0800 Subject: [PATCH 5/6] Update backup docs --- doc/backup-and-restore.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/backup-and-restore.md b/doc/backup-and-restore.md index 49da412..c7bb9af 100644 --- a/doc/backup-and-restore.md +++ b/doc/backup-and-restore.md @@ -13,7 +13,11 @@ 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]. +[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 @@ -29,3 +33,4 @@ creates volume snapshots as native [GCE disk snapshots][2]. [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.25.1 From 78bccff685e5274cb09941f877083466bcd0ef7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Mon, 7 Jan 2019 12:01:49 +0100 Subject: [PATCH 6/6] Use the git submodule update command with the --init flag in the docs --- doc/backup-and-restore.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/backup-and-restore.md b/doc/backup-and-restore.md index c7bb9af..c953546 100644 --- a/doc/backup-and-restore.md +++ b/doc/backup-and-restore.md @@ -4,9 +4,9 @@ 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 submodules in your local repo, run once: +In order to initialize and update submodules in your local repo, run once: - git submodule init + git submodule update --init Then, to fetch/update the modules, run: -- 2.25.1