From 1a7734b1839af838144251d8bd7ae0e98084b567 Mon Sep 17 00:00:00 2001 From: Jacob Pleiness Date: Tue, 18 Feb 2025 16:05:36 -0500 Subject: [PATCH] feat(rel): add syntactic code intel worker service --- base/sourcegraph/kustomization.yaml | 1 + .../syntactic-code-intel/kustomization.yaml | 5 ++ .../worker.Deployment.yaml | 77 +++++++++++++++++++ .../syntactic-code-intel/worker.Service.yaml | 23 ++++++ 4 files changed, 106 insertions(+) create mode 100644 base/sourcegraph/syntactic-code-intel/kustomization.yaml create mode 100644 base/sourcegraph/syntactic-code-intel/worker.Deployment.yaml create mode 100644 base/sourcegraph/syntactic-code-intel/worker.Service.yaml diff --git a/base/sourcegraph/kustomization.yaml b/base/sourcegraph/kustomization.yaml index 03f9c600..5c9b2d8e 100644 --- a/base/sourcegraph/kustomization.yaml +++ b/base/sourcegraph/kustomization.yaml @@ -13,5 +13,6 @@ resources: - repo-updater - searcher - symbols + - syntactic-code-intel - syntect-server - worker diff --git a/base/sourcegraph/syntactic-code-intel/kustomization.yaml b/base/sourcegraph/syntactic-code-intel/kustomization.yaml new file mode 100644 index 00000000..edd72b15 --- /dev/null +++ b/base/sourcegraph/syntactic-code-intel/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - worker.Deployment.yaml + - worker.Service.yaml diff --git a/base/sourcegraph/syntactic-code-intel/worker.Deployment.yaml b/base/sourcegraph/syntactic-code-intel/worker.Deployment.yaml new file mode 100644 index 00000000..4dd5b1d8 --- /dev/null +++ b/base/sourcegraph/syntactic-code-intel/worker.Deployment.yaml @@ -0,0 +1,77 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + description: High level syntax analysis + labels: + deploy: sourcegraph + sourcegraph-resource-requires: no-cluster-admin + app.kubernetes.io/component: syntactic-code-intel + name: syntactic-code-intel +spec: + minReadySeconds: 10 + replicas: 2 + revisionHistoryLimit: 10 + selector: + matchLabels: + app: syntactic-code-intel + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + deploy: sourcegraph + app: syntactic-code-intel + spec: + containers: + - name: syntactic-code-intel + env: + - name: PRECISE_CODE_INTEL_UPLOAD_BACKEND + value: blobstore + - name: PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT + value: http://blobstore:9000 + - name: SYNTACTIC_CODE_INTEL_WORKER_ADDR + value: ":3188" + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + image: index.docker.io/sourcegraph/syntactic-code-intel-worker:6.0.0@sha256:50bdeb38b196f0fc21404969016bf8263f78144292e905867e93480f66c8251c + terminationMessagePath: FallbackToLogsOnError + livenessProbe: + httpGet: + path: /healthz + port: debug + scheme: HTTP + initialDelaySeconds: 60 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /ready + port: debug + scheme: HTTP + periodSeconds: 5 + timeoutSeconds: 5 + ports: + - containerPort: 3188 + name: http + - containerPort: 6060 + name: debug + resources: + limits: + cpu: "2" + memory: 4G + requests: + cpu: 500m + memory: 2G + securityContext: + allowPrivilegeEscalation: false + runAsGroup: 101 + runAsUser: 100 + securityContext: + fsGroup: 101 + runAsUser: 100 + fsGroupChangePolicy: OnRootMismatch diff --git a/base/sourcegraph/syntactic-code-intel/worker.Service.yaml b/base/sourcegraph/syntactic-code-intel/worker.Service.yaml new file mode 100644 index 00000000..88a13263 --- /dev/null +++ b/base/sourcegraph/syntactic-code-intel/worker.Service.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + prometheus.io/port: "6060" + sourcegraph.prometheus/scrape: "true" + labels: + app: syntactic-code-intel + app.kubernetes.io/component: syntactic-code-intel + deploy: sourcegraph + sourcegraph-resource-requires: no-cluster-admin + name: syntactic-code-intel +spec: + ports: + - name: http + port: 3188 + targetPort: http + - name: debug + port: 6060 + targetPort: debug + selector: + app: syntactic-code-intel + type: ClusterIP