Skip to content

Commit 0074a7e

Browse files
authored
Chore: Fix service mesh auto config after migration to gRPC (#756)
- Istio uses the first part of a port name, and service definitions, to configure its service mesh sidecar proxy containers, based on the expected traffic type; docs: https://istio.io/latest/docs/ops/configuration/traffic-management/protocol-selection/#explicit-protocol-selection - The `http-` prefix in the port name wasn't updated when we switched to gRPC, so Istio was auto-configuring for http, and failing to send the gRPC traffic - Making these updates automagically fixes Istio issues, no longer requiring the Envoy patch in [charts/sourcegraph/examples/envoy](https://github.com/sourcegraph/deploy-sourcegraph-helm/tree/main/charts/sourcegraph/examples/envoy) - Helpful background on Istio here: https://istio.io/latest/docs/ops/deployment/architecture/ ### Checklist - [x] Follow the [manual testing process](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/TEST.md) - [ ] Update [changelog](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/CHANGELOG.md) - [ ] Update [Kubernetes update doc](https://docs.sourcegraph.com/admin/updates/kubernetes) This change should be invisible, except potentially for customers using the Envoy patch for gitserver ### Test plan Developed and tested with a customer, on their self-hosted instance with Istio Tested on a k3s instance: - Deployed the 6.9.0 release - Upgraded the Helm install with this branch [marc-test-fix-gitserver-ports-for-istio](https://github.com/sourcegraph/deploy-sourcegraph-helm/tree/marc-test-fix-gitserver-ports-for-istio), which is the same code changes, but on top of the v6.9.0 release commit instead of main, to test for any issues for existing customers as they upgrade - Configured a code host - Cloned some repos - Ran some searches - Checked pod logs - No errors / issues Also tested on an AWS EKS instance
1 parent c96a004 commit 0074a7e

File tree

51 files changed

+221
-180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+221
-180
lines changed

charts/sourcegraph-executor/dind/templates/executor/executor.Deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ spec:
5151
livenessProbe:
5252
httpGet:
5353
path: /healthz
54-
port: debug
54+
port: http-debug
5555
scheme: HTTP
5656
initialDelaySeconds: 60
5757
timeoutSeconds: 5
5858
readinessProbe:
5959
httpGet:
6060
path: /ready
61-
port: debug
61+
port: http-debug
6262
scheme: HTTP
6363
periodSeconds: 5
6464
timeoutSeconds: 5
6565
ports:
66-
- containerPort: 6060
67-
name: debug
66+
- name: http-debug
67+
containerPort: 6060
6868
terminationMessagePolicy: FallbackToLogsOnError
6969
env:
7070
{{- range $name, $item := .Values.executor.env }}

charts/sourcegraph-executor/dind/templates/executor/executor.Service.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ metadata:
1616
name: executor
1717
spec:
1818
ports:
19-
- name: debug
19+
- name: http-debug
2020
port: 6060
21-
targetPort: debug
21+
targetPort: http-debug
2222
selector:
2323
{{- include "sourcegraph.selectorLabels" . | nindent 4 }}
2424
app: {{include "executor.name" . }}

charts/sourcegraph-executor/dind/templates/private-docker-registry/private-docker-registry.Deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ spec:
4747
- name: REGISTRY_PROXY_REMOTEURL
4848
value: http://registry-1.docker.io
4949
ports:
50-
- containerPort: 5000
51-
name: registry
50+
- name: http
51+
containerPort: 5000
5252
livenessProbe:
5353
httpGet:
5454
path: /
55-
port: registry
55+
port: http
5656
scheme: HTTP
5757
initialDelaySeconds: 5
5858
timeoutSeconds: 5
5959
readinessProbe:
6060
httpGet:
6161
path: /
62-
port: registry
62+
port: http
6363
scheme: HTTP
6464
periodSeconds: 5
6565
timeoutSeconds: 5

charts/sourcegraph-executor/dind/templates/private-docker-registry/private-docker-registry.Service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
- name: http
1717
port: 5000
1818
protocol: TCP
19-
targetPort: 5000
19+
targetPort: http
2020
selector:
2121
app: private-docker-registry
2222
type: ClusterIP

charts/sourcegraph-executor/k8s/templates/executor.Deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ spec:
5555
securityContext:
5656
privileged: {{ .Values.executor.securityContext.privileged }}
5757
ports:
58-
- containerPort: 6060
59-
name: debug
58+
- name: http-debug
59+
containerPort: 6060
6060
envFrom:
6161
- configMapRef:
6262
name: {{ include "executor.name" . }}

charts/sourcegraph-executor/k8s/templates/executor.Service.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ metadata:
1313
name: {{ include "executor.name" . }}
1414
spec:
1515
ports:
16-
- name: debug
16+
- name: http-debug
1717
port: 6060
18-
targetPort: debug
18+
targetPort: http-debug
1919
selector:
2020
{{- include "sourcegraph.selectorLabels" . | nindent 4 }}
2121
app: {{ include "executor.name" . }}

charts/sourcegraph/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ In addition to the documented values, all services also support the following va
195195
| openTelemetry.agent.containerSecurityContext.allowPrivilegeEscalation | bool | `false` | |
196196
| openTelemetry.agent.containerSecurityContext.runAsGroup | int | `101` | |
197197
| openTelemetry.agent.containerSecurityContext.runAsUser | int | `100` | |
198-
| openTelemetry.agent.hostPorts | object | `{"otlpGrpc":4317,"otlpHttp":4318,"zpages":55679}` | Resource requests & limits for the `otel-agent` container, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
198+
| openTelemetry.agent.hostPorts | object | `{"grpcOtlp":4317,"httpOtlp":4318,"httpZpages":55679}` | Resource requests & limits for the `otel-agent` container, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
199199
| openTelemetry.agent.name | string | `"otel-agent"` | Name used by resources. Does not affect service names or PVCs. |
200200
| openTelemetry.agent.resources.limits.cpu | string | `"500m"` | |
201201
| openTelemetry.agent.resources.limits.memory | string | `"500Mi"` | |

charts/sourcegraph/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ app.kubernetes.io/name: jaeger
175175
fieldRef:
176176
fieldPath: status.hostIP
177177
- name: OTEL_EXPORTER_OTLP_ENDPOINT
178-
value: http://$(OTEL_AGENT_HOST):{{ toYaml .Values.openTelemetry.agent.hostPorts.otlpGrpc }}
178+
value: http://$(OTEL_AGENT_HOST):{{ toYaml .Values.openTelemetry.agent.hostPorts.grpcOtlp }}
179179
{{- end }}
180180
{{- end }}
181181

charts/sourcegraph/templates/_worker.tpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{- define "sourcegraph.worker" -}}
22
{{- $top := index . 0 }}
33
{{- $suffix := index . 1 -}}
4-
{{- $allowlist := index . 2 -}}
4+
{{- $allowlist := index . 2 -}}
55
{{- $blocklist := index . 3 -}}
66
{{- $resources := index . 4 -}}
77

