Skip to content

Commit aa05cb2

Browse files
committed
docs: restructure the README and docs folder
1 parent 3663360 commit aa05cb2

File tree

10 files changed

+234
-191
lines changed

10 files changed

+234
-191
lines changed

README.md

Lines changed: 38 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,68 @@
11
# vab
22

3+
<center>
4+
5+
[![Build Status][github-actions-svg]][github-actions]
6+
[![Go Report Card][go-report-card]][go-report-card-link]
7+
[![GoDoc][godoc-svg]][godoc-link]
8+
9+
</center>
10+
311
`vab` is a cli for managing the installation of day 2 operation tools on multiple kubernetes clusters for easier
412
management and updates.
513

614
`vab` is the acronym for Vehicle Assembly Building that is designed to assemble large pre-manufactured
715
space vehicle components.
816

9-
## Building
17+
## To Start Using `vab`
18+
19+
Read the documentation [here](./docs/10_overview.md).
20+
21+
## To Start Developing `vab`
1022

11-
`vab` provides various make command to handle various tasks that you may need during development, but you need at
12-
least these dependencies installed on your machine:
23+
To start developing the CLI you must have this requirements:
1324

25+
- golang 1.22
1426
- make
15-
- bash
16-
- docker with buildkit build engine available to use
17-
- golang, for the exact version see the [.go-version](/.go-version) file in the repository
1827

19-
Once you have all the correct dependencies installed and the code pulled you can build the project with:
28+
Once you have pulled the code locally, you can build the code with make:
2029

21-
```bash
30+
```sh
2231
make build
2332
```
2433

25-
This command will build the cli for your actual OS and architecture and will put the binary inside the folder
26-
`bin/<os>/<arch>/`.
34+
`make` will download all the dependencies needed and will build the binary for your current system that you can find
35+
in the `bin` folder.
2736

28-
Or run the tests with:
37+
To build the docker image locally run:
2938

30-
```bash
31-
make test
39+
```sh
40+
make docker-build
3241
```
3342

34-
If you don’t plan to build a docker image but only to contribute to the code, we provide a devcontainer configuration
35-
that will setup the correct dependencies and predownload the tools used for linting. Also if you use VSCode it will
36-
setup three extensions that we recommend.
43+
## Testing `vab`
3744

38-
### Linting
45+
To run the tests use the command:
3946

40-
For linting your files make provide the following command:
41-
42-
```bash
43-
make lint
47+
```sh
48+
make test
4449
```
4550

46-
This command will run `go mod tidy` for cleaning up the `go.mod` and `go.sum` files.
47-
Additionally the command will download and use the [`golangci-lint`][golangci-lint] cli for running various linters
48-
on the code, the configuration used can be seen [here](.golangci.yml).
49-
50-
### Building Docker Image
51+
Or add the `DEBUG_TEST` flag to run the test with debug mode enabled:
5152

52-
If you need to use a docker image locally you can build it with:
53-
54-
```bash
55-
make docker-build
53+
```sh
54+
make test DEBUG_TEST=1
5655
```
5756

58-
The command will first build the appropriate binary and then build the correct docker image for
59-
your platform based on Linux Alpine.
57+
Before sending a PR be sure that all the linter pass with success:
6058

