Skip to content

Commit

Permalink
doc(add): Add more documentation about katenary file
Browse files Browse the repository at this point in the history
  • Loading branch information
metal3d committed Nov 22, 2024
1 parent 91fc0fd commit e925f58
Show file tree
Hide file tree
Showing 14 changed files with 717 additions and 394 deletions.
14 changes: 7 additions & 7 deletions doc/docs/coding.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Since version v3, Katenary uses, in addition to `go-compose`, the `k8s` library
to work before transformation. Katenary adds Helm syntax entries to add loops, transformations, and conditions.

We really try to follow best practices and code principles. But, Katenary needs a lot of workarounds and string
manipulation during the process. There are, also, some drawbacks using standard k8s packages that makes a lot of type
manipulation during the process. There are, also, some drawbacks using standard k8s packages that make a lot of type
checks when generating the objects. We need to finalize the values after object generation.

**This makes the coding a bit harder than simply converting from YAML to YAML.**
Expand Down Expand Up @@ -59,9 +59,9 @@ its associated service are still created. They are deleted last, once the merge

## Conversion in "`generator`" package

The `generator` package is where object struct are defined, and where the `Generate()` function is written.
The `generator` package is where object struct are defined, and where you can find the `Generate()` function.

The generation is made by using a `HelmChart` object:
The generation fills `HelmChart` object using a loop:

```golang
for _, service := range project.Services {
Expand All @@ -75,7 +75,7 @@ for _, service := range project.Services {
```

**A lot** of string manipulations are made by each `Yaml()` methods. This is where you find the complex and impacting
operations. The `Yaml` methods **don't return a valid YAML content**. This is a Helm Chart Yaml content with template
operations. The `Yaml` methods **don't return a valid YAML content**. This is a Helm Chart YAML content with template
conditions, values and calls to helper templates.

> The `Yaml()` methods, in each object, need contribution, help, fixes, enhancements... They work, but there is a lot of
Expand All @@ -92,11 +92,11 @@ For each source container linked to the destination:
- we then copy the service port to the destination service
- we finally remove the source service and deployment

> The configmap, secrets, variables... are kept.
> The `Configmap`, secrets, variables... are kept.
It finaly computes the `helper` file.
It finally computes the `helper` file.

## Convertion command
## Conversion command

The `generator` works the same as described above. But the "convert" command makes some final steps:

Expand Down
6 changes: 3 additions & 3 deletions doc/docs/dependencies.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Why those dependencies?

Katenary uses `compose-go` and several kubernetes official packages.
Katenary uses `compose-go` and several Kubernetes official packages.

