Use new labels in documentation, and fix content
This commit is contained in:
97
README.md
97
README.md
@@ -73,34 +73,27 @@ katenary completion fish | source
|
|||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
```
|
```
|
||||||
Katenary aims to be a tool to convert docker-compose files to Helm Charts.
|
Katenary is a tool to convert compose files to Helm Charts.
|
||||||
It will create deployments, services, volumes, secrets, and ingress resources.
|
|
||||||
But it will also create initContainers based on depend_on, healthcheck, and other features.
|
|
||||||
It's not magical, sometimes you'll need to fix the generated charts.
|
|
||||||
The general way to use it is to call one of these commands:
|
|
||||||
|
|
||||||
katenary convert
|
Each [command] and subcommand has got an "help" and "--help" flag to show more information.
|
||||||
katenary convert -c docker-compose.yml
|
|
||||||
katenary convert -c docker-compose.yml -o ./charts
|
|
||||||
|
|
||||||
In case of, check the help of each command using:
|
|
||||||
katenary <command> --help
|
|
||||||
or
|
|
||||||
"katenary help <command>"
|
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
katenary [command]
|
katenary [command]
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
katenary convert -c docker-compose.yml -o ./charts
|
||||||
|
|
||||||
Available Commands:
|
Available Commands:
|
||||||
completion Generate the autocompletion script for the specified shell
|
completion Generates completion scripts
|
||||||
convert Convert docker-compose to helm chart
|
convert Converts a docker-compose file to a Helm Chart
|
||||||
help Help about any command
|
hash-composefiles Print the hash of the composefiles
|
||||||
show-labels Show labels of a resource
|
help Help about any command
|
||||||
upgrade Upgrade katenary to the latest version if available
|
help-labels Print the labels help for all or a specific label
|
||||||
version Display version
|
version Print the version number of Katenary
|
||||||
|
|
||||||
Flags:
|
Flags:
|
||||||
-h, --help help for katenary
|
-h, --help help 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.
|
||||||
```
|
```
|
||||||
@@ -118,9 +111,7 @@ What can be interpreted by Katenary:
|
|||||||
- if `ports` and/or `expose` section, katenary will create Services and bind the port to the corresponding container port
|
- if `ports` and/or `expose` section, katenary will create Services and bind the port to the corresponding container port
|
||||||
- `depends_on` will add init containers to wait for the depending on service (using the first port)
|
- `depends_on` will add init containers to wait for the depending on service (using the first port)
|
||||||
- `env_file` list will create a configMap object per environemnt file (⚠ to-do: the "to-service" label doesn't work with configMap for now)
|
- `env_file` list will create a configMap object per environemnt file (⚠ to-do: the "to-service" label doesn't work with configMap for now)
|
||||||
- some labels can help to bind values, for example:
|
- some labels can help to bind values, see examples below
|
||||||
- `katenary.io/ingress: 80` will expose the port 80 in an ingress
|
|
||||||
- `katenary.io/mapenv: |`: allow mapping environment to something else than the given value in the compose file
|
|
||||||
|
|
||||||
Exemple of a possible `docker-compose.yaml` file:
|
Exemple of a possible `docker-compose.yaml` file:
|
||||||
|
|
||||||
@@ -140,11 +131,13 @@ services:
|
|||||||
- database
|
- database
|
||||||
labels:
|
labels:
|
||||||
# expose the port 80 as an ingress
|
# expose the port 80 as an ingress
|
||||||
katenary.io/ingress: 80
|
katenary.v3/ingress: |-
|
||||||
|
hostname: myapp.example.com
|
||||||
|
port: 80
|
||||||
# make adaptations, DB_HOST environment is actually the service name
|
# make adaptations, DB_HOST environment is actually the service name
|
||||||
# to hit (note the yaml style, start with "|")
|
# to hit (note the yaml style, start with "|")
|
||||||
katenary.io/mapenv: |
|
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:
|
||||||
@@ -157,42 +150,36 @@ services:
|
|||||||
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.io/ports: 3306
|
katenary.v3/ports: |-
|
||||||
|
- 3306
|
||||||
# these variables are secrets
|
# these variables are secrets
|
||||||
katenary.io/secret-vars: MARIADB_ROOT_PASSWORD, MARIADB_PASSWORD
|
katenary.v3/secrets: |-
|
||||||
|
- MARIADB_ROOT_PASSWORD
|
||||||
|
- MARIADB_PASSWORD
|
||||||
```
|
```
|
||||||
|
|
||||||
# Labels
|
# Labels
|
||||||
|
|
||||||
These labels could be found by `katenary show-labels`, and can be placed as "labels" inside your docker-compose file:
|
These labels could be found by `katenary help-labels`, and can be placed as "labels" inside your docker-compose file:
|
||||||
|
|
||||||
```
|
```
|
||||||
# Labels
|
To get more information about a label, use `katenary help-label <name_without_prefix>
|
||||||
katenary.io/ignore : ignore the container, it will not yied any object in the helm chart (bool)
|
e.g. katenary help-label dependencies
|
||||||
katenary.io/secret-vars : secret variables to push on a secret file (coma separated)
|
|
||||||
katenary.io/secret-envfiles : set the given file names as a secret instead of configmap (coma separated)
|
katenary.v3/configmap-files: list of strings Add files to the configmap.
|
||||||
katenary.io/mapenv : map environment variable to a template string (yaml style, object)
|
katenary.v3/cronjob: object Create a cronjob from the service.
|
||||||
katenary.io/ports : set the ports to expose as a service (coma separated)
|
katenary.v3/dependencies: list of objects Add Helm dependencies to the service.
|
||||||
katenary.io/ingress : set the port to expose in an ingress (coma separated)
|
katenary.v3/description: string Description of the service
|
||||||
katenary.io/configmap-volumes : specifies that the volumes points on a configmap (coma separated)
|
katenary.v3/env-from: list of strings Add environment variables from antoher service.
|
||||||
katenary.io/same-pod : specifies that the pod should be deployed in the same pod than the
|
katenary.v3/health-check: object Health check to be added to the deployment.
|
||||||
given service name (string)
|
katenary.v3/ignore: bool Ignore the service
|
||||||
katenary.io/volume-from : specifies that the volumes to be mounted from the given service (yaml style)
|
katenary.v3/ingress: object Ingress rules to be added to the service.
|
||||||
katenary.io/empty-dirs : specifies that the given volume names should be "emptyDir" instead of
|
katenary.v3/main-app: bool Mark the service as the main app.
|
||||||
persistentVolumeClaim (coma separated)
|
katenary.v3/map-env: object Map env vars from the service to the deployment.
|
||||||
katenary.io/crontabs : specifies a cronjobs to create (yaml style, array) - this will create a
|
katenary.v3/ports: list of uint32 Ports to be added to the service.
|
||||||
cronjob, a service account, a role and a rolebinding to start the command with "kubectl"
|
katenary.v3/same-pod: string Move the same-pod deployment to the target deployment.
|
||||||
The form is the following:
|
katenary.v3/secrets: list of string Env vars to be set as secrets.
|
||||||
- command: the command to run
|
katenary.v3/values: list of string or map Environment variables to be added to the values.yaml
|
||||||
schedule: the schedule to run the command (e.g. "@daily" or "*/1 * * * *")
|
|
||||||
image: the image to use for the command (default to "bitnami/kubectl")
|
|
||||||
allPods: true if you want to run the command on all pods (default to false)
|
|
||||||
katenary.io/healthcheck : specifies that the container should be monitored by a healthcheck,
|
|
||||||
**it overrides the docker-compose healthcheck**.
|
|
||||||
You can use these form of label values:
|
|
||||||
-> http://[ignored][:port][/path] to specify an http healthcheck
|
|
||||||
-> tcp://[ignored]:port to specify a tcp healthcheck
|
|
||||||
-> other string is condidered as a "command" healthcheck
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# What a name...
|
# What a name...
|
||||||
|
Reference in New Issue
Block a user