1
0
mirror of synced 2025-12-19 09:57:42 -05:00
Files
docs/config/kubernetes/production/deployments/webapp.yaml
Jenni C 0b02439cea tented 0008 (#58814)
Co-authored-by: sunbrye <sunbrye@github.com>
Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
2025-12-11 19:20:55 +00:00

67 lines
2.5 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp
annotations:
moda.github.net/allow-missing-ready-pods: '1'
spec:
replicas: 6
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
spec:
dnsPolicy: Default
containers:
- name: webapp
image: docs-internal
resources:
requests:
cpu: 2500m
# 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: 6.0Gi
# Absolute minimum to start app is 4500Mi
# Would increase with more pages, versions, or languages supported
# The additional memory helps during traffic surges
limits:
cpu: 16000m
memory: 16Gi
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
# 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']
readinessProbe:
initialDelaySeconds: 5
httpGet:
# WARNING: This should be updated to a meaningful endpoint for your application which will return a 200 once the app is fully started.
# See: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes
path: /healthcheck
port: http