- `github.com/compose-spec/compose-go`: to parse compose files. It ensures :
- that the project respects the "compose" specification
- that Katenary uses the "compose" struct exactly the same way `podman compose` or `docker copose` does
- `github.com/spf13/cobra`: to parse command line arguments, subcommands and flags. It also generates completion for
- that Katenary uses the "compose" struct exactly the same way `podman compose` or `docker copose` does
- `github.com/spf13/cobra`: to parse command line arguments, sub-commands and flags. It also generates completion for
bash, zsh, fish and PowerShell.
- `github.com/thediveo/netdb`: to get the standard names of a service from its port number
- `gopkg.in/yaml.v3`:
Expand Down
11 changes: 6 additions & 5 deletions doc/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Kompose is able to generate Helm charts, but [it could be not the case in future
task, and we can confirm. Katenary takes a lot of time to be developed and maintained. This issue mentions Katenary as
an alternative to Helm chart generation :smile:

The project is focused on Kubernetes manifests and proposes to use "kusomize" to adapt the manifests. Helm seems to be
The project is focused on Kubernetes manifests and proposes to use "Kustomize" to adapt the manifests. Helm seems to be
not the priority.

Anyway, before this decision, the Helm chart generation was not what we expected. We wanted to have a more complete
Expand All @@ -41,7 +41,7 @@ your `docker-compose` files to Kubernetes manifests, but if you want to use Helm

## Why not using "one label" for all the configuration?

That was a dicsussion I had with my colleagues. The idea was to use a single label to store all the configuration.
That was a discussion I had with my colleagues. The idea was to use a single label to store all the configuration.
But, it's not a good idea.

Sometimes, you will have a long list of things to configure, like ports, ingress, dependencies, etc. It's better to have
Expand Down Expand Up @@ -78,21 +78,22 @@ There is no reason to use Rust for this project.
Yes, it's a possibility. But, it's not a priority. We have a lot of things to do before. We need to stabilize the
project, to have a good documentation, to have a good test coverage, and to have a good community.

But, in a not so far future, we could have a GUI. The choice of [Fyne.io](https://fyne.io) is already made and we tested some concepts.
But, in a not so far future, we could have a GUI. The choice of [Fyne.io](https://fyne.io) is already made, and we
tested some concepts.

## I'm rich (or not), I want to help you. How can I do?

You can help us in many ways.

- The first things we really need, more than money, more than anything else, is to have feedback. If you use Katenary,
if you have some issues, if you have some ideas, please open an issue on the [GitHub repository](https://github.com/metal3d/katenary).
- The second things is to help us to fix issues. If you're a Go developper, or if you want to fix the documentation,
- The second thing is to help us to fix issues. If you're a Go developer, or if you want to fix the documentation,
your help is greatly appreciated.
- And then, of course, we need money, or sponsors.

### If you're a company

We will be happy to communicate your help by putting your logo on the website and in the documentaiton. You can sponsor
We will be happy to communicate your help by putting your logo on the website and in the documentation. You can sponsor
us by giving us some money, or by giving us some time of your developers, or leaving us some time to work on the project.

### If you're an individual
Expand Down
36 changes: 18 additions & 18 deletions doc/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Tired of manual conversions? Katenary harnesses the labels from your "compose" file to craft complete Helm Charts
effortlessly, saving you time and energy.

🛠️ Simple autmated CLI: Katenary handles the grunt work, generating everything needed for seamless service binding
🛠️ Simple automated CLI: Katenary handles the grunt work, generating everything needed for seamless service binding
and Helm Chart creation.

💡 Effortless Efficiency: You only need to add labels when it's necessary to precise things. Then call `katenary convert`
Expand All @@ -21,18 +21,18 @@ and let the magic happen.

# What is it?

Katenary is a tool made to help you to transform "compose" files (`compose.yaml`, `docker-compose.yml`, `podman-compose.yml`...) to
complete and production ready [Helm Chart](https://helm.sh).
Katenary is a tool made to help you to transform "compose" files (`compose.yaml`, `docker-compose.yml`,
`podman-compose.yml`...) to complete and production ready [Helm Chart](https://helm.sh).

You'll be able to deploy your project in [:material-kubernetes: Kubernetes](https://kubernetes.io) in a few seconds
(of course, more if you need to tweak with labels).

It uses your current file and optionnaly labels to configure the result.
It uses your current file and optionally labels to configure the result.

It's an opensource project, under MIT licence, originally partially developped at [Smile](https://www.smile.eu).
It's an open source project, under MIT license, originally partially developed at [Smile](https://www.smile.eu).

Today, it's partially developped in collaboration with [Klee Group](https://www.kleegroup.com). Note that Katenary is
and **will stay an opensource and free (as freedom) project**. We are convinced that the best way to make it better is to
Today, it's partially developed in collaboration with [Klee Group](https://www.kleegroup.com). Note that Katenary is
and **will stay an open source and free (as freedom) project**. We are convinced that the best way to make it better is to
share it with the community.

<div id="klee">
Expand All @@ -46,9 +46,9 @@ code is hosted on the [:fontawesome-brands-github: Katenary GitHub Repository](h

## Install Katenary

Katenary is developped using the :fontawesome-brands-golang:{ .gopher } [Go](https://go.dev) language.
Katenary is developed using the :fontawesome-brands-golang:{ .gopher } [Go](https://go.dev) language.
The binary is statically linked, so you can simply download it from the [release
page](https://github.com/metal3d/katenary/releases) of the project in GutHub.
page](https://github.com/metal3d/katenary/releases) of the project in GitHub.

You need to select the right binary for your operating system and architecture, and copy the binary in a directory
that is in your `PATH`.
Expand All @@ -61,7 +61,7 @@ sh <(curl -sSL https://raw.githubusercontent.com/metal3d/katenary/master/install
```

!!! Info "Upgrading is integrated to the `katenary` command"
Katenary propose a `upgrade` subcommand to update the current binary to the latest stable release.
Katenary propose a `upgrade` sub-command to update the current binary to the latest stable release.

Of course, you need to install Katenary once :smile:

Expand Down Expand Up @@ -122,18 +122,18 @@ Anyway, it's too late to change the name now :smile:
## Special thanks to

I really want to thank all the contributors, testers, and of course, the authors of the packages and tools that are used
in this project. There is too many to list here. Katenary can works because of all these people. Open source is a great
in this project. There is too many to list here. Katenary can work because of all these people. Open source is a great
thing! :heart:

!!! Edit "Special thanks"

**Katenary is built with:** <br />

<a href="https://go.dev" target="_blank">:fontawesome-brands-golang:{ .go-logo }</a>
<a href="https://go.dev" target="_blank">:fontawesome-brands-golang:{ .go-logo }</a>

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. Because Docker, Podman,
Kubernetes, and Helm are written in Go, Katenary is also written in Go and borrows packages from these projects to
make it as efficient as possible.
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Because Docker, Podman, Kubernetes, and Helm are written in Go, Katenary is also written in Go and borrows packages
from these projects to make it as efficient as possible.

Thanks to Kubernetes to provide [Kind](https://kind.sigs.k8s.io) that is used to test Katenary locally.

Expand All @@ -142,17 +142,17 @@ thing! :heart:
Katenary can progress because of all these people. All contributions, as comments, issues, pull requests and
feedbacks are welcome.

**Everything was also possible because of:** <br />
**Everything was also possible because of:** <br />

<ul>
<li><a href="https://helm.sh" target="_blank"><img src="https://helm.sh/img/helm.svg" style="height: 1rem"/>
Helm</a> that is the main toppic of Katenary, Kubernetes is easier to use with it.</li>
Helm</a> that is the main toppic of Katenary, Kubernetes is easier to use with it.</li>
<li><a href="https://cobra.dev/"><img src="https://cobra.dev/home/logo.png" style="height: 1rem"/> Cobra</a> that
makes command, subcommand and completion possible for Katenary with ease.</li>
<li>Podman, Docker, Kubernetes that are the main tools that Katenary is made for.</li>
</ul>

**Documentation is built with:** <br />
**Documentation is built with:** <br />

<a href="https://www.mkdocs.org/" target="_blank">MkDocs</a> using <a
href="https://squidfunk.github.io/mkdocs-material/" target="_blank">Material for MkDocs</a> theme template.
Expand Down
Loading

0 comments on commit e925f58

Please sign in to comment.