apiVersion: apps/v1
kind: Deployment
metadata:
  name: webapp
  namespace: application
  labels:
    app: webapp
    tier: frontend
spec:
  replicas: 2
  selector:
    matchLabels:
      app: webapp
  template:
    metadata:
      labels:
        app: webapp
      annotations:
        container.seccomp.security.alpha.kubernetes.io/webapp: runtime/default
    spec:
      containers:
        - name: webapp
          image: ghcr.io/czarsimon/tactics-trainer/webapp:0.8.0
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
          resources:
            requests:
              memory: 200Mi
              cpu: 100m
            limits:
              memory: 200Gi
              cpu: 500m
          livenessProbe:
            httpGet:
              path: /health
              port: 8080
            initialDelaySeconds: 30
            periodSeconds: 5
            timeoutSeconds: 2
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /health
              port: 8080
            initialDelaySeconds: 20
            periodSeconds: 5
            timeoutSeconds: 2
            successThreshold: 1
            failureThreshold: 3
          securityContext:
            seccompProfile:
              type: RuntimeDefault
            allowPrivilegeEscalation: false
            capabilities:
              drop: ['ALL']
            runAsNonRoot: true
            readOnlyRootFilesystem: false
            runAsUser: 10001
            runAsGroup: 10001
