apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    description: Multiplexer between frontend and LSP servers.
  labels:
    deploy: sourcegraph
  name: lsp-proxy
spec:
  minReadySeconds: 10
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: lsp-proxy
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: lsp-proxy
    spec:
      containers:
      - args:
        - -addr=:4388
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: CACHE_DIR
          value: /mnt/cache/$(POD_NAME)
        image: sourcegraph/lsp-proxy:3.0.0-alpha.4@sha256:016b495506b1eddfe2f81368ac47708f7ce7b455fd47ee9fad34ee575b5beb72
        livenessProbe:
          initialDelaySeconds: 5
          tcpSocket:
            port: lsp
          timeoutSeconds: 5
        name: lsp-proxy
        ports:
        - containerPort: 4388
          name: lsp
        - containerPort: 6060
          name: debug
        readinessProbe:
          tcpSocket:
            port: 4388
        resources:
          limits:
            cpu: "1"
            memory: 8Gi
          requests:
            cpu: 500m
            memory: 2Gi
        volumeMounts:
        - mountPath: /mnt/cache
          name: cache-ssd
      securityContext:
        runAsUser: 0
      volumes:
      - emptyDir: {}
        name: cache-ssd
