diff --git a/ai-agents/manifests.yaml b/ai-agents/manifests.yaml deleted file mode 100644 index 7d01050..0000000 --- a/ai-agents/manifests.yaml +++ /dev/null @@ -1,200 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: ollama - namespace: ai-agents -spec: - progressDeadlineSeconds: 600 - replicas: 1 - revisionHistoryLimit: 10 - selector: - matchLabels: - app: ollama - strategy: - rollingUpdate: - maxSurge: 25% - maxUnavailable: 25% - type: RollingUpdate - template: - metadata: - creationTimestamp: null - labels: - app: ollama - spec: - containers: - - image: ollama/ollama:latest - imagePullPolicy: Always - name: ollama - ports: - - containerPort: 11434 - protocol: TCP - resources: - requests: - cpu: '2' - memory: 4Gi - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - volumeMounts: - - mountPath: /root/.ollama - name: ollama-data - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - volumes: - - name: ollama-data - persistentVolumeClaim: - claimName: ollama-pvc - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: open-webui - namespace: ai-agents -spec: - progressDeadlineSeconds: 600 - replicas: 1 - revisionHistoryLimit: 10 - selector: - matchLabels: - app: open-webui - strategy: - rollingUpdate: - maxSurge: 25% - maxUnavailable: 25% - type: RollingUpdate - template: - metadata: - creationTimestamp: null - labels: - app: open-webui - spec: - containers: - - env: - - name: OLLAMA_BASE_URL - value: http://ollama.ai-agents.svc.cluster.local:11434 - image: ghcr.io/open-webui/open-webui:main - imagePullPolicy: IfNotPresent - name: open-webui - ports: - - containerPort: 8080 - protocol: TCP - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - volumeMounts: - - mountPath: /app/backend/data - name: open-webui-data - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - volumes: - - name: open-webui-data - persistentVolumeClaim: - claimName: open-webui-pvc - ---- -apiVersion: v1 -kind: Service -metadata: - name: ollama - namespace: ai-agents -spec: - internalTrafficPolicy: Cluster - ipFamilies: - - IPv4 - ipFamilyPolicy: SingleStack - ports: - - port: 11434 - protocol: TCP - targetPort: 11434 - selector: - app: ollama - sessionAffinity: None - type: ClusterIP - ---- -apiVersion: v1 -kind: Service -metadata: - name: open-webui - namespace: ai-agents -spec: - allocateLoadBalancerNodePorts: true - externalTrafficPolicy: Cluster - internalTrafficPolicy: Cluster - ipFamilies: - - IPv4 - ipFamilyPolicy: SingleStack - ports: - - nodePort: 31583 - port: 80 - protocol: TCP - targetPort: 8080 - selector: - app: open-webui - sessionAffinity: None - type: LoadBalancer - ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - finalizers: - - kubernetes.io/pvc-protection - name: ollama-pvc - namespace: ai-agents -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 20Gi - storageClassName: longhorn - volumeMode: Filesystem - ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - finalizers: - - kubernetes.io/pvc-protection - name: open-webui-pvc - namespace: ai-agents -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 5Gi - storageClassName: longhorn - volumeMode: Filesystem - ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: applaud-ingress - namespace: ai-agents - annotations: - k8s.apisix.apache.org/enable-websocket: "true" -spec: - ingressClassName: apisix - rules: - - host: ai.applaude.net - http: - paths: - - backend: - service: - name: open-webui - port: - number: 80 - path: / - pathType: Prefix - - diff --git a/interface/k8s/kustomization.yaml b/interface/k8s/kustomization.yaml index 3bfb019..0b572e8 100644 --- a/interface/k8s/kustomization.yaml +++ b/interface/k8s/kustomization.yaml @@ -1,4 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - placeholder.yaml + - open-webui/ diff --git a/interface/k8s/open-webui/deployment.yaml b/interface/k8s/open-webui/deployment.yaml new file mode 100644 index 0000000..f47d973 --- /dev/null +++ b/interface/k8s/open-webui/deployment.yaml @@ -0,0 +1,60 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: open-webui + namespace: interface + labels: + app.kubernetes.io/name: open-webui +spec: + replicas: 1 + revisionHistoryLimit: 3 + selector: + matchLabels: + app.kubernetes.io/name: open-webui + strategy: + type: Recreate # Better for single PVCs + template: + metadata: + labels: + app.kubernetes.io/name: open-webui + spec: + containers: + - name: open-webui + # Pinning to a specific version is recommended, but keeping main if user prefers. + # Alternatively, using a recent stable tag like v0.3.32 + image: ghcr.io/open-webui/open-webui:main + imagePullPolicy: IfNotPresent + env: + - name: OLLAMA_BASE_URL + value: "http://litellm.ai-core.svc.cluster.local:4000" # Pointing to LiteLLM router! + - name: WEBUI_AUTH + value: "False" # Based on default, keeping it simple or whatever they had + ports: + - containerPort: 8080 + protocol: TCP + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 2000m + memory: 2Gi + livenessProbe: + httpGet: + path: /health + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 15 + readinessProbe: + httpGet: + path: /health + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 5 + volumeMounts: + - mountPath: /app/backend/data + name: open-webui-data + volumes: + - name: open-webui-data + persistentVolumeClaim: + claimName: open-webui-pvc diff --git a/interface/k8s/open-webui/ingress.yaml b/interface/k8s/open-webui/ingress.yaml new file mode 100644 index 0000000..c29a9c5 --- /dev/null +++ b/interface/k8s/open-webui/ingress.yaml @@ -0,0 +1,20 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: open-webui-ingress + namespace: interface + annotations: + k8s.apisix.apache.org/enable-websocket: "true" +spec: + ingressClassName: apisix + rules: + - host: ai.applaude.net + http: + paths: + - backend: + service: + name: open-webui + port: + number: 80 + path: / + pathType: Prefix diff --git a/interface/k8s/open-webui/kustomization.yaml b/interface/k8s/open-webui/kustomization.yaml new file mode 100644 index 0000000..32c5459 --- /dev/null +++ b/interface/k8s/open-webui/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - deployment.yaml + - service.yaml + - pvc.yaml + - ingress.yaml diff --git a/interface/k8s/open-webui/pvc.yaml b/interface/k8s/open-webui/pvc.yaml new file mode 100644 index 0000000..6727318 --- /dev/null +++ b/interface/k8s/open-webui/pvc.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: open-webui-pvc + namespace: interface + labels: + app.kubernetes.io/name: open-webui +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi + storageClassName: longhorn diff --git a/interface/k8s/open-webui/service.yaml b/interface/k8s/open-webui/service.yaml new file mode 100644 index 0000000..284f801 --- /dev/null +++ b/interface/k8s/open-webui/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: open-webui + namespace: interface + labels: + app.kubernetes.io/name: open-webui +spec: + ports: + - port: 80 + targetPort: 8080 + protocol: TCP + selector: + app.kubernetes.io/name: open-webui + type: ClusterIP # We use Ingress now instead of LoadBalancer with NodePort diff --git a/interface/k8s/placeholder.yaml b/interface/k8s/placeholder.yaml deleted file mode 100644 index 3dfff95..0000000 --- a/interface/k8s/placeholder.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: interface-gitops-placeholder - namespace: interface -data: - note: "Replace with Slack bot and HQ dashboard workloads when ready."