-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1032 from kapicorp/improve-docs-cc
Adds cookiecutter bootstap and improve documentation
- Loading branch information
Showing
5 changed files
with
129 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
# :kapitan-logo: **Kapitan Overview** | ||
|
||
## Setup your repository | ||
## Setup your installation | ||
|
||
!!! note | ||
We are currently working on improving the experience to give you an even quicker experience with Kapitan | ||
Using our reference repositories you can easily get started with **Kapitan** | ||
|
||
### Quickstart | ||
### Examples repository | ||
|
||
[kapicorp/kapitan-reference](https://github.com/kapicorp/kapitan-reference) repository is meant to be a way to bootstrap your **Kapitan** setup to get you up and running. | ||
|
||
It is meant to help you make use of best practices and libraries that can make Kapitan the ultimate tool for all your configuration needs. | ||
[kapicorp/kapitan-reference](https://github.com/kapicorp/kapitan-reference) repository is meant show you many working examples of things you can do with Kapitan. | ||
You can use this to get familiar with **Kapitan** | ||
|
||
``` | ||
$ git clone [email protected]:kapicorp/kapitan-reference.git kapitan-templates | ||
|
@@ -30,41 +28,118 @@ Compiled pritunl (2.03s) | |
Compiled sock-shop (4.36s) | ||
``` | ||
|
||
### From Scratch (Advanced) | ||
|
||
!!! warning | ||
|
||
the `kapitan init` command leaves you with a bare configuration. Setting up Kapitan might require time. | ||
|
||
Please use the [**Quickstart**](#quickstart) setup if you want to get started quicker. | ||
|
||
If you want to start off with a clean **kapitan** project, you can run `kapitan init --directory <directory>` to populate a new directory with the recommended kapitan folder structure. | ||
|
||
The bare minimum structure that makes use of kapitan features may look as follows: | ||
|
||
```text | ||
. | ||
├── components | ||
│ ├── mycomponent.jsonnet | ||
├── templates | ||
├── ├── README.md | ||
├── inventory | ||
│ ├── classes | ||
│ │ ├── common.yml | ||
│ └── targets | ||
│ ├── dev.yml | ||
│ ├── staging.yml | ||
│ └── prod.yml | ||
├── refs | ||
│ ├── targets | ||
│ │ ├── prod | ||
│ │ │ └── password | ||
└───├── common | ||
└── example-com-tls.key | ||
### Minimal repository | ||
|
||
> Using [cruft](https://cruft.github.io/cruft/) based cookiecutter | ||
```shell | ||
pip3 install cruft | ||
``` | ||
|
||
```shell | ||
cruft create http://github.com/kapicorp/kapitan-reference --checkout cookiecutter --no-input | ||
Dependency https://github.com/kapicorp/generators.git: saved to system/lib | ||
Dependency https://github.com/kapicorp/generators.git: saved to system/generators/kubernetes | ||
Dependency https://github.com/kapicorp/generators.git: saved to system/generators/terraform | ||
Rendered inventory (1.74s) | ||
Compiled echo-server (0.14s) | ||
``` | ||
|
||
* `components`: template files for kadet, jsonnet and helm | ||
* `templates`: stores Jinja2 templates for scripts and documentation | ||
* `inventory/targets`: target files | ||
* `inventory/classes`: inventory classes to be inherited by targets | ||
* `refs`: references files | ||
## running **Kapitan** | ||
|
||
!!! success "recommended" | ||
### `kapitan` wrapper script | ||
If you use the provided repository, we already package a `kapitan` shell script that wraps the docker command to run **Kapitan** | ||
|
||
```shell | ||
$ ./kapitan compile | ||
Compiled postgres-proxy (1.51s) | ||
Compiled tesoro (1.70s) | ||
Compiled echo-server (1.64s) | ||
Compiled mysql (1.67s) | ||
Compiled gke-pvm-killer (1.17s) | ||
Compiled prod-sockshop (4.74s) | ||
Compiled dev-sockshop (4.74s) | ||
Compiled tutorial (1.68s) | ||
Compiled global (0.76s) | ||
Compiled examples (2.60s) | ||
Compiled pritunl (2.03s) | ||
Compiled sock-shop (4.36s) | ||
``` | ||
|
||
## Other installation methods | ||
|
||
### Docker | ||
[![Releases](https://img.shields.io/github/release/kapicorp/kapitan.svg)](https://github.com/kapicorp/kapitan/releases) | ||
|
||
!!! success "recommended" | ||
### Docker | ||
![Docker Pulls](https://img.shields.io/docker/pulls/kapicorp/kapitan) | ||
[![Docker Image Size](https://img.shields.io/docker/image-size/kapicorp/kapitan/latest.svg)](https://hub.docker.com/r/kapicorp/kapitan) | ||
[![Docker](https://github.com/kapicorp/kapitan/workflows/Docker%20Build%20and%20Push/badge.svg)](https://github.com/kapicorp/kapitan/actions?query=workflow%3A%22Docker+Build+and+Push%22) | ||
|
||
|
||
=== "Linux" | ||
|
||
```shell | ||
alias kapitan="docker run -t --rm -u $(id -u) -v $(pwd):/src:delegated kapicorp/kapitan" | ||
kapitan -h | ||
``` | ||
|
||
=== "Mac" | ||
|
||
```shell | ||
alias kapitan="docker run -t --rm -v $(pwd):/src:delegated kapicorp/kapitan" | ||
kapitan -h | ||
``` | ||
|
||
### Pip | ||
|
||
#### Install Python | ||
|
||
![Python version](https://img.shields.io/pypi/pyversions/kapitan) | ||
![Unit Tests](https://github.com/kapicorp/kapitan/actions/workflows/test.yml/badge.svg) | ||
=== "Linux" | ||
|
||
```shell | ||
sudo apt-get update && sudo apt-get install -y python3.8-dev python3-pip python3-yaml | ||
``` | ||
|
||
=== "Mac" | ||
|
||
```shell | ||
brew install python3 libyaml libmagic | ||
``` | ||
|
||
#### Install Kapitan using pip | ||
|
||
![downloads](https://img.shields.io/pypi/dm/kapitan) | ||
|
||
##### User | ||
|
||
=== "Linux" | ||
|
||
!!! note "" | ||
`kapitan` will be installed in `$HOME/.local/lib/python3.7/bin` | ||
|
||
```shell | ||
pip3 install --user --upgrade kapitan | ||
``` | ||
|
||
=== "Mac" | ||
|
||
!!! note "" | ||
`kapitan` will be installed in `$HOME/Library/Python/3.7/bin` | ||
|
||
```shell | ||
pip3 install --user --upgrade kapitan | ||
``` | ||
|
||
|
||
##### System-wide | ||
|
||
!!! attention "not recommended" | ||
|
||
```shell | ||
sudo pip3 install --upgrade kapitan | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters