apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    description: Management console for critical Sourcegraph configuration.
  labels:
    deploy: sourcegraph
  name: management-console
spec:
  minReadySeconds: 10
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: management-console
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: management-console
    spec:
      containers:
      - env:
        - name: PGDATABASE
          value: sg
        - name: PGHOST
          value: pgsql
        - name: PGPORT
          value: "5432"
        - name: PGSSLMODE
          value: disable
        - name: PGUSER
          value: sg
        image: index.docker.io/sourcegraph/management-console:3.9.1@sha256:0fd4fe5017a00b090307dab6442ce94883e6f9d006d734b6ef49cd02aadb992e
        terminationMessagePolicy: FallbackToLogsOnError
        name: management-console
        ports:
        - containerPort: 2633
          name: https
        - containerPort: 6060
          name: debug
        readinessProbe:
          tcpSocket:
            port: 2633
        resources:
          limits:
            cpu: "1"
            memory: 512Mi
          requests:
            cpu: 100m
            memory: 500Mi
        volumeMounts:
        - mountPath: /etc/sourcegraph
          name: disk
      securityContext:
        runAsUser: 0
      volumes:
      - name: disk
        persistentVolumeClaim:
          claimName: management-console
