DevOps

Kubernetes Deployment

Deploy Odoo instances on your Kubernetes cluster with Nurosentrix.

Overview

Nurosentrix supports deploying Odoo instances on Kubernetes clusters, providing better scalability and resource management for large deployments.

Prerequisites

  • A running Kubernetes cluster (1.24+)
  • kubectl configured to access the cluster
  • Helm 3.x installed
  • Storage class for persistent volumes
  • Ingress controller (nginx-ingress recommended)

Connecting Your Cluster

Step 1: Add Cluster in Nurosentrix

  1. Go to Settings → Kubernetes
  2. Click "Add Cluster"
  3. Enter a name for your cluster
  4. Upload your kubeconfig file or paste the configuration
  5. Click "Connect"

Step 2: Verify Connection

Nurosentrix will verify it can connect to your cluster and list the available namespaces and resources.

The Kubernetes options appear in the instance wizard when a cluster is connected under Settings → Kubernetes.

Helm Chart

Nurosentrix deploys Odoo using a Helm chart. The chart includes:

  • Odoo Deployment
  • PostgreSQL StatefulSet
  • Persistent Volume Claims
  • Services
  • Ingress configuration
  • Horizontal Pod Autoscaler

Chart Values

# values.yaml
odoo:
  version: "17.0"
  edition: community
  replicas: 2

  resources:
    requests:
      cpu: 500m
      memory: 1Gi
    limits:
      cpu: 2000m
      memory: 4Gi

postgresql:
  enabled: true
  primary:
    persistence:
      size: 20Gi

persistence:
  filestore:
    size: 50Gi
    storageClass: standard

ingress:
  enabled: true
  hostname: odoo.example.com
  tls: true

autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10
  targetCPU: 70

Deploying an Instance

Using Nurosentrix Dashboard

  1. Go to Instances → New Instance
  2. Select your Kubernetes cluster
  3. Choose a namespace (or create new)
  4. Configure Odoo settings
  5. Set resource limits
  6. Configure ingress/domain
  7. Click "Deploy"

Using Helm Directly

# Add Nurosentrix Helm repository
helm repo add nurosentrix https://charts.nurosentrix.com
helm repo update

# Install Odoo
helm install my-odoo nurosentrix/odoo \
  --namespace odoo \
  --create-namespace \
  -f values.yaml

Kubernetes-backed instances show the target cluster and namespace in the Instances list.

Architecture

A typical Kubernetes deployment includes:

┌─────────────────────────────────────────┐
│              Ingress                     │
│         (nginx-ingress)                  │
└─────────────────┬───────────────────────┘
                  │
┌─────────────────▼───────────────────────┐
│              Service                     │
│           (ClusterIP)                    │
└─────────────────┬───────────────────────┘
                  │
┌─────────────────▼───────────────────────┐
│            Deployment                    │
│         (Odoo Pods x N)                  │
│    ┌──────┐ ┌──────┐ ┌──────┐          │
│    │ Pod  │ │ Pod  │ │ Pod  │          │
│    └──────┘ └──────┘ └──────┘          │
└─────────────────┬───────────────────────┘
                  │
┌─────────────────▼───────────────────────┐
│           StatefulSet                    │
│          (PostgreSQL)                    │
│              ┌──────┐                    │
│              │ Pod  │                    │
│              └──────┘                    │
└─────────────────────────────────────────┘

Scaling

Horizontal Pod Autoscaler

Enable HPA to automatically scale Odoo pods based on CPU usage:

autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10
  targetCPU: 70
  targetMemory: 80

Manual Scaling

kubectl scale deployment my-odoo --replicas=5 -n odoo

Persistent Storage

Configure storage for filestore and database:

ComponentRecommended SizeStorage Class
PostgreSQL20-100 GBFast SSD (gp3, premium-ssd)
Filestore50-500 GBStandard or NFS

High Availability

For production deployments:

  • Run at least 2 Odoo replicas
  • Use PostgreSQL with replication
  • Configure pod anti-affinity
  • Use shared filestore (NFS or cloud storage)
affinity:
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchLabels:
              app: odoo
          topologyKey: kubernetes.io/hostname

Monitoring

If you have Prometheus installed, Nurosentrix can export metrics:

metrics:
  enabled: true
  serviceMonitor:
    enabled: true
    namespace: monitoring

Troubleshooting

Pods Not Starting

# Check pod status
kubectl get pods -n odoo

# View pod events
kubectl describe pod <pod-name> -n odoo

# Check logs
kubectl logs <pod-name> -n odoo

Common Issues

  • ImagePullBackOff - Check image name and pull secrets
  • CrashLoopBackOff - Check application logs
  • Pending - Insufficient resources or storage issues