Helm Chart Overview
Relevant source files
The following files were used as context for generating this wiki page:
The Helm chart for OdooConnectorAPI provides a standardized way to package and deploy the API onto Kubernetes clusters. It encapsulates all necessary Kubernetes resources, including deployments and services, ensuring that the FastAPI-based application can be scaled and managed efficiently in production environments.
The chart allows for the configuration of Odoo connection details via environment variables, enabling the API to communicate with external Odoo ERP systems. This containerized approach ensures consistency across different environments, from local development using Docker Compose to full-scale Kubernetes deployments.
Sources: README.md:5-9, charts/odooconnectorapi/Chart.yaml:1-5
Chart Metadata and Structure
The chart is identified as odooconnectorapi version 0.1.0. It follows the standard Helm v2 API versioning for template management.
The diagram shows the relationship between the chart metadata, configuration values, and the generated Kubernetes resources.
Sources: charts/odooconnectorapi/Chart.yaml:1-5, charts/odooconnectorapi/templates/deployment.yaml, charts/odooconnectorapi/templates/service.yaml
Configuration and Values
The chart uses a values.yaml file to define the configurable parameters of the deployment. These values are injected into the templates during the installation process.
Key Configuration Parameters
| Parameter | Description | Default Value |
|---|---|---|
image.repository | Docker image repository for the API | <your_image> |
image.tag | Docker image tag | latest |
service.type | Kubernetes service type | ClusterIP |
service.port | Port exposed by the service | 80 |
replicaCount | Number of pod replicas to deploy | 1 |
env.ODOO_URL | URL of the Odoo instance | localhost |
env.ODOO_DB | Odoo database name | mydb |
env.ODOO_USERNAME | Odoo login username | admin |
env.ODOO_PASSWORD | Odoo login password | admin |
Sources: charts/odooconnectorapi/values.yaml:4-22
Deployment Architecture
The deployment template defines how the OdooConnectorAPI container is run within the cluster. It maps specific configuration values to environment variables that the FastAPI application consumes at runtime.
Container Environment Mapping
The application relies on four primary environment variables to establish a connection with Odoo via the odoorpc library.
env:
- name: ODOO_URL
value: {{ .Values.env.ODOO_URL }}
- name: ODOO_DB
value: {{ .Values.env.ODOO_DB }}
- name: ODOO_USERNAME
value: {{ .Values.env.ODOO_USERNAME }}
- name: ODOO_PASSWORD
value: {{ .Values.env.ODOO_PASSWORD }}
Sources: charts/odooconnectorapi/templates/deployment.yaml:12-21, app/main.py:9-12
Networking and Service
The API container listens on port 8000 internally. The Kubernetes Service acts as a load balancer, routing traffic from the defined service port (default 80) to the container's port.
The diagram illustrates the flow of traffic from an external client through the Kubernetes Service to the individual API pods.
Sources: charts/odooconnectorapi/templates/service.yaml:6-11, charts/odooconnectorapi/templates/deployment.yaml:23-24
Deployment Process
Deploying the OdooConnectorAPI involves packaging the chart and installing it using the Helm CLI.
- Package:
helm package .generates a.tgzarchive. - Install:
helm install odooconnectorapi odooconnectorapi-0.1.0.tgz --values values.yamldeploys the resources to the cluster.
Sources: README.md:55-65
Summary
The OdooConnectorAPI Helm chart provides a robust mechanism for deploying the RESTful Odoo bridge. By separating configuration (via values.yaml) from infrastructure definitions (via templates), it facilitates scalable deployments across various Kubernetes environments while maintaining connection security through environment variable injection.