apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: lieutenant-api
    app.kubernetes.io/part-of: project-syn
  name: lieutenant-api
  namespace: lieutenant
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: lieutenant-api
      app.kubernetes.io/part-of: project-syn
  template:
    metadata:
      labels:
        app.kubernetes.io/name: lieutenant-api
        app.kubernetes.io/part-of: project-syn
    spec:
      containers:
        - command:
            - lieutenant-api
          env:
            - name: NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: LIEUTENANT_INSTANCE
              value: lieutenant
            - name: STEWARD_IMAGE
              value: docker.io/projectsyn/steward:v0.6.0
            - name: DEFAULT_API_SECRET_REF_NAME
              value: gitlab-com
          image: docker.io/projectsyn/lieutenant-api:v0.8.0
          imagePullPolicy: Always
          livenessProbe:
            httpGet:
              path: /healthz
              port: http
            initialDelaySeconds: 60
          name: lieutenant-api
          ports:
            - containerPort: 8080
              name: http
          readinessProbe:
            httpGet:
              path: /healthz
              port: http
          resources:
            limits:
              cpu: 500m
              memory: 128Mi
            requests:
              cpu: 200m
              memory: 64Mi
          securityContext:
            readOnlyRootFilesystem: true
            runAsNonRoot: true
      serviceAccountName: lieutenant-api
