Kaneo LogoKaneo
Deployments

Kubernetes

This guide explains how to deploy Kaneo on Kubernetes using our Helm chart. This setup is ideal for production environments where you need scalability and high availability.

Prerequisites

  • A Kubernetes cluster (v1.19+)
  • Helm 3 installed
  • kubectl configured to communicate with your cluster
  • Basic knowledge of Kubernetes and Helm

Clone the Kaneo repository:

git clone https://github.com/usekaneo/kaneo.git
cd kaneo

Install the Helm chart with default values:

helm install kaneo ./charts/kaneo --namespace kaneo --create-namespace

Access Kaneo using port forwarding:

# Port forward to access both services
kubectl port-forward svc/kaneo-web 5173:5173 -n kaneo &
kubectl port-forward svc/kaneo-api 1337:1337 -n kaneo &
 
# Access the application at http://localhost:5173

Production Deployment with Ingress

For production environments, you should expose Kaneo through an Ingress controller:

Create a values file named kaneo-values.yaml:

api:
  env:
    jwtAccess: "your-secure-jwt-token"
 
  # For production, consider setting resource limits
  resources:
    limits:
      cpu: 500m
      memory: 512Mi
    requests:
      cpu: 100m
      memory: 256Mi
 
  persistence:
    enabled: true
    size: 10Gi
 
web:
  env:
    apiUrl: "https://your-domain.com"
 
  resources:
    limits:
      cpu: 300m
      memory: 256Mi
    requests:
      cpu: 100m
      memory: 128Mi
 
ingress:
  enabled: true
  className: "nginx"
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /$1
  hosts:
    - host: your-domain.com
      paths:
        - path: /?(.*)
          pathType: Prefix
          service: web
          port: 80
        - path: /api/?(.*)
          pathType: Prefix
          service: api
          port: 1337
  tls:
    - secretName: kaneo-tls
      hosts:
        - your-domain.com

Install the Helm chart with your custom values:

helm install kaneo ./charts/kaneo \
  --namespace kaneo \
  --create-namespace \
  -f kaneo-values.yaml

Configure your DNS settings to point your-domain.com to your Ingress controller's external IP or load balancer.

You should now be able to access Kaneo at https://your-domain.com and the API will be accessible at https://your-domain.com/api. 🎉

Using Secrets for Sensitive Data

For better security, you can store sensitive data like JWT tokens in Kubernetes Secrets:

Create a Secret for the JWT access token:

kubectl create secret generic kaneo-secrets \
  --namespace kaneo \
  --from-literal=jwt-access="your-secure-jwt-token"

Update your values file to use the Secret:

api:
  env:
    existingSecret:
      enabled: true
      name: "kaneo-secrets"
      key: "jwt-access"

Upgrade your Helm release:

helm upgrade kaneo ./charts/kaneo \
  --namespace kaneo \
  -f kaneo-values.yaml

Using Gateway API

As an alternative to Ingress, you can use the Kubernetes Gateway API for more advanced routing capabilities:

Make sure the Gateway API is installed in your cluster.

Create a file named kaneo-gateway.yaml:

apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: kaneo
  namespace: kaneo
spec:
  parentRefs:
  - name: main-gateway  # Your gateway name
    namespace: gateway-system  # Your gateway namespace
    sectionName: https
  hostnames:
  - "your-domain.com"
  rules:
  # Frontend route (root path)
  - matches:
    - path:
        type: PathPrefix
        value: /
    backendRefs:
    - name: kaneo-web
      port: 80
  # API route (api path prefix)
  - matches:
    - path:
        type: PathPrefix
        value: /api
    backendRefs:
    - name: kaneo-api
      port: 1337
    filters:
    - type: URLRewrite
      urlRewrite:
        path:
          type: ReplacePrefixMatch
          replacePrefixMatch: /

Apply the Gateway configuration:

kubectl apply -f kaneo-gateway.yaml

Uninstalling

To uninstall Kaneo from your Kubernetes cluster:

helm uninstall kaneo -n kaneo

This will remove all the Kubernetes components associated with the chart and delete the release.

Next Steps

  • Configure monitoring with Prometheus and Grafana
  • Set up automated backups for your SQLite database
  • Implement horizontal pod autoscaling for high availability

On this page