|
| 1 | +{{- if .Values.syntacticCodeIntel.enabled -}} |
| 2 | +apiVersion: apps/v1 |
| 3 | +kind: Deployment |
| 4 | +metadata: |
| 5 | + annotations: |
| 6 | + description: Handles syntactic code intelligence indexing |
| 7 | + labels: |
| 8 | + {{- include "sourcegraph.labels" . | nindent 4 }} |
| 9 | + {{- if .Values.syntacticCodeIntel.labels }} |
| 10 | + {{- toYaml .Values.syntacticCodeIntel.labels | nindent 4 }} |
| 11 | + {{- end }} |
| 12 | + deploy: sourcegraph |
| 13 | + app.kubernetes.io/component: syntactic-code-intel |
| 14 | + name: {{ .Values.syntacticCodeIntel.name }} |
| 15 | +spec: |
| 16 | + minReadySeconds: 10 |
| 17 | + replicas: {{ .Values.syntacticCodeIntel.replicaCount }} |
| 18 | + revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }} |
| 19 | + selector: |
| 20 | + matchLabels: |
| 21 | + {{- include "sourcegraph.selectorLabels" . | nindent 6 }} |
| 22 | + app: syntactic-code-intel-worker |
| 23 | + strategy: |
| 24 | + rollingUpdate: |
| 25 | + maxSurge: 1 |
| 26 | + maxUnavailable: 1 |
| 27 | + type: RollingUpdate |
| 28 | + template: |
| 29 | + metadata: |
| 30 | + annotations: |
| 31 | + kubectl.kubernetes.io/default-container: syntactic-code-intel-worker |
| 32 | + {{- if .Values.sourcegraph.podAnnotations }} |
| 33 | + {{- toYaml .Values.sourcegraph.podAnnotations | nindent 8 }} |
| 34 | + {{- end }} |
| 35 | + {{- if .Values.syntacticCodeIntel.podAnnotations }} |
| 36 | + {{- toYaml .Values.syntacticCodeIntel.podAnnotations | nindent 8 }} |
| 37 | + {{- end }} |
| 38 | + labels: |
| 39 | + {{- include "sourcegraph.selectorLabels" . | nindent 8 }} |
| 40 | + {{- if .Values.sourcegraph.podLabels }} |
| 41 | + {{- toYaml .Values.sourcegraph.podLabels | nindent 8 }} |
| 42 | + {{- end }} |
| 43 | + {{- if .Values.syntacticCodeIntel.podLabels }} |
| 44 | + {{- toYaml .Values.syntacticCodeIntel.podLabels | nindent 8 }} |
| 45 | + {{- end }} |
| 46 | + deploy: sourcegraph |
| 47 | + app: syntactic-code-intel-worker |
| 48 | + spec: |
| 49 | + containers: |
| 50 | + - name: syntactic-code-intel-worker |
| 51 | + env: |
| 52 | + {{- range $name, $item := .Values.syntacticCodeIntel.env}} |
| 53 | + - name: {{ $name }} |
| 54 | + {{- $item | toYaml | nindent 10 }} |
| 55 | + {{- end }} |
| 56 | + - name: POD_NAME |
| 57 | + valueFrom: |
| 58 | + fieldRef: |
| 59 | + fieldPath: metadata.name |
| 60 | + {{- if .Values.blobstore.enabled }} |
| 61 | + - name: SYNTACTIC_CODE_INTEL_UPLOAD_BACKEND |
| 62 | + value: blobstore |
| 63 | + - name: SYNTACTIC_CODE_INTEL_UPLOAD_AWS_ENDPOINT |
| 64 | + value: http://blobstore:9000 |
| 65 | + - name: SYNTACTIC_CODE_INTEL_WORKER_ADDR |
| 66 | + value: ":{{ .Values.syntacticCodeIntel.properties.workerPort }}" |
| 67 | + {{- end }} |
| 68 | + {{- include "sourcegraph.openTelemetryEnv" . | nindent 8 }} |
| 69 | + image: {{ include "sourcegraph.image" (list . "syntacticCodeIntel") }} |
| 70 | + imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }} |
| 71 | + {{- with .Values.syntacticCodeIntel.args }} |
| 72 | + args: |
| 73 | + {{- toYaml . | nindent 8 }} |
| 74 | + {{- end }} |
| 75 | + terminationMessagePolicy: FallbackToLogsOnError |
| 76 | + livenessProbe: |
| 77 | + httpGet: |
| 78 | + path: /healthz |
| 79 | + port: http |
| 80 | + scheme: HTTP |
| 81 | + initialDelaySeconds: 60 |
| 82 | + timeoutSeconds: 5 |
| 83 | + readinessProbe: |
| 84 | + httpGet: |
| 85 | + path: /ready |
| 86 | + port: debug |
| 87 | + scheme: HTTP |
| 88 | + periodSeconds: 5 |
| 89 | + timeoutSeconds: 5 |
| 90 | + ports: |
| 91 | + - containerPort: {{ .Values.syntacticCodeIntel.properties.workerPort }} |
| 92 | + name: http |
| 93 | + - containerPort: 6060 |
| 94 | + name: debug |
| 95 | + {{- if not .Values.sourcegraph.localDevMode }} |
| 96 | + resources: |
| 97 | + {{- toYaml .Values.syntacticCodeIntel.resources | nindent 10 }} |
| 98 | + {{- end }} |
| 99 | + securityContext: |
| 100 | + {{- toYaml .Values.syntacticCodeIntel.containerSecurityContext | nindent 10 }} |
| 101 | + volumeMounts: |
| 102 | + - mountPath: /tmp |
| 103 | + name: tmpdir |
| 104 | + {{- if .Values.syntacticCodeIntel.extraVolumeMounts }} |
| 105 | + {{- toYaml .Values.syntacticCodeIntel.extraVolumeMounts | nindent 8 }} |
| 106 | + {{- end }} |
| 107 | + {{- if .Values.syntacticCodeIntel.extraContainers }} |
| 108 | + {{- toYaml .Values.syntacticCodeIntel.extraContainers | nindent 6 }} |
| 109 | + {{- end }} |
| 110 | + securityContext: |
| 111 | + {{- toYaml .Values.syntacticCodeIntel.podSecurityContext | nindent 8 }} |
| 112 | + {{- include "sourcegraph.nodeSelector" (list . "syntacticCodeIntel" ) | trim | nindent 6 }} |
| 113 | + {{- include "sourcegraph.affinity" (list . "syntacticCodeIntel" ) | trim | nindent 6 }} |
| 114 | + {{- include "sourcegraph.tolerations" (list . "syntacticCodeIntel" ) | trim | nindent 6 }} |
| 115 | + {{- with .Values.sourcegraph.imagePullSecrets }} |
| 116 | + imagePullSecrets: |
| 117 | + {{- toYaml . | nindent 8 }} |
| 118 | + {{- end }} |
| 119 | + {{- include "sourcegraph.renderServiceAccountName" (list . "syntacticCodeIntel") | trim | nindent 6 }} |
| 120 | + volumes: |
| 121 | + - emptyDir: {} |
| 122 | + name: tmpdir |
| 123 | + {{- if .Values.syntacticCodeIntel.extraVolumes }} |
| 124 | + {{- toYaml .Values.syntacticCodeIntel.extraVolumes | nindent 6 }} |
| 125 | + {{- end }} |
| 126 | +{{- end }} |
0 commit comments