docker / docker/cli

[RFC] Add a command to backup/restore Swarm state

Open
#148 4 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/swarm kind/feature
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

In reaction to https://github.com/moby/moby/issues/33462, I was discussing with @diogomonica that if we consider the secrets store in swarm to be the "source of truth" (i.e., not just a "copy" of secrets stored/managed elsewhere), that there should be an easy way to backup and restore the swarm state, without users having to dive into /var/lib/docker/swarm to create an archive.

SwarmKit does have a tool to dump this data https://github.com/docker/swarmkit/blob/master/cmd/swarm-rafttool/dump.go, but AFAIK, this is not exposed through the docker CLI

Use-cases;

  • backing up swarm state
  • support (sending swarm state for investigation)
  • migrating a cluster to new hardware / disaster recovery

Given that that directory contains both the data, and keys to decrypt the data, perhaps keys and data should be exported separately, so that data can be backed-up, and transported safely

/cc @aaronlehmann

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SwarmKit swarm-rafttool/dump.go tool and the Docker CLI context described in the issue, then compare that with the data and keys under /var/lib/docker/swarm. Define the backup and restore command scope, including whether keys and data are exported separately. Done means users can back up and restore Swarm state without manually archiving that directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, distributed-systems, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.