apiVersion: apps/v1
kind: Deployment
metadata:
  name: apiserver
  namespace: system
  labels:
    control-plane: apiserver
spec:
  selector:
    matchLabels:
      control-plane: apiserver
  replicas: 1
  template:
    metadata:
      annotations:
        kubectl.kubernetes.io/default-container: apiserver
      labels:
        control-plane: apiserver
    spec:
      securityContext:
        runAsNonRoot: true
      containers:
        - image: apiserver:latest
          name: apiserver
          securityContext:
            allowPrivilegeEscalation: false
          livenessProbe:
            httpGet:
              path: /apidocs.json
              port: 8000
            initialDelaySeconds: 15
            periodSeconds: 20
          readinessProbe:
            httpGet:
              path: /apidocs.json
              port: 8000
            initialDelaySeconds: 5
            periodSeconds: 10
          # TODO(user): Configure the resources accordingly based on the project requirements.
          # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
          resources:
            limits:
              cpu: 500m
              memory: 128Mi
            requests:
              cpu: 10m
              memory: 64Mi
      serviceAccountName: controller-manager
      terminationGracePeriodSeconds: 10