@@ -100,24 +100,24 @@ spec:
100100
livenessProbe:
101101
httpGet:
102102
path: /healthz
103-
port: debug
103+
port: http-debug
104104
scheme: HTTP
105105
initialDelaySeconds: 60
106106
timeoutSeconds: 5
107107
readinessProbe:
108108
httpGet:
109109
path: /ready
110-
port: debug
110+
port: http-debug
111111
scheme: HTTP
112112
periodSeconds: 5
113113
timeoutSeconds: 5
114114
ports:
115-
- containerPort: 3189
116-
name: http
117-
- containerPort: 6060
118-
name: debug
119-
- containerPort: 6996
120-
name: prom
115+
- name: http
116+
containerPort: 3189
117+
- name: http-debug
118+
containerPort: 6060
119+
- name: http-debug-exec
120+
containerPort: 6996
121121
{{- if not $top.Values.sourcegraph.localDevMode }}
122122
resources:
123123
{{- toYaml $resources | nindent 10 }}

charts/sourcegraph/templates/blobstore/blobstore.Deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,19 @@ spec:
5555
args: {{- default (list "") .Values.blobstore.args | toYaml | nindent 8 }}
5656
terminationMessagePolicy: FallbackToLogsOnError
5757
ports:
58-
- containerPort: 9000
59-
name: blobstore
58+
- name: http
59+
containerPort: 9000
6060
livenessProbe:
6161
httpGet:
6262
path: /
63-
port: blobstore
63+
port: http
6464
scheme: HTTP
6565
initialDelaySeconds: 60
6666
timeoutSeconds: 5
6767
readinessProbe:
6868
httpGet:
6969
path: /
70-
port: blobstore
70+
port: http
7171
scheme: HTTP
7272
periodSeconds: 5
7373
timeoutSeconds: 5

0 commit comments

Comments
 (0)