-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.yaml
267 lines (265 loc) · 12.2 KB
/
nginx.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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
---
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: nginx
labels:
app.kubernetes.io/instance: nginx
app.kubernetes.io/name: nginx
spec:
podSelector:
matchLabels:
app.kubernetes.io/instance: nginx
app.kubernetes.io/name: nginx
policyTypes:
- Ingress
- Egress
egress:
- {}
ingress:
- ports:
- port: 8080
- port: 9113
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: nginx
labels:
app.kubernetes.io/instance: nginx
app.kubernetes.io/name: nginx
automountServiceAccountToken: false
---
apiVersion: v1
kind: Secret
metadata:
name: nginx-tls
labels:
app.kubernetes.io/instance: nginx
app.kubernetes.io/name: nginx
type: kubernetes.io/tls
data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURaVENDQWsyZ0F3SUJBZ0lSQUtWK1h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LS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
---
apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
app.kubernetes.io/instance: nginx
app.kubernetes.io/name: nginx
annotations:
prometheus.io/port: '9113'
prometheus.io/scrape: "true"
spec:
type: LoadBalancer
sessionAffinity: None
externalTrafficPolicy: "Cluster"
ports:
- name: http
port: 80
targetPort: http
- name: metrics
port: 9113
targetPort: metrics
selector:
app.kubernetes.io/instance: nginx
app.kubernetes.io/name: nginx
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app.kubernetes.io/instance: nginx
app.kubernetes.io/name: nginx
spec:
replicas: 1
revisionHistoryLimit: 10
strategy:
rollingUpdate: {}
type: RollingUpdate
selector:
matchLabels:
app.kubernetes.io/instance: nginx
app.kubernetes.io/name: nginx
template:
metadata:
labels:
app.kubernetes.io/instance: nginx
app.kubernetes.io/name: nginx
spec:
shareProcessNamespace: false
serviceAccountName: nginx
automountServiceAccountToken: false
affinity:
podAffinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/instance: nginx
app.kubernetes.io/name: nginx
topologyKey: kubernetes.io/hostname
weight: 1
nodeAffinity:
hostNetwork: false
hostIPC: false
securityContext:
fsGroup: 1001
fsGroupChangePolicy: Always
supplementalGroups: []
sysctls: []
initContainers:
- name: preserve-logs-symlinks
image: docker.io/bitnami/nginx:1.25.5-debian-12-r0
imagePullPolicy: "IfNotPresent"
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsGroup: 1001
runAsNonRoot: true
runAsUser: 1001
seLinuxOptions: null
seccompProfile:
type: RuntimeDefault
resources:
limits:
cpu: 150m
ephemeral-storage: 1024Mi
memory: 192Mi
requests:
cpu: 100m
ephemeral-storage: 50Mi
memory: 128Mi
command:
- /bin/bash
args:
- -ec
- |
#!/bin/bash
. /opt/bitnami/scripts/libfs.sh
# We copy the logs folder because it has symlinks to stdout and stderr
if ! is_dir_empty /opt/bitnami/nginx/logs; then
cp -r /opt/bitnami/nginx/logs /emptydir/app-logs-dir
fi
volumeMounts:
- name: empty-dir
mountPath: /emptydir
containers:
- name: nginx
image: docker.io/bitnami/nginx:1.25.5-debian-12-r0
imagePullPolicy: "IfNotPresent"
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsGroup: 1001
runAsNonRoot: true
runAsUser: 1001
seLinuxOptions: null
seccompProfile:
type: RuntimeDefault
env:
- name: BITNAMI_DEBUG
value: "false"
- name: NGINX_HTTP_PORT_NUMBER
value: "8080"
ports:
- name: http
containerPort: 8080
livenessProbe:
failureThreshold: 6
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
tcpSocket:
port: http
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
tcpSocket:
port: http
resources:
limits:
cpu: 150m
ephemeral-storage: 1024Mi
memory: 192Mi
requests:
cpu: 100m
ephemeral-storage: 50Mi
memory: 128Mi
volumeMounts:
- name: empty-dir
mountPath: /tmp
subPath: tmp-dir
- name: empty-dir
mountPath: /opt/bitnami/nginx/conf
subPath: app-conf-dir
- name: empty-dir
mountPath: /opt/bitnami/nginx/logs
subPath: app-logs-dir
- name: empty-dir
mountPath: /opt/bitnami/nginx/tmp
subPath: app-tmp-dir
- name: certificate
mountPath: /certs
- name: metrics
image: docker.io/bitnami/nginx-exporter:1.1.0-debian-12-r11
imagePullPolicy: "IfNotPresent"
command:
- exporter
args:
- --nginx.scrape-uri
- "http://127.0.0.1:8080/status"
- --web.listen-address
- ":9113"
ports:
- name: metrics
containerPort: 9113
livenessProbe:
httpGet:
path: /metrics
port: metrics
initialDelaySeconds: 15
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /metrics
port: metrics
initialDelaySeconds: 5
timeoutSeconds: 1
resources:
limits:
cpu: 150m
ephemeral-storage: 1024Mi
memory: 192Mi
requests:
cpu: 100m
ephemeral-storage: 50Mi
memory: 128Mi
volumes:
- name: empty-dir
emptyDir: {}
- name: certificate
secret:
secretName: nginx-tls
items:
- key: tls.crt
path: server.crt
- key: tls.key
path: server.key