From 7eb4e0262e5f9ac7989cbe50eb2cf9fadea891ca Mon Sep 17 00:00:00 2001 From: user Date: Thu, 21 Mar 2024 20:51:29 -0500 Subject: [PATCH] add open-webui --- argocd/templates/open-webui.yaml | 20 +++++++++++++ open-webui/Chart.yaml | 7 +++++ open-webui/templates/deployment.yaml | 37 ++++++++++++++++++++++++ open-webui/templates/ingress.yaml | 42 ++++++++++++++++++++++++++++ open-webui/templates/pvc.yaml | 11 ++++++++ open-webui/templates/secrets.yaml | 16 +++++++++++ open-webui/templates/service.yaml | 12 ++++++++ 7 files changed, 145 insertions(+) create mode 100644 argocd/templates/open-webui.yaml create mode 100644 open-webui/Chart.yaml create mode 100644 open-webui/templates/deployment.yaml create mode 100644 open-webui/templates/ingress.yaml create mode 100644 open-webui/templates/pvc.yaml create mode 100644 open-webui/templates/secrets.yaml create mode 100644 open-webui/templates/service.yaml diff --git a/argocd/templates/open-webui.yaml b/argocd/templates/open-webui.yaml new file mode 100644 index 0000000..26d368b --- /dev/null +++ b/argocd/templates/open-webui.yaml @@ -0,0 +1,20 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: open-webui + namespace: argocd +spec: + project: default + source: + repoURL: https://gitea.durp.info/DeveloperDurp/homelab.git + targetRevision: main + path: open-webui + destination: + namespace: open-webui + name: in-cluster + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/open-webui/Chart.yaml b/open-webui/Chart.yaml new file mode 100644 index 0000000..1561d60 --- /dev/null +++ b/open-webui/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: open-webui +description: A Helm chart for Kubernetes +type: application + +version: 0.1.0 +appVersion: "1.16.0" diff --git a/open-webui/templates/deployment.yaml b/open-webui/templates/deployment.yaml new file mode 100644 index 0000000..7a51d0f --- /dev/null +++ b/open-webui/templates/deployment.yaml @@ -0,0 +1,37 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: open-webui + name: open-webui + labels: + app: open-webui +spec: + selector: + matchLabels: + app: open-webui + replicas: 1 + template: + metadata: + labels: + app: open-webui + spec: + containers: + - name: open-webui + image: registry.internal.durp.info/open-webui/open-webui:main + imagePullPolicy: Always + volumeMounts: + - name: open-webui-pvc + mountPath: /app/backend/data + ports: + - name: http + containerPort: 8080 + env: + - name: OLLAMA_BASE_URL + valueFrom: + secretKeyRef: + name: open-webui-secret + key: OLLAMA_BASE_URL + volumes: + - name: open-webui-pvc + persistentVolumeClaim: + claimName: open-webui-pvc diff --git a/open-webui/templates/ingress.yaml b/open-webui/templates/ingress.yaml new file mode 100644 index 0000000..6331e92 --- /dev/null +++ b/open-webui/templates/ingress.yaml @@ -0,0 +1,42 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: open-webui-ingress +spec: + entryPoints: + - websecure + routes: + - match: Host(`open-webui.durp.info`) && PathPrefix(`/`) + kind: Rule + services: + - name: open-webui + port: 8080 + tls: + secretName: open-webui-tls + +--- + +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: open-webui-tls +spec: + secretName: open-webui-tls + issuerRef: + name: letsencrypt-production + kind: ClusterIssuer + commonName: "open-webui.durp.info" + dnsNames: + - "open-webui.durp.info" + +--- + +kind: Service +apiVersion: v1 +metadata: + name: open-webui-external-dns + annotations: + external-dns.alpha.kubernetes.io/hostname: open-webui.durp.info +spec: + type: ExternalName + externalName: durp.info diff --git a/open-webui/templates/pvc.yaml b/open-webui/templates/pvc.yaml new file mode 100644 index 0000000..63a3280 --- /dev/null +++ b/open-webui/templates/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: open-webui-pvc +spec: + storageClassName: longhorn + accessModes: + - ReadWriteMany + resources: + requests: + storage: 10Gi diff --git a/open-webui/templates/secrets.yaml b/open-webui/templates/secrets.yaml new file mode 100644 index 0000000..1fe6fec --- /dev/null +++ b/open-webui/templates/secrets.yaml @@ -0,0 +1,16 @@ +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: open-webui-secret +spec: + secretStoreRef: + name: vault + kind: ClusterSecretStore + target: + name: open-webui-secret + data: + - secretKey: OLLAMA_BASE_URL + remoteRef: + key: secrets/open-webui + property: OLLAMA_BASE_URL + diff --git a/open-webui/templates/service.yaml b/open-webui/templates/service.yaml new file mode 100644 index 0000000..cd93455 --- /dev/null +++ b/open-webui/templates/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: open-webui +spec: + ports: + - name: http + port: 8080 + targetPort: 8080 + protocol: TCP + selector: + app: open-webui