feat(huginn): split huginn into agent pods for better performance

This commit is contained in:
SeanOMik 2024-06-26 20:24:55 -04:00
parent 5cc0783f63
commit 60226b3ca9
4 changed files with 68 additions and 22 deletions

View File

@ -0,0 +1,41 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2beta2.schema.json
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: huginn-agent
namespace: default
spec:
interval: 5m
chart:
spec:
chart: app-template
version: 3.1.0
sourceRef:
kind: HelmRepository
name: bjws-charts
namespace: flux-system
values:
controllers:
main:
replicas: 3
pod:
securityContext:
runAsNonRoot: true
containers:
main:
image:
repository: ghcr.io/huginn/huginn-single-process
tag: 5a1509b51188e0d16868be893c983d6fcfd232a5
command:
- /scripts/init
- bin/threaded.rb
envFrom:
- secretRef:
name: huginn-env
- configMapRef:
name: huginn-env

View File

@ -0,0 +1,20 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: huginn-env
namespace: default
data:
DATABASE_ADAPTER: postgresql
DATABASE_HOST: postgresql.database
DATABASE_PORT: "5432"
DATABASE_NAME: huginn
DATABASE_RECONNECT: "true"
# Specified in huginn-env secret
# DATABASE_USERNAME:
# DATABASE_PASSWORD:
#TIMEZONE: ${SERVER_TIMEZONE}
USE_GRAPHVIZ_DOT: dot
USE_EVERNOTE_SANDBOX: "false" # set to production
RAILS_ENV: production

View File

@ -29,31 +29,14 @@ spec:
containers: containers:
main: main:
image: image:
repository: ghcr.io/huginn/huginn repository: ghcr.io/huginn/huginn-single-process
tag: 0533a3768537f7a6a157227bfd9a9caefada768f tag: 5a1509b51188e0d16868be893c983d6fcfd232a5
command:
- /scripts/init
- bin/threaded.rb
env:
DATABASE_ADAPTER: postgresql
DATABASE_HOST: postgresql.database
DATABASE_PORT: 5432
DATABASE_NAME: huginn
DATABASE_RECONNECT: true
# Specified in huginn-env
# DATABASE_USERNAME:
# DATABASE_PASSWORD:
#TIMEZONE: ${SERVER_TIMEZONE}
USE_GRAPHVIZ_DOT: dot
USE_EVERNOTE_SANDBOX: false # set to production
envFrom: envFrom:
- secretRef: - secretRef:
name: huginn-env name: huginn-env
- configMapRef:
name: huginn-env
service: service:
app: app:

View File

@ -1,5 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ./env-configmap.sops.yaml
- ./env-secret.sops.yaml - ./env-secret.sops.yaml
- ./helm-release.yaml - ./helm-release.yaml
- ./agent-helm-release.yaml