Skip to content

Commit

Permalink
docs: added markdownlint rules and fix md issues
Browse files Browse the repository at this point in the history
  • Loading branch information
WoozyMasta committed Feb 10, 2022
1 parent 2da4dcd commit 0d7b644
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
default: true
MD024: false
92 changes: 46 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Backup a Kubernetes cluster as a yaml manifest.
* [Commands and flags](#commands-and-flags)
* [Environment variables](#environment-variables)
* [Resources default's](#resources-defaults)
* [Plans for further development](#plans-for-further-development)

## Description

Expand All @@ -37,15 +38,6 @@ Key features:
* It is possible to configure via command line arguments as well as via
environment variables.

Plans to implement:

* Sending dumps to s3 bucket;
* Sending notifications by email and webhook;
* Git-crypt to encrypt secrets;
* Bash autocomplete.

---

[![asciicast](https://raw.githubusercontent.com/WoozyMasta/kube-dump/master/extras/kube-dump.gif)](https://asciinema.org/a/3FfZlP011rF0gj443QnuWdNFE)

## Quick Start Guides
Expand All @@ -62,27 +54,27 @@ Plans to implement:

## Container Images

* [`docker pull ghcr.io/woozymasta/kube-dump:1.1.0`](https://github.com/WoozyMasta/kube-dump/pkgs/container/kube-dump)
* [`docker pull quay.io/woozymasta/kube-dump:1.1.0`](https://quay.io/repository/woozymasta/kube-dump)
* [`docker pull docker.io/woozymasta/kube-dump:1.1.0`](https://hub.docker.com/r/woozymasta/kube-dump)
* [`docker pull ghcr.io/woozymasta/kube-dump:1.1.1`](https://github.com/WoozyMasta/kube-dump/pkgs/container/kube-dump)
* [`docker pull quay.io/woozymasta/kube-dump:1.1.1`](https://quay.io/repository/woozymasta/kube-dump)
* [`docker pull docker.io/woozymasta/kube-dump:1.1.1`](https://hub.docker.com/r/woozymasta/kube-dump)

## Dependencies

Required dependencies:

* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) -
* [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/) -
Kubernetes command-line tool
* [jq](https://github.com/stedolan/jq) - Command-line JSON processor
* [yq](https://github.com/mikefarah/yq) - Command-line YAML processor
* [`jq`](https://github.com/stedolan/jq) - Command-line JSON processor
* [`yq`](https://github.com/mikefarah/yq) - Command-line YAML processor

Optional dependencies:

* curl - Used to check kubernetes api livez probe when use serviceaccount
* git - Used to store backups as a git repository
* tar - Used to create backup archives with one of the compression libraries:
* xz - a lossless data compression file format based on the LZMA algorithm
* gzip - single-file/stream lossless data compression utility
* bzip2 - compression program that uses the Burrows–Wheeler algorithm
* `curl` - Used to check kubernetes api livez probe when use serviceaccount
* `git` - Used to store backups as a git repository
* `tar` - Used to create backup archives with one of the compression libraries:
* `xz` - a lossless data compression file format based on the LZMA algorithm
* `gzip` - single-file/stream lossless data compression utility
* `bzip2` - compression program that uses the Burrows–Wheeler algorithm

## Commands and flags

Expand All @@ -100,44 +92,45 @@ For example:
--destination-dir == DESTINATION_DIR
Flags:
-h, --help This help
-s, --silent Execute silently, suppress all stdout messages
-d, --destination-dir Path to dir for store dumps, default ./data
-f, --force-remove Delete resources in data directory before launch
--detailed Do not remove detailed state specific fields
--output-by-type Organize output into directories by resource type
--flat Organize all resources of the same type in the same file
-h, --help This help
-s, --silent Execute silently, suppress all stdout messages
-d, --destination-dir Path to dir for store dumps, default ./data
-f, --force-remove Delete resources in data directory before launch
--detailed Do not remove detailed state specific fields
--output-by-type Organize output into directories by resource type
--flat Organize all resources of the same type in the
same file
Kubernetes flags:
-n, --namespaces List of kubernetes namespaces
-r, --namespaced-resources List of namespaced resources
-k, --cluster-resources List of cluster resources
--kube-config Path to kubeconfig file
--kube-context The name of the kubeconfig context to use
--kube-cluster The name of the kubeconfig cluster to use
--kube-insecure-tls Skip check server's certificate for validity
-n, --namespaces List of kubernetes namespaces
-r, --namespaced-resources List of namespaced resources
-k, --cluster-resources List of cluster resources
--kube-config Path to kubeconfig file
--kube-context The name of the kubeconfig context to use
--kube-cluster The name of the kubeconfig cluster to use
--kube-insecure-tls Skip check server's certificate for validity
Git commit flags:
-c, --git-commit Commit changes
-p, --git-push Commit changes and push to origin
-b, --git-branch Branch name
--git-commit-user Commit author username
--git-commit-email Commit author email
--git-remote-name Remote repo name, defualt is origin
--git-remote-url Remote repo URL
-c, --git-commit Commit changes
-p, --git-push Commit changes and push to origin
-b, --git-branch Branch name
--git-commit-user Commit author username
--git-commit-email Commit author email
--git-remote-name Remote repo name, defualt is origin
--git-remote-url Remote repo URL
Archivate flags:
-a, --archivate Create archive of data dir
--archive-rotate-days Rotate archives older than N days
--archive-type Archive type xz, gz or bz2, default is tar
-a, --archivate Create archive of data dir
--archive-rotate-days Rotate archives older than N days
--archive-type Archive type xz, gz or bz2, default is tar
Example of use:
$cmd dump-namespaces -n default,dev -d /mnt/dump -spa --archive-type gz
```

## Environment variables

All environment variables are described in the [.env](./.env) file,
All environment variables are described in the [`.env`](./.env) file,
you can use them both for the container launch configuration and
directly from the [`.env`](./.env) file, it is read automatically at startup.

Expand All @@ -149,6 +142,13 @@ All resources automatically discovered from the API if not pass as argument.
* List of default namespaced resources
* List of default cluster wide resources

## Plans for further development

* Sending dumps to s3 bucket;
* Sending notifications by email and webhook;
* Git-crypt to encrypt secrets;
* Bash autocomplete.

<!--
Title: Kube-dump
Description: Backup a Kubernetes cluster as a yaml manifest.
Expand Down
15 changes: 10 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Examples

Below are examples of how you can run kube-dump to get started
Below are examples of how you can run kube-dump to get started

* [Run on a local machine](./local.md) (dependencies and a config for kubectl are required)
* [Run in container](./container.md) (docker, podman, etc. required and a config for kubectl)
* [Run in kubernetes as pod](./pod.md) (requires access to the kubernetes cluster and config for kubectl)
* [Run in kubernetes as a cron job using a service account](./cronjob.md) (requires access to the kubernetes cluster and the ability to create a role or cluster role)
* [Run on a local machine](./local.md)
(dependencies and a config for kubectl are required)
* [Run in container](./container.md)
(docker, podman, etc. required and a config for kubectl)
* [Run in kubernetes as pod](./pod.md)
(requires access to the kubernetes cluster and config for kubectl)
* [Run in kubernetes as a cron job using a service account](./cronjob.md)
(requires access to the kubernetes cluster and the ability to create a role
or cluster role)
2 changes: 1 addition & 1 deletion docs/cronjob.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can read about CronJobs in [doc](https://kubernetes.io/docs/concepts/workloa
## Create namespace

First, let's create a namespace kube-dump (if you want to use a different name,
you will need to edit it in all the necessary manifests)
you will need to edit it in all the necessary manifests)

```shell
kubectl create ns kube-dump
Expand Down
3 changes: 2 additions & 1 deletion docs/local.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Run on a local machine

An example of installing kube-dump and dependencies on a local system to work with kubernetes clusters with which you work through kubectl
An example of installing kube-dump and dependencies on a local system to work
with kubernetes clusters with which you work through kubectl

## Clone this repo

Expand Down

0 comments on commit 0d7b644

Please sign in to comment.