apiVersion: apps/v1
kind: Deployment
metadata:
  name: example-app
  labels:
    app: example
    tier: backend
spec:
  replicas: 3
  selector:
    matchLabels:
      app: example
  template:
    metadata:
      labels:
        app: example
        tier: backend
    spec:
      containers:
        - name: app
          image: example/app:1.0.0
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
              name: http
          env:
            - name: LOG_LEVEL
              value: info
            - name: DB_HOST
              value: db.example.com
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: 500m
              memory: 256Mi
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8080
            initialDelaySeconds: 10
            periodSeconds: 5
