-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathaspnetcorewebapi.yml
162 lines (162 loc) · 5.3 KB
/
aspnetcorewebapi.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: aspnetcorewebapi
labels:
app: aspnetcorewebapi
component: aspnetcorewebapi
spec:
serviceName: svc-aspnetcorewebapi
podManagementPolicy: Parallel # Default is OrderedReady
replicas: 2 # Default is 1
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
app: aspnetcorewebapi # Has to match .spec.template.metadata.labels
component: aspnetcorewebapi
template:
metadata:
labels:
app: aspnetcorewebapi # Has to match .spec.selector.matchLabels
component: aspnetcorewebapi
spec:
terminationGracePeriodSeconds: 10
# affinity:
# podAntiAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# - labelSelector:
# matchExpressions:
# - key: app
# operator: In
# values:
# - aspnetcorewebapi
# topologyKey: "kubernetes.io/hostname"
containers:
- name: aspnetcorewebapi
image: khteh/asp.netcorewebapi:latest
imagePullPolicy: Always
env:
- name: ASPNETCORE_ENVIRONMENT
value: Production
- name: ASPNETCORE_URLS
value: "https://+;http://+"
- name: ASPNETCORE_HTTPS_PORT
value: "443"
- name: ASPNETCORE_FORWARDEDHEADERS_ENABLED
value: "true"
# This is enabled for Dynamic PGO
- name: DOTNET_TieredPGO
value: "1"
# The following 2 are enabled for Full PGO. This will result in longer startup time
- name: DOTNET_TC_QuickJitForLoops
value: "1"
- name: DOTNET_ReadyToRun
value: "0"
- name: COMPlus_ThreadPool_ForceMinWorkerThreads
value: "1000"
- name: COMPlus_ThreadPool_ForceMaxWorkerThreads
value: "10000"
- name: PATH_BASE
value: "/"
ports:
- containerPort: 80
name: http
protocol: TCP
- containerPort: 443
name: https
protocol: TCP
readinessProbe:
httpGet:
path: /health/ready
port: https
scheme: HTTPS
initialDelaySeconds: 20
periodSeconds: 5
timeoutSeconds: 10
failureThreshold: 3
successThreshold: 1
livenessProbe:
httpGet:
path: /health/live
port: https
scheme: HTTPS
initialDelaySeconds: 20
periodSeconds: 3
timeoutSeconds: 10
failureThreshold: 3
successThreshold: 1
volumeMounts:
- name: email-credentials
mountPath: /app/appsettings.email.json
subPath: appsettings.email.json
readOnly: true
- name: appsettings-staging
mountPath: /app/appsettings.Staging.json
subPath: appsettings.Staging.json
readOnly: true
- name: appsettings-production
mountPath: /app/appsettings.Production.json
subPath: appsettings.Production.json
readOnly: true
- name: postgresql-connection
mountPath: /app/appsettings.postgresql.json
subPath: appsettings.postgresql.json
readOnly: true
- name: log
mountPath: /var/log/aspnetcore
resources:
limits:
cpu: 500m
memory: 2Gi
- name: fluentd
image: khteh/fluentd:latest
volumeMounts:
- name: log
mountPath: /var/log/aspnetcore
- name: fluentd-config
mountPath: /etc/td-agent
- name: access-log-template
mountPath: /tmp/access_log_template.json
subPath: access_log_template.json
readOnly: true
- mountPath: /fluentd/elastic/tls.crt
name: elasticsearch-ca
subPath: tls.crt
readOnly: true
resources:
limits:
cpu: 500m
memory: 2Gi
volumes:
- name: email-credentials
secret:
secretName: email-credentials
items:
- key: appsettings.email.json
path: appsettings.email.json
- name: appsettings-staging
configMap:
name: appsettings-staging
- name: appsettings-production
configMap:
name: appsettings-production
- name: postgresql-connection
secret:
secretName: aspnetcorewebapi
items:
- key: aspnetcorewebapi.postgresql.json
path: appsettings.postgresql.json
- name: fluentd-config
configMap:
name: fluentd-config
- name: access-log-template
configMap:
name: access-log-template
- name: log
emptyDir: {}
- name: elasticsearch-ca
secret:
defaultMode: 420
optional: false
secretName: elasticsearch-eck-ca # This is the secret that holds the Elasticsearch CA cert