diff --git a/apps/templates/whisper-folder.yaml b/apps/templates/whisper-folder.yaml index e7f3720..e9ca4c1 100644 --- a/apps/templates/whisper-folder.yaml +++ b/apps/templates/whisper-folder.yaml @@ -10,7 +10,7 @@ spec: source: repoURL: https://github.com/rubenhensen/k8scd.git targetRevision: HEAD - path: whisper + path: whishper destination: server: https://kubernetes.default.svc namespace: whisper diff --git a/whisper/docker-compose.yml b/disable/whisper/docker-compose.yml similarity index 100% rename from whisper/docker-compose.yml rename to disable/whisper/docker-compose.yml diff --git a/whisper/env-configmap.yaml b/disable/whisper/env-configmap.yaml similarity index 100% rename from whisper/env-configmap.yaml rename to disable/whisper/env-configmap.yaml diff --git a/whisper/ingress.yaml b/disable/whisper/ingress.yaml similarity index 100% rename from whisper/ingress.yaml rename to disable/whisper/ingress.yaml diff --git a/whisper/mongo-claim2-persistentvolumeclaim.yaml b/disable/whisper/mongo-claim2-persistentvolumeclaim.yaml similarity index 100% rename from whisper/mongo-claim2-persistentvolumeclaim.yaml rename to disable/whisper/mongo-claim2-persistentvolumeclaim.yaml diff --git a/whisper/mongo-claim3-persistentvolumeclaim.yaml b/disable/whisper/mongo-claim3-persistentvolumeclaim.yaml similarity index 100% rename from whisper/mongo-claim3-persistentvolumeclaim.yaml rename to disable/whisper/mongo-claim3-persistentvolumeclaim.yaml diff --git a/whisper/mongo-deployment.yaml b/disable/whisper/mongo-deployment.yaml similarity index 100% rename from whisper/mongo-deployment.yaml rename to disable/whisper/mongo-deployment.yaml diff --git a/whisper/mongo-service.yaml b/disable/whisper/mongo-service.yaml similarity index 100% rename from whisper/mongo-service.yaml rename to disable/whisper/mongo-service.yaml diff --git a/whisper/nginx.conf b/disable/whisper/nginx.conf similarity index 100% rename from whisper/nginx.conf rename to disable/whisper/nginx.conf diff --git a/whisper/translate-claim0-persistentvolumeclaim.yaml b/disable/whisper/translate-claim0-persistentvolumeclaim.yaml similarity index 100% rename from whisper/translate-claim0-persistentvolumeclaim.yaml rename to disable/whisper/translate-claim0-persistentvolumeclaim.yaml diff --git a/whisper/translate-claim1-persistentvolumeclaim.yaml b/disable/whisper/translate-claim1-persistentvolumeclaim.yaml similarity index 100% rename from whisper/translate-claim1-persistentvolumeclaim.yaml rename to disable/whisper/translate-claim1-persistentvolumeclaim.yaml diff --git a/whisper/translate-deployment.yaml b/disable/whisper/translate-deployment.yaml similarity index 100% rename from whisper/translate-deployment.yaml rename to disable/whisper/translate-deployment.yaml diff --git a/whisper/translate-service.yaml b/disable/whisper/translate-service.yaml similarity index 100% rename from whisper/translate-service.yaml rename to disable/whisper/translate-service.yaml diff --git a/whisper/whishper-claim0-persistentvolumeclaim.yaml b/disable/whisper/whishper-claim0-persistentvolumeclaim.yaml similarity index 100% rename from whisper/whishper-claim0-persistentvolumeclaim.yaml rename to disable/whisper/whishper-claim0-persistentvolumeclaim.yaml diff --git a/whisper/whishper-claim1-persistentvolumeclaim.yaml b/disable/whisper/whishper-claim1-persistentvolumeclaim.yaml similarity index 100% rename from whisper/whishper-claim1-persistentvolumeclaim.yaml rename to disable/whisper/whishper-claim1-persistentvolumeclaim.yaml diff --git a/whisper/whishper-deployment.yaml b/disable/whisper/whishper-deployment.yaml similarity index 100% rename from whisper/whishper-deployment.yaml rename to disable/whisper/whishper-deployment.yaml diff --git a/whisper/whishper-service.yaml b/disable/whisper/whishper-service.yaml similarity index 100% rename from whisper/whishper-service.yaml rename to disable/whisper/whishper-service.yaml diff --git a/whishper/env-configmap.yaml b/whishper/env-configmap.yaml new file mode 100644 index 0000000..c9d3a79 --- /dev/null +++ b/whishper/env-configmap.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +data: + DB_PASS: whishper + DB_USER: whishper + LT_LOAD_ONLY: es,en,fr,nl + WHISHPER_HOST: http://127.0.0.1:8082 + WHISPER_MODELS: tiny,small,large-v3 +kind: ConfigMap +metadata: + labels: + io.kompose.service: mongo-env + name: env diff --git a/whishper/mongo-claim0-persistentvolumeclaim.yaml b/whishper/mongo-claim0-persistentvolumeclaim.yaml new file mode 100644 index 0000000..b2afd9a --- /dev/null +++ b/whishper/mongo-claim0-persistentvolumeclaim.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + io.kompose.service: mongo-claim0 + name: mongo-claim0 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi diff --git a/whishper/mongo-claim1-persistentvolumeclaim.yaml b/whishper/mongo-claim1-persistentvolumeclaim.yaml new file mode 100644 index 0000000..3f50d80 --- /dev/null +++ b/whishper/mongo-claim1-persistentvolumeclaim.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + io.kompose.service: mongo-claim1 + name: mongo-claim1 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi diff --git a/whishper/mongo-deployment.yaml b/whishper/mongo-deployment.yaml new file mode 100644 index 0000000..5b7d1f5 --- /dev/null +++ b/whishper/mongo-deployment.yaml @@ -0,0 +1,76 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: mongo + name: mongo +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: mongo + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: mongo + spec: + containers: + - args: + - --logpath + - /var/log/mongodb/mongod.log + env: + - name: DB_PASS + valueFrom: + configMapKeyRef: + key: DB_PASS + name: env + - name: DB_USER + valueFrom: + configMapKeyRef: + key: DB_USER + name: env + - name: LT_LOAD_ONLY + valueFrom: + configMapKeyRef: + key: LT_LOAD_ONLY + name: env + - name: MONGO_INITDB_ROOT_PASSWORD + value: whishper + - name: MONGO_INITDB_ROOT_USERNAME + value: whishper + - name: WHISHPER_HOST + valueFrom: + configMapKeyRef: + key: WHISHPER_HOST + name: env + - name: WHISPER_MODELS + valueFrom: + configMapKeyRef: + key: WHISPER_MODELS + name: env + image: mongo + name: mongo + ports: + - containerPort: 27017 + protocol: TCP + volumeMounts: + - mountPath: /data/db + name: mongo-claim0 + - mountPath: /var/log/mongodb + name: mongo-claim1 + restartPolicy: Always + volumes: + - name: mongo-claim0 + persistentVolumeClaim: + claimName: mongo-claim0 + - name: mongo-claim1 + persistentVolumeClaim: + claimName: mongo-claim1 diff --git a/whishper/mongo-service.yaml b/whishper/mongo-service.yaml new file mode 100644 index 0000000..11e7802 --- /dev/null +++ b/whishper/mongo-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: mongo + name: mongo +spec: + ports: + - name: "27017" + port: 27017 + targetPort: 27017 + selector: + io.kompose.service: mongo diff --git a/whishper/translate-claim0-persistentvolumeclaim.yaml b/whishper/translate-claim0-persistentvolumeclaim.yaml new file mode 100644 index 0000000..026dedc --- /dev/null +++ b/whishper/translate-claim0-persistentvolumeclaim.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + io.kompose.service: translate-claim0 + name: translate-claim0 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi diff --git a/whishper/translate-claim1-persistentvolumeclaim.yaml b/whishper/translate-claim1-persistentvolumeclaim.yaml new file mode 100644 index 0000000..52c02c0 --- /dev/null +++ b/whishper/translate-claim1-persistentvolumeclaim.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + io.kompose.service: translate-claim1 + name: translate-claim1 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi diff --git a/whishper/translate-deployment.yaml b/whishper/translate-deployment.yaml new file mode 100644 index 0000000..8f950f2 --- /dev/null +++ b/whishper/translate-deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: translate + name: translate +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: translate + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: translate + spec: + containers: + - env: + - name: DB_PASS + valueFrom: + configMapKeyRef: + key: DB_PASS + name: env + - name: DB_USER + valueFrom: + configMapKeyRef: + key: DB_USER + name: env + - name: LT_DISABLE_WEB_UI + value: "true" + - name: LT_LOAD_ONLY + valueFrom: + configMapKeyRef: + key: LT_LOAD_ONLY + name: env + - name: LT_UPDATE_MODELS + value: "true" + - name: WHISHPER_HOST + valueFrom: + configMapKeyRef: + key: WHISHPER_HOST + name: env + - name: WHISPER_MODELS + valueFrom: + configMapKeyRef: + key: WHISPER_MODELS + name: env + image: libretranslate/libretranslate:latest + livenessProbe: + exec: + command: + - ./venv/bin/python scripts/healthcheck.py + failureThreshold: 5 + periodSeconds: 2 + timeoutSeconds: 3 + name: whisper-libretranslate + ports: + - containerPort: 5000 + protocol: TCP + tty: true + volumeMounts: + - mountPath: /home/libretranslate/.local/share + name: translate-claim0 + - mountPath: /home/libretranslate/.local/cache + name: translate-claim1 + restartPolicy: Always + volumes: + - name: translate-claim0 + persistentVolumeClaim: + claimName: translate-claim0 + - name: translate-claim1 + persistentVolumeClaim: + claimName: translate-claim1 diff --git a/whishper/translate-service.yaml b/whishper/translate-service.yaml new file mode 100644 index 0000000..0225668 --- /dev/null +++ b/whishper/translate-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: translate + name: translate +spec: + ports: + - name: "5000" + port: 5000 + targetPort: 5000 + selector: + io.kompose.service: translate diff --git a/whishper/whishper-claim0-persistentvolumeclaim.yaml b/whishper/whishper-claim0-persistentvolumeclaim.yaml new file mode 100644 index 0000000..082fb08 --- /dev/null +++ b/whishper/whishper-claim0-persistentvolumeclaim.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + io.kompose.service: whishper-claim0 + name: whishper-claim0 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi diff --git a/whishper/whishper-claim1-persistentvolumeclaim.yaml b/whishper/whishper-claim1-persistentvolumeclaim.yaml new file mode 100644 index 0000000..8d67cac --- /dev/null +++ b/whishper/whishper-claim1-persistentvolumeclaim.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + io.kompose.service: whishper-claim1 + name: whishper-claim1 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi diff --git a/whishper/whishper-deployment.yaml b/whishper/whishper-deployment.yaml new file mode 100644 index 0000000..663773c --- /dev/null +++ b/whishper/whishper-deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: whishper + name: whishper +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: whishper + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: whishper + spec: + containers: + - env: + - name: CPU_THREADS + value: "4" + - name: DB_PASS + valueFrom: + configMapKeyRef: + key: DB_PASS + name: env + - name: DB_USER + valueFrom: + configMapKeyRef: + key: DB_USER + name: env + - name: LT_LOAD_ONLY + valueFrom: + configMapKeyRef: + key: LT_LOAD_ONLY + name: env + - name: PUBLIC_API_HOST + - name: PUBLIC_INTERNAL_API_HOST + value: http://127.0.0.1:80 + - name: PUBLIC_TRANSLATION_API_HOST + - name: PUBLIC_WHISHPER_PROFILE + value: cpu + - name: UPLOAD_DIR + value: /app/uploads + - name: WHISHPER_HOST + valueFrom: + configMapKeyRef: + key: WHISHPER_HOST + name: env + - name: WHISPER_MODELS + valueFrom: + configMapKeyRef: + key: WHISPER_MODELS + name: env + - name: WHISPER_MODELS_DIR + value: /app/models + image: pluja/whishper:latest + name: whishper + ports: + - containerPort: 80 + protocol: TCP + volumeMounts: + - mountPath: /app/uploads + name: whishper-claim0 + - mountPath: /var/log/whishper + name: whishper-claim1 + restartPolicy: Always + volumes: + - name: whishper-claim0 + persistentVolumeClaim: + claimName: whishper-claim0 + - name: whishper-claim1 + persistentVolumeClaim: + claimName: whishper-claim1 diff --git a/whishper/whishper-ingress.yaml b/whishper/whishper-ingress.yaml new file mode 100644 index 0000000..b9b7a83 --- /dev/null +++ b/whishper/whishper-ingress.yaml @@ -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/proxy-body-size: "0" + # 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: whishper + port: + number: 8082 + + # TLS configuration for HTTPS + tls: + # TLS secretName used on ClusterIssuer + - secretName: letsencrypt-prod + hosts: + - alv.hensen.io diff --git a/whishper/whishper-service.yaml b/whishper/whishper-service.yaml new file mode 100644 index 0000000..b4cda44 --- /dev/null +++ b/whishper/whishper-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.34.0 (cbf2835db) + labels: + io.kompose.service: whishper + name: whishper +spec: + ports: + - name: "8082" + port: 8082 + targetPort: 80 + selector: + io.kompose.service: whishper