forked from LibreTranslate/LibreTranslate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s.yaml
84 lines (83 loc) · 1.83 KB
/
k8s.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# kubernetes deployment template
# prepare a namespace on your cluster first like libretranslate-prod
apiVersion: v1
kind: ConfigMap
metadata:
name: libretranslate-config
data:
# list loaded languages or leave empty to load all
langs: "es,de,it,en,fr,cs,da,nl,hu,pl,pt,sk,ru,tr,uk,fi,eo"
ltapikey: "yoursecretapikey"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: libretranslate
spec:
selector:
matchLabels:
app: libretranslate
template:
metadata:
labels:
app: libretranslate
spec:
containers:
- name: libretranslate
image: libretranslate/libretranslate:latest
resources:
limits:
memory: "1Gi"
cpu: "500m"
ports:
- containerPort: 5000
env:
- name: "LT_LOAD_ONLY"
valueFrom:
configMapKeyRef:
name: libretranslate-config
key: langs
- name: "TRANSLATE_KEY"
valueFrom:
configMapKeyRef:
name: libretranslate-config
key: ltapikey
---
apiVersion: v1
kind: Service
metadata:
name: libretranslate-svc
namespace: libretranslate-prod
spec:
selector:
app: libretranslate
ports:
- port: 5000
targetPort: 5000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
cert-manager.io/issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/proxy-body-size: 5m
name: libretranslate-ingress
namespace: libretranslate-prod
labels:
app: libretranslate
spec:
tls:
- hosts:
- libretranslate.mydomain.net
secretName: libretranslate-mydomain-net
rules:
- host: libretranslate.mydomain.net
http:
paths:
- backend:
service:
name: libretranslate-svc
port:
number: 5000
path: /
pathType: Prefix