forked from khteh/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbiz4x-backend.yml
118 lines (118 loc) · 3.33 KB
/
biz4x-backend.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: biz4x-backend
labels:
app: biz4x-backend
component: biz4x
spec:
serviceName: svc-biz4xbackend
podManagementPolicy: "Parallel" # Default is OrderedReady
replicas: 2 # Default is 1
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
app: biz4x-backend # Has to match .spec.template.metadata.labels
component: biz4x
template:
metadata:
labels:
app: biz4x-backend # Has to match .spec.selector.matchLabels
component: biz4x
spec:
terminationGracePeriodSeconds: 10
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- biz4x-backend
topologyKey: "kubernetes.io/hostname"
containers:
- name: biz4x-backend
image: 699575179986.dkr.ecr.ap-southeast-1.amazonaws.com/biz4x-backend:latest
imagePullPolicy: Always
env:
- name: ASPNETCORE_ENVIRONMENT
value: Production
- name: ASPNETCORE_URLS
value: "http://0.0.0.0:5002"
- name: COMPlus_ThreadPool_ForceMinWorkerThreads
value: "1000"
- name: COMPlus_ThreadPool_ForceMaxWorkerThreads
value: "10000"
ports:
- containerPort: 5002
name: http
protocol: TCP
# hostPort: 8081
- containerPort: 443
name: https
protocol: TCP
# hostPort: 8082
readinessProbe:
httpGet:
path: /health/ready
port: http
initialDelaySeconds: 60
periodSeconds: 5
timeoutSeconds: 10
failureThreshold: 3
successThreshold: 1
livenessProbe:
httpGet:
path: /health/live
port: http
initialDelaySeconds: 60
periodSeconds: 3
timeoutSeconds: 10
failureThreshold: 3
successThreshold: 1
volumeMounts:
- name: biz4x-secret
mountPath: /app/appsettings.secret.json
subPath: appsettings.secret.json
readOnly: true
- name: log
mountPath: /var/log/aspnetcore
# resources:
# limits:
# cpu: 500m
# memory: 1024Mi
- name: fluentd
image: khteh/fluentd:latest
env:
- name: FLUENTD_ARGS
value: -c /etc/td-agent/td-agent.conf
volumeMounts:
- name: log
mountPath: /var/log/aspnetcore
- name: fluentd-biz4x-be-config
mountPath: /etc/td-agent
- name: access-log-template
mountPath: /tmp/access_log_template.json
subPath: access_log_template.json
readOnly: true
resources:
limits:
cpu: 250m
memory: 1024Mi
volumes:
- name: biz4x-secret
secret:
secretName: biz4x-secret
items:
- key: biz4x-secret.json
path: appsettings.secret.json
- name: fluentd-biz4x-be-config
configMap:
name: fluentd-biz4x-be-config
- name: access-log-template
configMap:
name: access-log-template
- name: log
emptyDir: {}