-
Notifications
You must be signed in to change notification settings - Fork 67.2k
Expand file tree
/
Copy pathwebapp.yaml
More file actions
86 lines (86 loc) · 3.03 KB
/
webapp.yaml
File metadata and controls
86 lines (86 loc) · 3.03 KB
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp
annotations:
moda.github.net/inject-unified-service-tag-env-var: docs-internal
spec:
replicas: 1
selector:
matchLabels:
app: webapp
template:
metadata:
labels:
app: webapp
annotations:
# Our internal logs aren't structured so we use logfmt_sloppy to just log stdout and error
# See https://thehub.github.com/epd/engineering/dev-practicals/observability/logging/ for more details
fluentbit.io/parser: logfmt_sloppy
observability.github.com/splunk_index: docs-internal
ad.datadoghq.com/webapp.logs: '[{"source":"nodejs","service":"docs-internal","tags":["env:staging"]}]'
ad.datadoghq.com/tolerate-unready: 'true'
spec:
dnsPolicy: Default
terminationGracePeriodSeconds: 60
containers:
- name: webapp
image: docs-internal
resources:
requests:
cpu: 1000m
# Absolute minimum to start app is 1000m
# Node is single-threaded but we want more CPUs
# for OS and image resizing, and other binary executions
# Better to increase replicas or memory than CPU
memory: 8.0Gi
# Absolute minimum to start app is 4500Mi
# Would increase with more pages, versions, or languages supported
limits:
cpu: 8000m
memory: 8.0Gi
ports:
- name: http
containerPort: 4000
protocol: TCP
envFrom:
- secretRef:
name: vault-secrets
- configMapRef:
name: kube-cluster-metadata
# application-config is created at deploy time from
# configuration set in config/moda/configuration/*/env.yaml
- configMapRef:
name: application-config
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
# Zero-downtime deploys
# https://thehub.github.com/engineering/products-and-services/internal/moda/feature-documentation/pod-lifecycle/#required-prestop-hook
# https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
lifecycle:
preStop:
exec:
command: ['sleep', '5']
# See production/deployments/webapp.yaml for detailed comments on probe config.
startupProbe:
httpGet:
path: /healthcheck
port: http
initialDelaySeconds: 30
periodSeconds: 5
failureThreshold: 30
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /healthcheck
port: http
periodSeconds: 10
failureThreshold: 5
timeoutSeconds: 5