Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

Commit 237d005

Browse files
authored
v0.10.1 (#373)
documenting `shippercl backup` commands and adding to changelog 0.10.
1 parent 0409d75 commit 237d005

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed

CHANGELOG-0.10.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
so that each operation can be done separately. For example, this
2525
allows operators to only set up the application clusters, without
2626
touching the management cluster ([#358][])
27+
* It is now possible to create backups and restore backups using
28+
`shipperctl backup` commands ([#372][]).
2729
* Shipper now rejects all modifications to the `environment` field of
2830
all releases. This fixes an issue where users would modify this
2931
field and cause an unsupported behavior ([#357][])
@@ -64,4 +66,5 @@
6466
[#358]: https://github.com/bookingcom/shipper/pull/358
6567
[#366]: https://github.com/bookingcom/shipper/pull/366
6668
[#357]: https://github.com/bookingcom/shipper/pull/357
69+
[#372]: https://github.com/bookingcom/shipper/pull/372
6770
[failure policy]: https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#failure-policy

docs/operations/shipperctl.rst

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,94 @@ underscores in their names. To solve this, specify ``context`` explicitly in ``c
183183
context: gke_ACCOUNT_ZONE_CLUSTERNAME_APP_2 # and here
184184
scheduler:
185185
unschedulable: true
186+
187+
188+
Creating backups and restoring Using ``shipperctl backup`` Commands
189+
----------------------------------------------------------------------
190+
191+
.. _create_backup:
192+
193+
``shipperctl backup prepare``
194+
+++++++++++++++++++++++++++++++
195+
196+
1. The backup must be created by a `shipperctl` command. This guarantees you can restore this backup.
197+
Acquire a backup file by running
198+
199+
.. code-block:: bash
200+
201+
$ kubectl config use-context mgmt-dev-cluster ##be sure to switch to correct context of the management cluster before backing up
202+
Switched to context "mgmt-dev-cluster"
203+
$ shipperctl backup prepare -v -f bkup-dev-29-10.yaml
204+
NAMESPACE RELEASE NAME OWNING APPLICATION
205+
default super-server-dc5bfc5a-0 super-server
206+
default2 super-server2-dc5bfc5a-0 super-server2
207+
default3 super-server3-dc5bfc5a-0 super-server3
208+
Backup objects stored in "bkup-dev-29-10.yaml"
209+
210+
211+
.. epigraph::
212+
213+
The command's default format is yaml. This will create a file named "bkup-dev-29-10.yaml" and store the backup there in a yaml format.
214+
215+
2. Save the backup file in a storage system of your liking (for example, AWS S3)
216+
217+
3. That's it! Repeat steps 1+2 for all management clusters.
218+
219+
``shipperctl backup restore``
220+
+++++++++++++++++++++++++++++++++
221+
222+
1. Download your latest backup from your selected storing system
223+
224+
2. Make sure that Shipper is down (`spec.replicas: 0`) before applying objects.
225+
226+
3. Use `shipperctl` to restore your backup:
227+
228+
.. code-block:: bash
229+
230+
$ kubectl config use-context mgmt-dev-cluster ##be sure to switch to correct management context before restoring backing up
231+
Switched to context "mgmt-dev-cluster"
232+
$ shipperctl backup restore -v -f bkup-dev-29-10-from-s3.yaml
233+
Would you like to see an overview of your backup? [y/n]: y
234+
NAMESPACE RELEASE NAME OWNING APPLICATION
235+
default super-server-dc5bfc5a-0 super-server
236+
default2 super-server2-dc5bfc5a-0 super-server2
237+
default3 super-server3-dc5bfc5a-0 super-server3
238+
Would you like to review backup? [y/n]: y
239+
- application:
240+
apiVersion: shipper.booking.com/v1alpha1
241+
kind: Application
242+
...
243+
backup_releases:
244+
- capacity_target:
245+
apiVersion: shipper.booking.com/v1alpha1
246+
kind: CapacityTarget
247+
...
248+
installation_target:
249+
apiVersion: shipper.booking.com/v1alpha1
250+
kind: InstallationTarget
251+
...
252+
release:
253+
apiVersion: shipper.booking.com/v1alpha1
254+
kind: Release
255+
...
256+
traffic_target:
257+
apiVersion: shipper.booking.com/v1alpha1
258+
kind: TrafficTarget
259+
...
260+
...
261+
Would you like to restore backup? [y/n]: y
262+
application "default/super-server" created
263+
release "default/super-server-dc5bfc5a-0" owner reference updates with uid "a6c587cb-624e-44ec-b267-b48630b0ed1c"
264+
release "default/super-server-dc5bfc5a-0" created
265+
installation target "default/super-server-dc5bfc5a-0" owner reference updates with uid "9ccfd876-7f4f-4b1c-9c10-653d295e21d2"
266+
installation target "default/super-server-dc5bfc5a-0" created
267+
traffic target "default/super-server-dc5bfc5a-0" owner reference updates with uid "9ccfd876-7f4f-4b1c-9c10-653d295e21d2"
268+
traffic target "default/super-server-dc5bfc5a-0" created
269+
capacity target "default/super-server-dc5bfc5a-0" owner reference updates with uid "9ccfd876-7f4f-4b1c-9c10-653d295e21d2"
270+
capacity target "default/super-server-dc5bfc5a-0" created
271+
...
272+
273+
.. epigraph::
274+
275+
- The command's default format is yaml. This will apply the backup from file "bkup-dev-29-10-from-s3.yaml" while maintaining owner references between an application and its releases and between release and its target objects.
276+
- The backup file must be created using :ref:`shipperctl backup prepare <create_backup>` command.

0 commit comments

Comments
 (0)