apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    description: Backend for symbols operations.
  labels:
    deploy: sourcegraph
  name: symbols
spec:
  minReadySeconds: 10
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: symbols
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: symbols
    spec:
      containers:
      - env:
        - name: SOURCEGRAPH_CONFIG_FILE
          value: /etc/sourcegraph/config.json
        - name: SRC_GIT_SERVERS
          value: gitserver-0.gitserver:3178
        - name: SYMBOLS_CACHE_SIZE_MB
          value: "100000"
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: CACHE_DIR
          value: /mnt/cache/$(POD_NAME)
        image: sourcegraph/symbols:2.11.2@sha256:72208735c8a4c03e9e9025cbb4fb98b4af6480e2301abf5e3bd57375d571577e
        name: symbols
        ports:
        - containerPort: 3184
          name: http
        - containerPort: 6060
          name: debug
        resources:
          limits:
            cpu: "2"
            memory: 2G
          requests:
            cpu: 500m
            memory: 500M
        volumeMounts:
        - mountPath: /etc/sourcegraph
          name: sg-config
        - mountPath: /mnt/cache
          name: cache-ssd
      securityContext:
        runAsUser: 0
      volumes:
      - configMap:
          defaultMode: 464
          name: config-file
        name: sg-config
      - emptyDir: {}
        name: cache-ssd
