-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s.yml
executable file
·80 lines (80 loc) · 1.76 KB
/
k8s.yml
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
kind: Deployment
apiVersion: apps/v1
metadata:
name: $SLUG
labels:
app: $SLUG
spec:
replicas: 1
selector:
matchLabels:
app: $SLUG
template:
metadata:
annotations:
linkerd.io/inject: enabled
labels:
app: $SLUG
spec:
containers:
- name: $SLUG
image: $AWS_ECR_URL/$SLUG:latest
imagePullPolicy: Always
livenessProbe:
tcpSocket:
port: $PORT
initialDelaySeconds: 30
readinessProbe:
tcpSocket:
port: $PORT
initialDelaySeconds: 30
resources:
limits:
memory: $MEMORY_LIMIT
requests:
memory: $MEMORY_REQUESTS
ports:
- containerPort: $PORT
name: $SLUG
envFrom:
- configMapRef:
name: $SLUG-config
- secretRef:
name: $SLUG-secrets
---
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: $SLUG-ingress
namespace: $NAMESPACE
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/limit-connections: "500"
nginx.ingress.kubernetes.io/limit-rps: "500"
nginx.ingress.kubernetes.io/load-balance: ewma
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
ingressClassName: nginx
rules:
- host: $HOST
http:
paths:
- backend:
service:
name: $SLUG
port:
number: $PORT
path: /$CONTEXT(/*)(.*)
pathType: ImplementationSpecific
---
kind: Service
apiVersion: v1
metadata:
name: $SLUG
spec:
selector:
app: $SLUG
ports:
- protocol: TCP
port: $PORT
targetPort: $PORT