61-
### Building Multiarch Docker Image
62-
63-
If you need to try and build a multiarch docker image locally, you have to run these commands:
64-
65-
```bash
66-
make docker-setup-multiarch
67-
make docker-build-multiarch
59+
```sh
60+
make lint
6861
```
6962

70-
For building this image you need to have installed `docker` and the `buildx` extension for emulating multiple
71-
architecture on your pc. This command for now is created for using it in the ci.
72-
73-
[golangci-lint]: https://golangci-lint.run (Fast linters Runner for Go)
63+
[github-actions]: https://github.com/mia-platform/vab/actions
64+
[github-actions-svg]: https://github.com/mia-platform/vab/workflows/Continuous%20Integration%20Pipeline/badge.svg
65+
[godoc-svg]: https://godoc.org/github.com/mia-platform/vab?status.svg
66+
[godoc-link]: https://godoc.org/github.com/mia-platform/vab
67+
[go-report-card]: https://goreportcard.com/badge/github.com/mia-platform/vab
68+
[go-report-card-link]: https://goreportcard.com/report/github.com/mia-platform/vab

docs/10_overview.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# vab CLI
2+
3+
`vab` is a Command Line Interface that simplify the management of the Magellano kubernetes distribution on one or
4+
more remote clusters.
5+
6+
In future it will also allow to download custom modules and addons that follow the design documentations.
7+
8+
In essence vab can be viewed as an utility for downloading and setting up [kustomization] files with a structure
9+
that allow sharing adding and patching resources that will be applied on different Kubernetes clusters.
10+
The structure that is created and mantained by the tools can alse be used with different tools that support `kustomize`
11+
files like [Argo CD].
12+
13+
Applying the configuration files with `vab` will bring additional capabilities than using `kustomize` directly like
14+
finer resource ordering, applied resoruce tracking for pruning resources not available in subsequent apply,
15+
a little bit of validation for missing resource types in the target cluster and chaining deployments against
16+
multiple cluster grouped together with a single command.
17+
18+
## Functionalities
19+
20+
The `vab` CLI functionalities can be summarized within its main subcommands:
21+
22+
- `apply`: apply all the manifests to one or more targeted cluster specified in the configuration file
23+
- `build`: print all the manifests that the `apply` command would eventually apply to the cluster(s)
24+
- `create`: create and empty configuration file and starting files structures in the target folder
25+
- `sync`: donwload the modules and addons of the distribution locally and update the file structure if needed
26+
- `validate`: validate the configuration file to check its validity or attention points
27+
28+
## Guides
29+
30+
Below, you can find additional documentaion for `vab`:
31+
32+
- [Setup](./20_setup.md)
33+
- [Configuration Grammar](./30_grammar.md)
34+
- Design Documentation
35+
- [Configuration](./design/10_configuration.md)
36+
- [Folder Structures](./design/20_folder-structure.md)
37+
- [Modules](./design/30_modules.md)
38+
- [Addons](./design/40_addons.md)
39+
- [Download Packages](./design/50_download-packages.md)
40+
41+
[kustomization]: https://kustomize.io "Kubernetes native configuration management"
42+
[Argo CD]: https://argo-cd.readthedocs.io/en/stable/ "Declarative GitOps CD for Kubernetes"

docs/20_setup.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Setup
2+
3+
## Installation
4+
5+
`vab` can be installed in different ways, you can choose the one that better fits your needs and the operating system
6+
you are using:
7+
8+
- [Linux and MacOs](#linux-and-macos)
9+
- [Homebrew](#homebrew)
10+
- [Go](#go)
11+
- [Binary Download](#binary-download)
12+
- [Docker](#docker)
13+
- [Windows (with WSL)](#windows)
14+
- [Shell Autocompletion](#shell-autocompletion)
15+
16+
### Linux and MacOs
17+
18+
#### Homebrew
19+
20+
If you have [Homebrew] installed on your system `vab` is only a command away:
21+
22+
```sh
23+
brew install mia-platform/tap/vab
24+
```
25+
26+
#### Go
27+
28+
If you have [Golang] installed with a version >= 1.13 in your system and you have the `$GOPATH`env set, you can
29+
install `vab` like this:
30+
31+
```sh
32+
go install github.com/mia-platform/vab/cmd/[email protected]
33+
```
34+
35+
Or like this if the `install` command is not available
36+
37+
```sh
38+
go get -u github.com/mia-platform/vab/cmd/[email protected]
39+
```
40+
41+
#### Binary Download
42+
43+
You can install `vab` with the use of `curl` or `wget` and downloading the latest packages available on GitHub
44+
choosing the correct platform and operating system:
45+
46+
```sh
47+
curl -fsSL https://github.com/mia-platform/vab/releases/download/v0.9.0/vab-linux-amd64 -o /tmp/vab
48+
```
49+
50+
```sh
51+
wget -q https://github.com/mia-platform/vab/releases/download/v0.9.0/vab-linux-amd64 -O /tmp/vab
52+
```
53+
54+
After you have downloaded the file you can validate it against the checksum you can find at this [url] running the
55+
command:
56+
57+
```sh
58+
sha256sum /tmp/vab
59+
```
60+
61+
After you have validated that the downloaded file is correct, move the binary in your `/usr/local/bin` folder
62+
63+
```sh
64+
sudo install -g root -o root /tmp/vab /usr/local/bin
65+
```
66+
67+
#### Docker
68+
69+
If you want to run the cli in its environment or you want to test the cli you can use the Docker image:
70+
71+
```sh
72+
docker run ghcr.io/mia-platform/vab:0.9.0
73+
```
74+
75+
### Windows
76+
77+
`vab` is not directly compatible with Windows, even if you have Go installed compilation on this OS
78+
is not possible due to current technical restrictions.
79+
80+
However, it is still possible to use `vab` with Windows Subsystem for Linux (WSL), as explained here below.
81+
82+
#### Installation of WSL
83+
84+
If you don't have WSL on your system, follow the [official guide] to get it.
85+
86+
Once WSL is installed, to open a Linux bash terminal, press Start+R, enter `bash` in the text box and press OK.
87+
88+
#### Install `vab`
89+
90+
You can now install vab with any of the methods explained above for Linux,
91+
we suggest the [binary installation](#binary-download) since it's the most straightforward.
92+
93+
## Shell Autocompletion
94+
95+
If you have choosen to use an installation method different from the brew one, you will have to setup the
96+
commands autocompletion for your shell following one of these guides:
97+
98+
- [`bash`](#bash)
99+
- [`zsh`](#zsh)
100+
- [`fish`](#fish)
101+
102+
When you update the command remember to relaunch the command for your shell to update the completion definition
103+
and get the latest command and/or flags that has been added.
104+
105+
### `bash`
106+
107+
The `bash` autocompletion needs the [`bash-completion`] package installed on your system.
108+
109+
**Warning:** for working correctly you need the `bash-completion` V2 that is compatible only with Bash 4.1+,
110+
please be sure to have the correct versions installed on your system before running the command.
111+
112+
```sh
113+
vab completion bash >/usr/local/etc/bash_completion.d/vab
114+
```
115+
116+
After done this you must restart your shell environment or launch `exec bash` for reloading the configurations
117+
and enable the autocompletion.
118+
119+
### `zsh`
120+
121+
For setting up the `zsh` completion, you must enable it. You can use the following command:
122+
123+
```sh
124+
echo "autoload -U compinit; compinit" >> ~/.zshrc
125+
```
126+
127+
Or use something like [`oh-my-zsh`] that will enable it by default. Once you have done it you can launch the
128+
following command to create the file needed by `zsh`:
129+
130+
```sh
131+
vab completion zsh > /usr/local/share/zsh/site-functions/_vab
132+
```
133+
134+
After done this you must restart your shell environment or launch `exec zsh` for reloading the configurations and
135+
enable the autocompletion.
136+
137+
### `fish`
138+
139+
To enable the autocompletion in `fish` you have to run this command:
140+
141+
```sh
142+
vab completion fish > ~/.config/fish/completions/vab.fish
143+
```
144+
145+
After done this you must restart your shell environment or launch `exec fish` for reloading the configurations and
146+
enable the autocompletion.
147+
148+
[Homebrew]: https://brew.sh "The Missing Package Manager for macOS (or Linux)"
149+
[Golang]: https://go.dev "Build simple, secure, scalable systems with Go"
150+
[url]: https://github.com/mia-platform/vab/releases/download/v0.12.2/checksums.txt "vab checksums"
151+
[`bash-completion`]: https://github.com/scop/bash-completion "Programmable completion functions for bash"
152+
[`oh-my-zsh`]: https://ohmyz.sh "Oh My Zsh is a delightful, open source, community-driven
153+
framework for managing your Zsh configuration"
154+
[official guide]: https://learn.microsoft.com/en-us/windows/wsl/install "How to install Linux on Windows with WSL"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)