pipelines
Some checks failed
CI/CD Pipeline / build (push) Failing after 4s

This commit is contained in:
2026-03-06 16:49:59 -07:00
parent 181c6ca84b
commit 84261d4747
6 changed files with 191 additions and 1 deletions

16
kubernetes/configmap.yml Normal file
View File

@@ -0,0 +1,16 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: ai-ha-elixir-config
namespace: ai-ha-elixir
data:
PHX_SERVER: "true"
PORT: "4000"
POOL_SIZE: "5"
K8S_NAMESPACE: ai-ha-elixir
K8S_SERVICE_NAME: ai-ha-elixir-headless
RELEASE_COOKIE: elixir_ai_cluster_cookie
PHX_HOST: ai-ha.alexmickelson.guru
DATABASE_URL: ecto://elixir_ai:elixir_ai@postgres-service.postgres/elixir_ai
AI_RESPONSES_ENDPOINT: http://ai-snow.reindeer-pinecone.ts.net:9292/v1/chat/completions
AI_MODEL: gpt-oss-120b

26
kubernetes/ingress.yml Normal file
View File

@@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ai-ha-elixir
namespace: ai-ha-elixir
annotations:
# WebSocket support for LiveView
nginx.ingress.kubernetes.io/proxy-read-timeout: "86400"
nginx.ingress.kubernetes.io/proxy-send-timeout: "86400"
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
spec:
ingressClassName: nginx
rules:
- host: ai-ha.alexmickelson.guru
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: ai-ha-elixir
port:
number: 80

34
kubernetes/services.yml Normal file
View File

@@ -0,0 +1,34 @@
apiVersion: v1
kind: Namespace
metadata:
name: ai-ha-elixir
---
apiVersion: v1
kind: Service
metadata:
name: ai-ha-elixir-headless
namespace: ai-ha-elixir
spec:
clusterIP: None
selector:
app: ai-ha-elixir
ports:
- name: http
port: 4000
- name: epmd
port: 4369
- name: beam
port: 9000
---
apiVersion: v1
kind: Service
metadata:
name: ai-ha-elixir
namespace: ai-ha-elixir
spec:
selector:
app: ai-ha-elixir
ports:
- name: http
port: 80
targetPort: 4000

View File

@@ -0,0 +1,67 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: ai-ha-elixir
namespace: ai-ha-elixir
spec:
serviceName: ai-ha-elixir-headless
replicas: 3
selector:
matchLabels:
app: ai-ha-elixir
template:
metadata:
labels:
app: ai-ha-elixir
spec:
containers:
- name: ai-ha-elixir
image: alexmickelson/ai-liveview:$GITHUB_RUN_NUMBER
ports:
- containerPort: 4000
name: http
- containerPort: 4369
name: epmd
- containerPort: 9000
name: beam
envFrom:
- configMapRef:
name: ai-ha-elixir-config
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: RELEASE_NODE
value: "elixir_ai@$(POD_IP)"
- name: SECRET_KEY_BASE
valueFrom:
secretKeyRef:
name: ai-ha-elixir-secrets
key: SECRET_KEY_BASE
- name: AI_TOKEN
valueFrom:
secretKeyRef:
name: ai-ha-elixir-secrets
key: AI_TOKEN
readinessProbe:
httpGet:
path: /
port: 4000
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /
port: 4000
initialDelaySeconds: 20
periodSeconds: 10
failureThreshold: 5
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"