Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/sourcegraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Use `**BREAKING**:` to denote a breaking change

## Unreleased

- Added optional `syntectServer.podDisruptionBudget` support
- Added optional `searcher.podDisruptionBudget` support
- Set `DEPLOY_TYPE=helm` consistently for all Sourcegraph application containers
- Fixed the grafana StatefulSet rendering invalid YAML when `grafana.extraContainers` and a service account are both set, by emitting `extraContainers` inside the `containers` list before `serviceAccountName`, matching the other templates
Expand Down
1 change: 1 addition & 0 deletions charts/sourcegraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ In addition to the documented values, all services also support the following va
| syntectServer.image.defaultTag | string | `"6.0.0@sha256:1e35f77690222a76724b45f2305b838c40c35201e60b0f619b3fe8499504ff60"` | Docker image tag for the `syntect-server` image |
| syntectServer.image.name | string | `"syntax-highlighter"` | Docker image name for the `syntect-server` image |
| syntectServer.name | string | `"syntect-server"` | Name used by resources. Does not affect service names or PVCs. |
| syntectServer.podDisruptionBudget | object | `{}` | Pod disruption budget for `syntect-server`. Configure either `minAvailable` or `maxUnavailable` to enable it. |
| syntectServer.podSecurityContext | object | `{}` | Security context for the `syntect-server` pod, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) |
| syntectServer.replicaCount | int | `1` | Number of `syntect-server` pod |
| syntectServer.resources | object | `{"limits":{"cpu":"4","memory":"6G"},"requests":{"cpu":"250m","memory":"2G"}}` | Resource requests & limits for the `syntect-server` container, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.syntectServer.podDisruptionBudget }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ .Values.syntectServer.name }}
spec:
{{- toYaml .Values.syntectServer.podDisruptionBudget | nindent 2 }}
selector:
matchLabels:
{{- include "sourcegraph.selectorLabels" . | nindent 6 }}
app: syntect-server
{{- end }}
30 changes: 30 additions & 0 deletions charts/sourcegraph/tests/podDisruptionBudget_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ tests:
asserts:
- hasDocuments:
count: 0
- it: should not render podDisruptionBudget for syntax highlighter by default
template: syntect-server/syntect-server.PodDisruptionBudget.yaml
asserts:
- hasDocuments:
count: 0
- it: should render podDisruptionBudget for frontend
template: frontend/sourcegraph-frontend.PodDisruptionBudget.yaml
set:
Expand Down Expand Up @@ -46,3 +51,28 @@ tests:
- equal:
path: spec.selector.matchLabels["app.kubernetes.io/instance"]
value: sourcegraph
- it: should render podDisruptionBudget for syntax highlighter
template: syntect-server/syntect-server.PodDisruptionBudget.yaml
set:
syntectServer:
podDisruptionBudget:
maxUnavailable: 1
asserts:
- equal:
path: apiVersion
value: policy/v1
- equal:
path: metadata.name
value: syntect-server
- equal:
path: spec.maxUnavailable
value: 1
- equal:
path: spec.selector.matchLabels.app
value: syntect-server
- equal:
path: spec.selector.matchLabels["app.kubernetes.io/name"]
value: sourcegraph
- equal:
path: spec.selector.matchLabels["app.kubernetes.io/instance"]
value: sourcegraph
2 changes: 2 additions & 0 deletions charts/sourcegraph/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,8 @@ syntectServer:
podSecurityContext: {}
# -- Number of `syntect-server` pod
replicaCount: 1
# -- Pod disruption budget for `syntect-server`. Configure either `minAvailable` or `maxUnavailable` to enable it.
podDisruptionBudget: {}
# -- Resource requests & limits for the `syntect-server` container,
# learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/)
resources:
Expand Down
Loading