Add whisper web-ui with basic auth

This commit is contained in:
Ruben Hensen
2024-12-17 13:26:17 +01:00
parent 1af50c53eb
commit 2af297138d
8 changed files with 165 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: whisper
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://github.com/rubenhensen/k8scd.git
targetRevision: HEAD
path: whisper
destination:
server: https://kubernetes.default.svc
namespace: whisper
syncPolicy:
syncOptions:
- CreateNamespace=true
+1
View File
@@ -13,6 +13,7 @@ metadata:
nginx.ingress.kubernetes.io/auth-secret: longhorn-basic-auth
# message to display with an appropriate context why the authentication is required
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required '
# nginx.ingress.kubernetes.io/cors-allow-origin: "http://localhost:3000/"
# nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, GET, POST, OPTIONS, DELETE"
# If you encounter a redirect loop or are getting a 307 response code
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
io.kompose.service: app-claim0
name: app-claim0
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
io.kompose.service: app-claim1
name: app-claim1
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
+46
View File
@@ -0,0 +1,46 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: app
name: app
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: app
strategy:
type: Recreate
template:
metadata:
labels:
io.kompose.service: app
spec:
containers:
- command:
- python
- app.py
- --server_port
- "7860"
- --server_name
- 0.0.0.0
image: jhj0517/whisper-webui:latest
name: app
ports:
- containerPort: 7860
protocol: TCP
stdin: true
tty: true
volumeMounts:
- mountPath: /Whisper-WebUI/models
name: app-claim0
- mountPath: /Whisper-WebUI/outputs
name: app-claim1
restartPolicy: Always
volumes:
- name: app-claim0
persistentVolumeClaim:
claimName: app-claim0
- name: app-claim1
persistentVolumeClaim:
claimName: app-claim1
+13
View File
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
labels:
io.kompose.service: app
name: app
spec:
ports:
- name: "7860"
port: 7860
targetPort: 7860
selector:
io.kompose.service: app
+19
View File
@@ -0,0 +1,19 @@
# services:
# app:
# build: .
# image: jhj0517/whisper-webui:latest
# volumes:
# # You can mount the container's volume paths to directory paths on your local machine.
# # Models will be stored in the `./models' directory on your machine.
# # Similarly, all output files will be stored in the `./outputs` directory.
# - ./models:/Whisper-WebUI/models
# - ./outputs:/Whisper-WebUI/outputs
# ports:
# - "7860:7860"
# stdin_open: true
# tty: true
# entrypoint: ["python", "app.py", "--server_port", "7860", "--server_name", "0.0.0.0",]
+43
View File
@@ -0,0 +1,43 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: whisper-ingress
annotations:
# nginx.ingress.kubernetes.io/rewrite-target: /
cert-manager.io/cluster-issuer: prod-cluster-issuer
nginx.ingress.kubernetes.io/ssl-passthrough: "false"
nginx.ingress.kubernetes.io/enable-cors: "true"
# type of authentication
nginx.ingress.kubernetes.io/auth-type: basic
# name of the secret that contains the user/password definitions
nginx.ingress.kubernetes.io/auth-secret: whisper-basic-auth
# message to display with an appropriate context why the authentication is required
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required '
# nginx.ingress.kubernetes.io/cors-allow-origin: "http://localhost:3000/"
# nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, GET, POST, OPTIONS, DELETE"
# If you encounter a redirect loop or are getting a 307 response code
# then you need to force the nginx ingress to connect to the backend using HTTPS.
#
# nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
# namespace: ente-photos
spec:
ingressClassName: nginx
rules:
- host: alv.hensen.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: app
port:
number: 80
# TLS configuration for HTTPS
tls:
# TLS secretName used on ClusterIssuer
- secretName: letsencrypt-prod
hosts:
- alv.hensen.io