This commit is contained in:
2024-04-22 15:36:49 +02:00
parent dc41826691
commit 12814f4732

122
README.md
View File

@@ -101,31 +101,31 @@ source <(katenary completion zsh)
# Usage # Usage
``` ```
Katenary is a tool to convert compose files to Helm Charts. Katenary is a tool to convert compose files to Helm Charts.
Each [command] and subcommand has got an "help" and "--help" flag to show more information. Each [command] and subcommand has got an "help" and "--help" flag to show more information.
Usage: Usage:
katenary [command] katenary [command]
Examples: Examples:
katenary convert -c docker-compose.yml -o ./charts katenary convert -c docker-compose.yml -o ./charts
Available Commands: Available Commands:
completion Generates completion scripts completion Generates completion scripts
convert Converts a docker-compose file to a Helm Chart convert Converts a docker-compose file to a Helm Chart
hash-composefiles Print the hash of the composefiles hash-composefiles Print the hash of the composefiles
help Help about any command help Help about any command
help-labels Print the labels help for all or a specific label help-labels Print the labels help for all or a specific label
version Print the version number of Katenary version Print the version number of Katenary
Flags: Flags:
-h, --help help for katenary -h, --help help for katenary
-v, --version version for katenary -v, --version version for katenary
Use "katenary [command] --help" for more information about a command. Use "katenary [command] --help" for more information about a command.
``` ```
Katenary will try to find a `docker-compose.yaml` or `docker-compose.yml` file inside the current directory. It will Katenary will try to find a `docker-compose.yaml` or `docker-compose.yml` file inside the current directory. It will
check *the existence of the `chart` directory to create a new Helm Chart inside a named subdirectory. Katenary will ask check *the existence of the `chart` directory to create a new Helm Chart inside a named subdirectory. Katenary will ask
@@ -150,47 +150,47 @@ to Helm Chart because there is (for now) no way to make it working (see below fo
Exemple of a possible `docker-compose.yaml` file: Exemple of a possible `docker-compose.yaml` file:
```yaml ```yaml
version: "3" services:
services: webapp:
webapp: image: php:7-apache
image: php:7-apache environment:
environment: # note that "database" is a "compose" service name
# note that "database" is a service name # so we need to adapt it with the map-env label
DB_HOST: database DB_HOST: database
expose: expose:
- 80 - 80
depends_on: depends_on:
# this will create a init container waiting for 3306 port # this will create a init container waiting for 3306 port
# because it's the "exposed" port # because it's the "exposed" port
- database - database
labels: labels:
# expose the port 80 as an ingress # expose the port 80 as an ingress
katenary.v3/ingress: |- katenary.v3/ingress: |-
hostname: myapp.example.com hostname: myapp.example.com
port: 80 port: 80
# make adaptations, DB_HOST environment is actually the service name katenary.v3/mapenv: |-
# to hit (note the yaml style, start with "|") # make adaptations, DB_HOST environment is actually the service name
katenary.v3/mapenv: |- DB_HOST: '{{ .Release.Name }}-database'
DB_HOST: '{{ .Release.Name }}-database'
database: database:
image: mariadb:10 image: mariadb:10
env_file: env_file:
# this will create a configMap # this will create a configMap
- my_env.env - my_env.env
environment: environment:
MARIADB_USER: foo MARIADB_USER: foo
MARIADB_ROOT_PASSWORD: foobar MARIADB_ROOT_PASSWORD: foobar
MARIADB_PASSWORD: bar MARIADB_PASSWORD: bar
labels: labels:
# no need to declare this port in docker-compose # no need to declare this port in docker-compose
# but katenary will need it # but katenary will need it
katenary.v3/ports: |- katenary.v3/ports: |-
- 3306 - 3306
# these variables are secrets # these variables are secrets
katenary.v3/secrets: |- katenary.v3/secrets: |-
- MARIADB_ROOT_PASSWORD - MARIADB_ROOT_PASSWORD
- MARIADB_PASSWORD - MARIADB_PASSWORD
``` ```
# Labels # Labels
@@ -225,5 +225,3 @@ A catenary is a curve formed by a wire, rope, or chain hanging freely from two p
line. For example, the anchor chain between a boat and the anchor. line. For example, the anchor chain between a boat and the anchor.
This "curved link" represents what we try to do, the project is a "streched link from docker-compose to helm chart". This "curved link" represents what we try to do, the project is a "streched link from docker-compose to helm chart".