Skip to content

PotLock/curatedotfun-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

curatedotfun-deploy

Kubernetes deployment for curatedotfun using Helm charts. This repository offers a hosted service of curatedotfun bots, each with their own PostgreSQL database.

Architecture

The deployment architecture consists of multiple bot instances, each with its own PostgreSQL database. Each bot is exposed via an Ingress resource.

flowchart TD
    subgraph "Kubernetes Cluster"
        subgraph "Bot 1 Namespace"
            B1[Bot 1 Deployment] --> BS1[Bot 1 Service]
            BS1 --> I1[Ingress]
            I1 --> E1[External Access]
            B1 --> P1[PostgreSQL 1]
            P1 --> PS1[PostgreSQL 1 Service]
            CM1[ConfigMap] --> B1
            S1[Secrets] --> B1
            S1 --> P1
        end
        
        subgraph "Bot 2 Namespace"
            B2[Bot 2 Deployment] --> BS2[Bot 2 Service]
            BS2 --> I2[Ingress]
            I2 --> E2[External Access]
            B2 --> P2[PostgreSQL 2]
            P2 --> PS2[PostgreSQL 2 Service]
            CM2[ConfigMap] --> B2
            S2[Secrets] --> B2
            S2 --> P2
        end
    end
Loading

Prerequisites

Before you begin, you'll need to set up your local environment:

MacOS

  1. Install either:

  2. Install command-line tools:

    brew install kubectl helm

Windows

  1. Install Docker Desktop with Kubernetes enabled

  2. Install command-line tools:

    choco install kubernetes-cli
    choco install kubernetes-helm

Configuration

The deployment is configured via the values.yaml file. This file contains the configuration for all bot instances and their associated PostgreSQL databases.

Bot Configuration

Each bot is configured in the bots array in the values.yaml file:

bots:
- name: bot1
  domain: bot1.example.com
  postgresUser: botuser1
  postgresDB: botdb1
  # dbPassword and encryptionKey are auto-generated

You can add as many bots as needed by adding more entries to the bots array.

Default Configuration

Default configuration for all bots is specified in the botDefaults section:

botDefaults:
  bot:
    image: your-registry/bot-image:latest
    replicaCount: 1
    servicePort: 8080
    resources:
      requests:
        cpu: 200m
        memory: 512Mi
      limits:
        cpu: 500m
        memory: 1Gi

Deployment

To deploy the Helm chart:

helm install curatedotfun ./

To upgrade an existing deployment (when you've made changes to the configuration or when a new version is available):

helm upgrade curatedotfun ./

This allows you to update your deployment without downtime, applying only the changes that are needed while preserving the state of your application.

To uninstall the deployment:

helm uninstall curatedotfun

Accessing the Application

Each bot is exposed via an Ingress resource at the domain specified in the bots array. For example, if you have a bot with domain: bot1.example.com, you can access it at http://bot1.example.com.

Make sure your DNS is configured to point to your Kubernetes cluster's ingress controller.

Troubleshooting

Check Pod Status

To check the status of your pods:

kubectl get pods

View Pod Logs

To view the logs of a specific pod:

kubectl logs <pod-name>

Check Ingress Status

To check the status of your ingress resources:

kubectl get ingress

Common Issues

  1. Pods in CrashLoopBackOff state: Check the pod logs for errors.
  2. Database connection issues: Check the pod logs for database connection errors.
  3. Ingress not working: Ensure your ingress controller is properly configured and your DNS is pointing to the correct IP address.

Useful Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages