Skip to content

Commit

Permalink
fix values.yaml so we can easily use helm-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebot committed Nov 17, 2024
1 parent 9c05f27 commit 3d6d3f0
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 103 deletions.
2 changes: 1 addition & 1 deletion charts/libretranslate/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sources:
- https://github.com/LibreTranslate/LibreTranslate/
- https://github.com/LibreTranslate/helm-chart/
icon: https://libretranslate.com/static/favicon.ico
version: 0.4.1
version: 0.4.2
153 changes: 95 additions & 58 deletions charts/libretranslate/README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,95 @@
# LibreTranslate Helm Chart

This Helm chart deploys a LibreTranslate instance on a Kubernetes cluster using the Helm package manager.

## Prerequisites

- Kubernetes 1.12+
- Helm 3.0+

## Installing the Chart

To install the chart with the release name `libretranslate`:

```bash
helm install libretranslate ./chart --namespace libretranslate --create-namespace
```

This command deploys LibreTranslate on the Kubernetes cluster with the default configuration. The [values.yaml](values.yaml) file lists the parameters that can be configured during installation.

> **Tip**: List all releases using `helm list`
## Uninstalling the Chart

To uninstall/delete the `libretranslate` deployment:

```bash
helm delete libretranslate
```

This command removes all the Kubernetes components associated with the chart and deletes the release.

## Configuration

See [values.yaml](values.yaml) for the full list of parameters that can be configured. You can specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

```bash
helm install libretranslate ./chart --namespace libretranslate --create-namespace --set service.port=8080
```

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

```bash
helm install libretranslate ./chart --namespace libretranslate --create-namespace -f values.yaml
```

## Upgrade

Run the following command to upgrade your LibreTranslate installation. This command will use the Helm chart in the ./chart directory, apply the custom values from values.yaml, and deploy the upgrade to the `libretranslate` namespace:

```bash
helm upgrade --install libretranslate ./chart --namespace libretranslate -f values.yaml
```

