Getting Started

Kubernetes Installation

Deploy open-rcode on Kubernetes cluster.

Prerequisites

Before deploying open-rcode on Kubernetes, ensure you have:

  • A Kubernetes cluster - We recommend using managed services:
    • Scaleway Kapsule - Easy setup with built-in load balancer
    • AWS EKS - Highly scalable with AWS integrations
    • OVHcloud Managed Kubernetes - Cost-effective European option
    • Google GKE or Azure AKS - Alternative cloud options
  • kubectl configured to access your cluster
  • NGINX Ingress Controller installed
  • cert-manager installed (for TLS certificates)
  • Persistent Volume support

Quick Deploy

Download Kubernetes Manifests

Download all Kubernetes configuration files from the repository:

Terminal
# Create deployment directory
mkdir open-rcode-k8s && cd open-rcode-k8s

# Download all Kubernetes manifests
wget https://raw.githubusercontent.com/aidalinfo/open-rcode/refs/heads/dev/setup/kubernetes/app-configMaps.yaml
wget https://raw.githubusercontent.com/aidalinfo/open-rcode/refs/heads/dev/setup/kubernetes/mongo-configMaps.yaml
wget https://raw.githubusercontent.com/aidalinfo/open-rcode/refs/heads/dev/setup/kubernetes/kubeconfig-configMap.yaml
wget https://raw.githubusercontent.com/aidalinfo/open-rcode/refs/heads/dev/setup/kubernetes/rcoder-db-deploy.yaml
wget https://raw.githubusercontent.com/aidalinfo/open-rcode/refs/heads/dev/setup/kubernetes/rcoder-app-deploy.yaml
wget https://raw.githubusercontent.com/aidalinfo/open-rcode/refs/heads/dev/setup/kubernetes/ingress.yaml

Configure Environment Variables

Edit the configuration files to match your environment:

1. Update Namespaces

Replace ns-open-rcode with your desired namespace in all files:

Terminal
# Replace namespace in all files
sed -i 's/ns-open-rcode/your-namespace/g' *.yaml

2. Configure Application Settings

Edit app-configMaps.yaml:

app-configMaps.yaml
data:
  CONTAINER_MODE: "kubernetes"
  GITHUB_APP_NAME: "your-github-app-name"
  GITHUB_APP_ID: "your-github-app-id"
  GITHUB_APP_PRIVATE_KEY: "-----BEGIN RSA PRIVATE KEY-----\nYOUR_PRIVATE_KEY_CONTENT\n-----END RSA PRIVATE KEY-----"
  GITHUB_REDIRECT_URI: "https://your-domain.com/api/auth/github"
  GITHUB_CLIENT_ID: "your-github-oauth-client-id"
  GITHUB_CLIENT_SECRET: "your-github-oauth-client-secret"
  ENCRYPTION_KEY: "your-32-character-encryption-key-here"
  MONGODB_URI: "mongodb://root:your-mongodb-password@mongo-svc:27017/openrcode?authSource=admin"

3. Configure MongoDB Password

Edit mongo-configMaps.yaml:

mongo-configMaps.yaml
data:
  MONGO_INITDB_ROOT_PASSWORD: "your-mongodb-password"

4. Configure Kubeconfig

Recommended: Use a managed Kubernetes cluster from cloud providers like Scaleway, AWS EKS, or OVHcloud for production deployments.

For Kubernetes container mode, you need to configure access to your cluster. Get your kubeconfig from your cloud provider and edit kubeconfig-configMap.yaml with your cluster configuration:

kubeconfig-configMap.yaml
data:
  kubeconfig.yaml: |
    apiVersion: v1
    clusters:
    - name: "your-cluster-name"
      cluster:
        certificate-authority-data: YOUR_CLUSTER_CA_CERTIFICATE_DATA
        server: https://your-cluster-api-server:6443
    contexts:
    - name: admin@your-cluster-name
      context:
        cluster: "your-cluster-name"
        user: your-cluster-admin
    current-context: admin@your-cluster-name
    users:
    - name: your-cluster-admin
      user:
        token: YOUR_CLUSTER_ACCESS_TOKEN

5. Configure Ingress

Edit ingress.yaml to set your domain:

ingress.yaml
spec:
  rules:
    - host: your-domain.com
  tls:
  - hosts:
    - your-domain.com
    secretName: your-tls-secret

Deploy to Kubernetes

Deploy all components to your cluster:

Terminal
# Create namespace
kubectl create namespace your-namespace

# Apply ConfigMaps first
kubectl apply -f mongo-configMaps.yaml
kubectl apply -f app-configMaps.yaml
kubectl apply -f kubeconfig-configMap.yaml

# Deploy database
kubectl apply -f rcoder-db-deploy.yaml

# Wait for database to be ready
kubectl wait --for=condition=available --timeout=300s deployment/mongo -n your-namespace

# Deploy application
kubectl apply -f rcoder-app-deploy.yaml

# Wait for application to be ready
kubectl wait --for=condition=available --timeout=300s deployment/app-open-rcode -n your-namespace

# Apply ingress
kubectl apply -f ingress.yaml

Verify Deployment

Check that all components are running:

Terminal
# Check pods status
kubectl get pods -n your-namespace

# Check services
kubectl get svc -n your-namespace

# Check ingress
kubectl get ingress -n your-namespace

# View application logs
kubectl logs -l app=open-rcode -n your-namespace

# View database logs
kubectl logs -l app=mongo -n your-namespace

Configuration Reference

Required GitHub Integration

Create GitHub Apps as described in the Docker installation guide.

Environment Variables

VariableDescriptionRequired
GITHUB_APP_IDGitHub App ID
GITHUB_APP_NAMEGitHub App name
GITHUB_APP_PRIVATE_KEYGitHub App private key
GITHUB_CLIENT_IDOAuth Client ID
GITHUB_CLIENT_SECRETOAuth Client Secret
GITHUB_REDIRECT_URIOAuth callback URL
ENCRYPTION_KEY32-character encryption key
MONGODB_URIMongoDB connection string
CONTAINER_MODESet to kubernetes

Resource Requirements

Application Pod:

  • CPU: 250m (request) / 500m (limit)
  • Memory: 256Mi (request) / 512Mi (limit)
  • Replicas: 2 (for high availability)

MongoDB Pod:

  • CPU: 500m (request) / 1000m (limit)
  • Memory: 512Mi (request) / 1Gi (limit)
  • Storage: 10Gi persistent volume