apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    description: LSP server for JavaScript and TypeScript (used for live requests).
  labels:
    deploy: xlang-typescript
  name: xlang-typescript
spec:
  minReadySeconds: 10
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: xlang-typescript
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: xlang-typescript
    spec:
      containers:
      - env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: CACHE_DIR
          value: /mnt/cache/$(POD_NAME)
        image: sourcegraph/xlang-javascript-typescript:00081_2018-07-20_09dabb1@sha256:4ae9a6b4f57c6c82fc7bce974a1d007a635c314b386640993af01b39779fa4cc
        livenessProbe:
          initialDelaySeconds: 30
          tcpSocket:
            port: lsp
          timeoutSeconds: 5
        name: xlang-typescript
        ports:
        - containerPort: 2088
          name: lsp
        readinessProbe:
          tcpSocket:
            port: lsp
        resources:
          limits:
            cpu: "4"
            memory: 5Gi
          requests:
            cpu: 500m
            memory: 2Gi
        volumeMounts:
        - mountPath: /yarn-config
          name: yarn-config
        - mountPath: /mnt/cache
          name: cache-ssd
      securityContext:
        runAsUser: 0
      volumes:
      # See ../../docs/configure.md for more information about how to increase the
      # performance of this deployment by using an SSD.
      - emptyDir: {}
        name: cache-ssd
      - configMap:
          name: yarn-config
        name: yarn-config