> **Tip**: You can use the default [values.yaml](values.yaml)
# References
- [https://jmrobles.medium.com/libretranslate-your-own-translation-service-on-kubernetes-b46c3e1af630](https://jmrobles.medium.com/libretranslate-your-own-translation-service-on-kubernetes-b46c3e1af630)
- [https://github.com/LibreTranslate/LibreTranslate](https://github.com/LibreTranslate/LibreTranslate)
# libretranslate

![Version: 0.4.1](https://img.shields.io/badge/Version-0.4.1-informational?style=flat-square)

A Helm chart for Kubernetes to deploy LibreTranslate API

**Homepage:** <https://libretranslate.github.io/helm-chart/>

## Source Code

* <https://github.com/LibreTranslate/LibreTranslate/>
* <https://github.com/LibreTranslate/helm-chart/>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| adminUser.auth | string | `"YWRtaW46JGFwcjEkYlpydmYvUFYkSHBHSlhqZU1EN0ZON2kyYndsMVRNMQoK"` | copy the output from the htpasswd command here as a reference |
| adminUser.existingSecret | string | `""` | use an existing secret for admin user |
| adminUser.name | string | `"YWRtaW4K"` | copy the username in base64 as a reference |
| adminUser.password | string | `"bXlTZWNyZXRQYXNzd29yZAo="` | copy the password as base64 for the admin user here as a reference |
| adminUser.secretKeys.auth | string | `"auth"` | |
| adminUser.secretKeys.name | string | `"name"` | |
| adminUser.secretKeys.password | string | `"password"` | |
| annotations | object | `{}` | Extra annotations |
| appConfig.apiKeysDbPath | string | `"/app/db/api_keys.db"` | Use a specific path inside the container for the local database. Can be absolute or relative (Default: /app/db/api_keys.db) |
| appConfig.apiKeysDbPathMount | string | `"/app/db"` | Use a specific path inside the container for the local database. Must be the same as apiKeysDbPath (Default: /app/db) |
| appConfig.apiKeysRemote | string | `""` | Use this remote endpoint to query for valid API keys instead of using the local database (Default: Empty (use local db instead)) |
| appConfig.batchLimit | string | `"null"` | Set maximum number of texts to translate in a batch request (Default: No limit) |
| appConfig.charLimit | string | `"null"` | Set character limit (Default: No limit) |
| appConfig.frontendLanguageSource | string | `"auto"` | Set frontend default language - source (Default: auto) |
| appConfig.frontendLanguageTarget | string | `"locale"` | Set frontend default language - target (Default: locale (match site's locale)) |
| appConfig.frontendTimeout | string | `"500"` | Set frontend translation timeout (Default: 500) |
| appConfig.gaId | string | `""` | Enable Google Analytics on the API client page by providing an ID (Default: Empty (no tracking)) |
| appConfig.getApiKeyLink | string | `""` | Show a link in the UI where to direct users to get an API key (Default: Empty (no link shown on web ui)) |
| appConfig.host | string | `"0.0.0.0"` | Set host to bind the server to (Default: 127.0.0.1) |
| appConfig.loadOnly | string | `""` | Set available languages (Default: Empty (use all from argostranslate)) |
| appConfig.metricsAuthToken | string | `""` | Protect the /metrics endpoint by allowing only clients that have a valid Authorization Bearer token (Default: Empty (no auth required)) |
| appConfig.port | string | `"5000"` | Set port to bind the server to (Default: 5000) |
| appConfig.reqLimit | string | `"null"` | Set maximum number of requests per minute per client (outside of limits set by api keys) (Default: No limit) |
| appConfig.reqLimitStorage | string | `"memory://"` | Storage URI to use for request limit data storage. See Flask Limiter (Default: memory://) |
| appConfig.sharedStorage | string | `"memory://"` | Shared storage URI to use for multi-process data sharing (e.g. when using gunicorn) (Default: memory://) |
| appConfig.threads | string | `"4"` | Set number of threads (Default: 4) |
| appConfig.urlPrefix | string | `""` | Add prefix to URL: example.com:5000/url-prefix/ (Default: /) |
| appSettings.apiKeys | string | `"false"` | |
| appSettings.debug | string | `"false"` | Enable debug environment (Default: Disabled) |
| appSettings.disableFilesTranslation | string | `"false"` | Disable files translation (Default: File translation allowed) |
| appSettings.disableWebUi | string | `"false"` | Disable web ui (Default: Web Ui enabled) |
| appSettings.existingSecret | string | `""` | use an existing secret for api key origin and secret |
| appSettings.metrics | string | `"false"` | Enable the /metrics endpoint for exporting Prometheus usage metrics (Default: Disabled) |
| appSettings.requireApiKeyOrigin | string | `""` | Require use of an API key for programmatic access to the API, unless the request origin matches this domain (Default: No restrictions on domain origin) |
| appSettings.requireApiKeySecret | string | `""` | Require use of an API key for programmatic access to the API, unless the client also sends a secret match (Default: No secrets required) |
| appSettings.secretKeys.apiKeyorigin | string | `""` | |
| appSettings.secretKeys.apiKeysecret | string | `"secret"` | |
| appSettings.ssl | string | `"false"` | Enable SSL (Default: Disabled) |
| appSettings.suggestions | string | `"false"` | Allow user suggestions (Default: Disabled) |
| appSettings.updateModels | string | `"false"` | Update language models at startup (Default: Only on if no models found) |
| fullnameOverride | string | `""` | Full name of the deployment to override the default one |
| image.pullPolicy | string | `"Always"` | |
| image.repository | string | `"libretranslate/libretranslate"` | |
| image.tag | string | `"latest"` | |
| imagePullSecrets | list | `[]` | |
| ingress.annotations."nginx.ingress.kubernetes.io/proxy-body-size" | string | `"10m"` | |
| ingress.className | string | `""` | set this to the name of the ingress controller class to use like nginx |
| ingress.enabled | bool | `false` | |
| ingress.hosts[0].host | string | `"translate.example.com"` | |
| ingress.hosts[0].paths[0].path | string | `"/"` | |
| ingress.hosts[0].paths[0].pathType | string | `"Prefix"` | |
| initContainerSecurityContext.runAsGroup | int | `0` | |
| initContainerSecurityContext.runAsUser | int | `0` | |
| livenessProbe | object | `{}` | Liveness probe for kubernetes |
| nameOverride | string | `""` | Chart name override |
| persistence.db.accessMode | string | `"ReadWriteOnce"` | |
| persistence.db.size | string | `"1Gi"` | |
| persistence.db.storageClass | string | `""` | |
| persistence.enabled | bool | `false` | |
| persistence.models.accessMode | string | `"ReadWriteOnce"` | |
| persistence.models.size | string | `"10Gi"` | as of August 2023, the models are about 6.6GB in size for all languages |
| persistence.models.storageClass | string | `""` | |
| podAnnotations | object | `{}` | Extra annotations for pods |
| podSecurityContext.runAsGroup | int | `1032` | |
| podSecurityContext.runAsUser | int | `1032` | |
| readinessProbe | object | `{}` | Readiness probe for kubernetes |
| replicaCount | int | `1` | Number of replicas |
| resources.limits.cpu | int | `1` | |
| resources.limits.memory | string | `"2Gi"` | |
| resources.requests.cpu | string | `"500m"` | |
| resources.requests.memory | string | `"1Gi"` | |
| securityContext.fsGroup | int | `1032` | |
| service.port | int | `5000` | |
| service.type | string | `"ClusterIP"` | |
| tolerations | list | `[]` | Extra tolerations for pods |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
124 changes: 80 additions & 44 deletions charts/libretranslate/values.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# values.yaml

# Number of replicas
# -- Number of replicas
replicaCount: 1

# Extra annotations for pods
# -- Extra annotations for pods
podAnnotations: {}

# Extra annotations
# -- Extra annotations
annotations: {}

# Extra tolerations for pods
# -- Extra tolerations for pods
tolerations: []

# Chart name override
# -- Chart name override
nameOverride: ""

# Full name of the deployment to override the default one
# -- Full name of the deployment to override the default one
fullnameOverride: ""

# Image settings
Expand All @@ -38,7 +38,8 @@ service:
# Ingress settings
ingress:
enabled: false
className: "" # set this to the name of the ingress controller class to use like nginx
# -- set this to the name of the ingress controller class to use like nginx
className: ""
annotations:
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/proxy-body-size: 10m
Expand Down Expand Up @@ -84,7 +85,8 @@ persistence:
models:
storageClass: ""
accessMode: "ReadWriteOnce"
size: "10Gi" # as of August 2023, the models are about 6.6GB in size for all languages
# -- as of August 2023, the models are about 6.6GB in size for all languages
size: "10Gi"


# Resource limits
Expand All @@ -96,7 +98,7 @@ resources:
cpu: 500m
memory: 1Gi

# Readiness probe for kubernetes
# -- Readiness probe for kubernetes
readinessProbe: {}
# exec:
# command:
Expand All @@ -105,7 +107,7 @@ readinessProbe: {}
# initialDelaySeconds: 10
# periodSeconds: 5

# Liveness probe for kubernetes
# -- Liveness probe for kubernetes
livenessProbe: {}
# exec:
# command:
Expand All @@ -124,10 +126,14 @@ livenessProbe: {}
# This is used by the nginx ingress controller to enable basic auth for the whole site.
# It will create a secret with the name libretranslate-auth.
adminUser:
name: "YWRtaW4K" # copy the username in base64 as a reference
auth: "YWRtaW46JGFwcjEkYlpydmYvUFYkSHBHSlhqZU1EN0ZON2kyYndsMVRNMQoK" # copy the output from the htpasswd command here as a reference
password: "bXlTZWNyZXRQYXNzd29yZAo=" # copy the password as base64 for the admin user here as a reference
existingSecret: "" # use an existing secret for admin user
# -- copy the username in base64 as a reference
name: "YWRtaW4K"
# -- copy the output from the htpasswd command here as a reference
auth: "YWRtaW46JGFwcjEkYlpydmYvUFYkSHBHSlhqZU1EN0ZON2kyYndsMVRNMQoK"
# -- copy the password as base64 for the admin user here as a reference
password: "bXlTZWNyZXRQYXNzd29yZAo="
# -- use an existing secret for admin user
existingSecret: ""
# key in existing secret
secretKeys:
name: "name"
Expand All @@ -136,17 +142,28 @@ adminUser:

# Settings / Flags
appSettings:
debug: "false" # Enable debug environment (Default: Disabled)
ssl: "false" # Enable SSL (Default: Disabled)
apiKeys: "false" # Enable API keys database for per-client rate limits when --req-limit is reached (Default: Don't use API keys)
requireApiKeyOrigin: "" # Require use of an API key for programmatic access to the API, unless the request origin matches this domain (Default: No restrictions on domain origin)
requireApiKeySecret: "" # Require use of an API key for programmatic access to the API, unless the client also sends a secret match (Default: No secrets required)
suggestions: "false" # Allow user suggestions (Default: Disabled)
disableFilesTranslation: "false" # Disable files translation (Default: File translation allowed)
disableWebUi: "false" # Disable web ui (Default: Web Ui enabled)
updateModels: "false" # Update language models at startup (Default: Only on if no models found)
metrics: "false" # Enable the /metrics endpoint for exporting Prometheus usage metrics (Default: Disabled)
existingSecret: "" # use an existing secret for api key origin and secret
# -- Enable debug environment (Default: Disabled)
debug: "false"
# -- Enable SSL (Default: Disabled)
ssl: "false"
# -- Enable API keys database for per-client rate limits when --req-limit is reached (Default: Don't use API keys)
apiKeys: "false"
# -- Require use of an API key for programmatic access to the API, unless the request origin matches this domain (Default: No restrictions on domain origin)
requireApiKeyOrigin: ""
# -- Require use of an API key for programmatic access to the API, unless the client also sends a secret match (Default: No secrets required)
requireApiKeySecret: ""
# -- Allow user suggestions (Default: Disabled)
suggestions: "false"
# -- Disable files translation (Default: File translation allowed)
disableFilesTranslation: "false"
# -- Disable web ui (Default: Web Ui enabled)
disableWebUi: "false"
# -- Update language models at startup (Default: Only on if no models found)
updateModels: "false"
# -- Enable the /metrics endpoint for exporting Prometheus usage metrics (Default: Disabled)
metrics: "false"
# -- use an existing secret for api key origin and secret
existingSecret: ""
# keys in existing secret
secretKeys:
apiKeyorigin: ""
Expand All @@ -155,22 +172,41 @@ appSettings:

# Configuration Parameters
appConfig:
host: "0.0.0.0" # Set host to bind the server to (Default: 127.0.0.1)
port: "5000" # Set port to bind the server to (Default: 5000)
charLimit: "null" # Set character limit (Default: No limit)
reqLimit: "null" # Set maximum number of requests per minute per client (outside of limits set by api keys) (Default: No limit)
reqLimitStorage: "memory://" # Storage URI to use for request limit data storage. See Flask Limiter (Default: memory://)
batchLimit: "null" # Set maximum number of texts to translate in a batch request (Default: No limit)
gaId: "" # Enable Google Analytics on the API client page by providing an ID (Default: Empty (no tracking))
frontendLanguageSource: "auto" # Set frontend default language - source (Default: auto)
frontendLanguageTarget: "locale" # Set frontend default language - target (Default: locale (match site's locale))
frontendTimeout: "500" # Set frontend translation timeout (Default: 500)
apiKeysDbPath: "/app/db/api_keys.db" # Use a specific path inside the container for the local database. Can be absolute or relative (Default: /app/db/api_keys.db)
apiKeysDbPathMount: "/app/db" # Use a specific path inside the container for the local database. Must be the same as apiKeysDbPath (Default: /app/db)
apiKeysRemote: "" # Use this remote endpoint to query for valid API keys instead of using the local database (Default: Empty (use local db instead))
getApiKeyLink: "" # Show a link in the UI where to direct users to get an API key (Default: Empty (no link shown on web ui))
sharedStorage: "memory://" # Shared storage URI to use for multi-process data sharing (e.g. when using gunicorn) (Default: memory://)
loadOnly: "" # Set available languages (Default: Empty (use all from argostranslate))
threads: "4" # Set number of threads (Default: 4)
metricsAuthToken: "" # Protect the /metrics endpoint by allowing only clients that have a valid Authorization Bearer token (Default: Empty (no auth required))
urlPrefix: "" # Add prefix to URL: example.com:5000/url-prefix/ (Default: /)
# -- Set host to bind the server to (Default: 127.0.0.1)
host: "0.0.0.0"
# -- Set port to bind the server to (Default: 5000)
port: "5000"
# -- Set character limit (Default: No limit)
charLimit: "null"
# -- Set maximum number of requests per minute per client (outside of limits set by api keys) (Default: No limit)
reqLimit: "null"
# -- Storage URI to use for request limit data storage. See Flask Limiter (Default: memory://)
reqLimitStorage: "memory://"
# -- Set maximum number of texts to translate in a batch request (Default: No limit)
batchLimit: "null"
# -- Enable Google Analytics on the API client page by providing an ID (Default: Empty (no tracking))
gaId: ""
# -- Set frontend default language - source (Default: auto)
frontendLanguageSource: "auto"
# -- Set frontend default language - target (Default: locale (match site's locale))
frontendLanguageTarget: "locale"
# -- Set frontend translation timeout (Default: 500)
frontendTimeout: "500"
# -- Use a specific path inside the container for the local database. Can be absolute or relative (Default: /app/db/api_keys.db)
apiKeysDbPath: "/app/db/api_keys.db"
# -- Use a specific path inside the container for the local database. Must be the same as apiKeysDbPath (Default: /app/db)
apiKeysDbPathMount: "/app/db"
# -- Use this remote endpoint to query for valid API keys instead of using the local database (Default: Empty (use local db instead))
apiKeysRemote: ""
# -- Show a link in the UI where to direct users to get an API key (Default: Empty (no link shown on web ui))
getApiKeyLink: ""
# -- Shared storage URI to use for multi-process data sharing (e.g. when using gunicorn) (Default: memory://)
sharedStorage: "memory://"
# -- Set available languages (Default: Empty (use all from argostranslate))
loadOnly: ""
# -- Set number of threads (Default: 4)
threads: "4"
# -- Protect the /metrics endpoint by allowing only clients that have a valid Authorization Bearer token (Default: Empty (no auth required))
metricsAuthToken: ""
# -- Add prefix to URL: example.com:5000/url-prefix/ (Default: /)
urlPrefix: ""

0 comments on commit 3d6d3f0

Please sign in to comment.