airbyte
by Airbyte
Helm chart to deploy airbyte
About this chart
Airbyte Helm Chart
This README provides guidance on how to make changes and contributions to the Airbyte Helm chart.
Overview
The Airbyte Helm chart uses a configuration generator system to manage environment variables and configuration across different components. This system helps maintain consistency and reduces duplication in the Helm templates.
Key Components
config.yaml: The primary input file that defines environment variables, their corresponding Helm values, and default values.- Generated Templates: Files in
templates/config/_*.tplthat are automatically generated fromconfig.yaml. viaTool: An in-house tool that processesconfig.yamland generates the template files.
Configuration System
How It Works
- The
config.yamlfile defines configuration "concerns" (ConfigSets) as top-level stanzas. - Each ConfigSet generates a corresponding template file in
templates/config/. - These templates are included in the Helm chart's
env-configmap.yamlandsecret.yamlfiles. - When the chart is deployed, these configurations are made available to the Airbyte components.
Making Changes to the Helm Chart
Adding or Modifying Environment Variables
To add or modify an environment variable:
- Identify the appropriate section in
config.yamlfor your variable. - Add or modify the variable definition with the required fields.
- Run the generator to update the templates.
- Test your changes by deploying the chart locally.
- Add a new empty entry to the
charts/v2/airbyte/values.yamlfile.
Example of adding a variable to an existing section:
common:
keyBasePath: global
config:
# Existing variables...
# New variable
- env: NEW_ENVIRONMENT_VARIABLE
key: newFeature.enabled
defaultValue: false
Adding a New Configuration Section
To add a new configuration section:
- Add a new top-level stanza to
config.yaml. - Define the configuration variables for this section.
- Run the generator to create the new template file.
- Include the new template in
env-configmap.yamland/orsecret.yamlas needed.
Example of adding a new section:
newFeature:
keyBasePath: global.newFeature
config:
- env: NEW_FEATURE_ENABLED
key: enabled
defaultValue: false
- env: NEW_FEATURE_URL
key: url
valueExp: (printf "http://%s:%d" .Values.global.newFeature.host (int .Values.global.newFeature.port))
After adding this section, you need to include it in the appropriate files:
-
In
env-configmap.yaml, add:{{- include "airbyte.newFeature.configVars" . | nindent 2 }} -
If your section contains sensitive variables (marked with
sensitive: true), also add tosecret.yaml:{{- include "airbyte.newFeature.secrets" . | nindent 2 }} -
Update
charts/v2/airbyte/values.yamlto include an empty entry for the new section:newFeature: {}
Running the Generator
NOTE: You will need to install via in order to generate the config templates.
To generate the template files after making changes to config.yaml:
# From the chart directory (oss/charts/v2/airbyte/)
make gen.config
This will process config.yaml and update or create the template files in templates/config/.
Structure of config.yaml
ConfigSets
Each top-level stanza in config.yaml represents a ConfigSet, which is a group of related configuration variables. For example:
database:
keyBasePath: global.database
config:
# Database-related variables...
Common Fields
env: The environment variable name.key: The corresponding key in the Helm values.- By default the root of the path is the name of the config set (e.g.
database). - This can be overriden by the
keyBasePathfield.
- By default the root of the path is the name of the config set (e.g.
defaultValue: A static default value.defaultValueExp: An expression to compute the default value.valueExp: An expression to compute the value.sensitive: Flag for sensitive values that should be stored in a secret.secretRef: Reference to a secret for sensitive values.
Discriminator Fields
Discriminator fields allow for conditional configuration based on certain values. For example:
storage:
keyBasePath: global.storage
discriminatorField: type
discriminatorFieldOpts:
- azure
- gcs
- minio
- s3
config:
# Common variables...
- env: AWS_ACCESS_KEY_ID
key: s3.accessKeyId
discriminatorOpts:
- s3
sensitive: true
In this example, the AWS_ACCESS_KEY_ID variable will only be included when the storage type is set to s3.
Expression Syntax
Expressions in valueExp and defaultValueExp use Helm template syntax. Common patterns include:
- String formatting:
(printf "http://%s:%d" .Values.host (int .Values.port)) - Conditional logic:
ternary "value-if-true" "value-if-false" (eq .Values.condition "value") - Including other templates:
(include "airbyte.common.airbyteUrl" .)
Best Practices
Testing Changes
Always test your changes by deploying the chart locally before submitting them. This helps catch issues that might not be detected during generation.
Backward Compatibility
When modifying existing configurations:
- Be cautious about removing or renaming variables, as it may break existing deployments.
- If you need to remove a section, ensure you also remove any includes in the templates.
Common Pitfalls to Avoid
- Forgetting to include templates: After adding a new section, make sure to include it in the appropriate files (
env-configmap.yamland/orsecret.yaml). - Invalid expressions: Ensure that expressions in
valueExpanddefaultValueExpare valid Helm template syntax and can be embedded within{{- ... }}. - Missing required fields: Each variable definition should have at least
envandkeyfields. - Not running the generator: Always run
make gen.configafter making changes toconfig.yaml.
Examples
Example 1: Adding a Simple Environment Variable
# In config.yaml
logging:
keyBasePath: global.logging
config:
# Existing variables...
- env: LOG_FORMAT
key: format
defaultValue: json
Example 2: Using Expressions for Dynamic Values
# In config.yaml
api:
keyBasePath: global.api
config:
- env: API_URL
key: url
valueExp: (printf "http://%s-api-svc.%s:%d" .Release.Name .Release.Namespace (int .Values.api.service.port))
Example 3: Using Discriminator Fields
# In config.yaml
database:
keyBasePath: global.database
discriminatorField: type
discriminatorFieldOpts:
- postgres
- mysql
config:
- env: DATABASE_TYPE
key: type
defaultValue: postgres
- env: POSTGRES_HOST
key: postgres.host
discriminatorOpts:
- postgres
- env: MYSQL_HOST
key: mysql.host
discriminatorOpts:
- mysql
Contributing
When contributing changes to the Helm chart:
- Follow the guidelines in this README.
- Test your changes thoroughly.
- Document any new configuration options or changes to existing ones.
- Submit your changes according to the project's contribution guidelines.
Deploy airbyte with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has airbyte on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartairbyte is pinned at v2.6.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply