Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c7587df
feat(k8s): add streaming operator prototype
bmcquilkin-sentry Jul 2, 2026
97b94e0
ref(k8s): use streaming pipeline instead of consumer
bmcquilkin-sentry Jul 10, 2026
4962ad2
feat(k8s): build operator image and push to GAR
bmcquilkin-sentry Jul 13, 2026
68267a1
feat(k8s): package the operator as a helm chart
bmcquilkin-sentry Jul 9, 2026
99657f6
ref(operator): require kubeVersion >= 1.23
bmcquilkin-sentry Jul 13, 2026
6910839
ref(operator): move crd file, version bump semantics
bmcquilkin-sentry Jul 13, 2026
88c1e47
fix(rbac): streamingconsumers -> streamingpipelines
bmcquilkin-sentry Jul 13, 2026
999086c
fix(deployment): inconsistent group/user ids
bmcquilkin-sentry Jul 13, 2026
8639a62
ref(operator): build/publish release semantics
bmcquilkin-sentry Jul 13, 2026
a2b0634
ref(operator): use chart releaser action
bmcquilkin-sentry Jul 13, 2026
f7743ee
ref(rbac): remove update permissions
bmcquilkin-sentry Jul 13, 2026
523777a
ref(operator): scoped rbac + delete handler
bmcquilkin-sentry Jul 13, 2026
3539e24
ref(rbac): remove pod permissions
bmcquilkin-sentry Jul 13, 2026
c1687de
fix(build): dependency semantics
bmcquilkin-sentry Jul 15, 2026
e7c4082
ref(operator): receive namespaces as values
bmcquilkin-sentry Jul 15, 2026
077c02d
fix(operator): stable manager + force conflicts
bmcquilkin-sentry Jul 15, 2026
523696f
feat(k8s): add streaming operator prototype
bmcquilkin-sentry Jul 2, 2026
a6f3e6a
ref(k8s): use streaming pipeline instead of consumer
bmcquilkin-sentry Jul 10, 2026
2949354
feat(k8s): package the operator as a helm chart
bmcquilkin-sentry Jul 9, 2026
ce37ab5
ref(operator): require kubeVersion >= 1.23
bmcquilkin-sentry Jul 13, 2026
c11861b
ref(operator): move crd file, version bump semantics
bmcquilkin-sentry Jul 13, 2026
a00d8cd
fix(rbac): streamingconsumers -> streamingpipelines
bmcquilkin-sentry Jul 13, 2026
fdd0518
fix(deployment): inconsistent group/user ids
bmcquilkin-sentry Jul 13, 2026
230b67e
ref(operator): build/publish release semantics
bmcquilkin-sentry Jul 13, 2026
9ba6f60
ref(operator): use chart releaser action
bmcquilkin-sentry Jul 13, 2026
a57b062
ref(rbac): remove update permissions
bmcquilkin-sentry Jul 13, 2026
f21ca21
ref(operator): scoped rbac + delete handler
bmcquilkin-sentry Jul 13, 2026
994d550
ref(rbac): remove pod permissions
bmcquilkin-sentry Jul 13, 2026
deb1a25
ref(operator): receive namespaces as values
bmcquilkin-sentry Jul 15, 2026
12fa8fa
fix(operator): stable manager + force conflicts
bmcquilkin-sentry Jul 15, 2026
de53f2c
Merge branch 'bmcquilkin/operator/helm' of https://github.com/getsent…
bmcquilkin-sentry Jul 16, 2026
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
42 changes: 41 additions & 1 deletion .github/workflows/build-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Push Streaming Operator Image
name: Publish Streaming Operator

on:
push:
Expand Down Expand Up @@ -37,3 +37,43 @@ jobs:
google_ar_image_name: ${{ matrix.image }}
google_workload_identity_provider: projects/868781662168/locations/global/workloadIdentityPools/prod-github/providers/github-oidc-pool
google_service_account: gha-gcr-push@sac-prod-sa.iam.gserviceaccount.com

publish-chart:
name: Publish Helm chart
needs: build-and-push
runs-on: ubuntu-latest
concurrency:
group: github-pages
cancel-in-progress: false
permissions:
contents: write
env:
CHART_DIR: sentry_streams_k8s/chart/streaming-operator
CHART_VERSION: 0.0.0-${{ github.sha }}
IMAGE_TAG: ${{ github.sha }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0

- name: Prepare and lint chart
run: |
sed -i "s/^version:.*/version: ${CHART_VERSION}/" "${CHART_DIR}/Chart.yaml"
sed -i "s/^appVersion:.*/appVersion: \"${IMAGE_TAG}\"/" "${CHART_DIR}/Chart.yaml"
helm lint "${CHART_DIR}" --set workloadNamespace=streaming-pipelines
helm template streaming-operator "${CHART_DIR}" \
--set workloadNamespace=streaming-pipelines > /dev/null

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"

- name: Release chart
uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0
with:
charts_dir: sentry_streams_k8s/chart
skip_existing: true
mark_as_latest: false
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ jobs:
- name: Run k8s test
run: make tests-k8s

chart:
name: "Lint streaming-operator helm chart"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Lint and render chart
run: |
helm lint sentry_streams_k8s/chart/streaming-operator \
--set workloadNamespace=streaming-pipelines
helm template streaming-operator sentry_streams_k8s/chart/streaming-operator \
--set workloadNamespace=streaming-pipelines > /dev/null

integration-tests:
name: "Run integration tests"
runs-on: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
docs:
name: Sphinx
runs-on: ubuntu-latest
concurrency:
group: github-pages
cancel-in-progress: false
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
Expand All @@ -23,7 +26,7 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: sentry_streams/docs/build
force_orphan: true
keep_files: true

- name: Archive Docs
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
Expand Down
8 changes: 8 additions & 0 deletions sentry_streams_k8s/chart/streaming-operator/Chart.yaml
Comment thread
bmcquilkin-sentry marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v2
name: streaming-operator
type: application
kubeVersion: ">=1.23.0-0"
version: 0.0.0
appVersion: "latest"
sources:
- https://github.com/getsentry/streams/tree/main/sentry_streams_k8s
Comment thread
bmcquilkin-sentry marked this conversation as resolved.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{- define "streaming-operator.name" -}}
{{- .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "streaming-operator.fullname" -}}
{{- include "streaming-operator.name" . -}}
{{- end -}}

{{- define "streaming-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "streaming-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

{{- define "streaming-operator.labels" -}}
{{ include "streaming-operator.selectorLabels" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version }}
{{- with .Values.labels }}
{{ toYaml . }}
Comment thread
bmcquilkin-sentry marked this conversation as resolved.
{{- end }}
{{- end -}}

{{- define "streaming-operator.serviceAccountName" -}}
{{- default (include "streaming-operator.fullname" .) .Values.serviceAccount.name -}}
{{- end -}}

{{- define "streaming-operator.workloadNamespace" -}}
{{- required "workloadNamespace must be set" .Values.workloadNamespace -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "streaming-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
Comment thread
fpacifici marked this conversation as resolved.
{{- include "streaming-operator.labels" . | nindent 4 }}
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
{{- include "streaming-operator.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "streaming-operator.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "streaming-operator.serviceAccountName" . }}
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
seccompProfile:
type: RuntimeDefault
containers:
- name: operator
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: WORKLOAD_NAMESPACE
value: {{ include "streaming-operator.workloadNamespace" . | quote }}
{{- with .Values.env }}
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Namespace
metadata:
name: {{ include "streaming-operator.workloadNamespace" . }}
annotations:
helm.sh/resource-policy: keep
labels:
{{- include "streaming-operator.labels" . | nindent 4 }}
68 changes: 68 additions & 0 deletions sentry_streams_k8s/chart/streaming-operator/templates/rbac.yaml
Comment thread
bmcquilkin-sentry marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "streaming-operator.fullname" . }}
labels:
{{- include "streaming-operator.labels" . | nindent 4 }}
rules:
- apiGroups: [apiextensions.k8s.io]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please scope all of these to the default namespace. I know it does not remove much but at least it is a start.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1. Should be scoped within the Release.namespace

@fpacifici fpacifici Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gi0baro this is not going to be deployed in the same namespace as the consumers it manages. The operator is likely going to run into sentry-system, right ? Or is the recommendation different ?
The consumers would be in their own namespaces.
Regardless we should restrict the namespace whatever the one is. Probably from the value file

resources: [customresourcedefinitions]
verbs: [list, watch]
- apiGroups: [""]
resources: [namespaces]
verbs: [list, watch]
- apiGroups: [streams.sentry.io]
resources: [streamingpipelines]
verbs: [list, watch, patch]
- apiGroups: [streams.sentry.io]
resources: [streamingpipelines/status]
verbs: [patch]
Comment thread
bmcquilkin-sentry marked this conversation as resolved.
- apiGroups: [""]
resources: [events]
verbs: [create]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "streaming-operator.fullname" . }}
labels:
{{- include "streaming-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "streaming-operator.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "streaming-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "streaming-operator.fullname" . }}
namespace: {{ include "streaming-operator.workloadNamespace" . }}
labels:
{{- include "streaming-operator.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: [configmaps]
verbs: [get, list, create, patch, delete]
- apiGroups: [apps]
resources: [deployments]
verbs: [get, list, create, patch, delete]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "streaming-operator.fullname" . }}
namespace: {{ include "streaming-operator.workloadNamespace" . }}
labels:
{{- include "streaming-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "streaming-operator.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "streaming-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "streaming-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "streaming-operator.labels" . | nindent 4 }}
32 changes: 32 additions & 0 deletions sentry_streams_k8s/chart/streaming-operator/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# - labels is for things like Sentry COGS tags (service, app_feature, component).
# - serviceAccount.name defaults to the chart's full name when left empty.
# - image.tag defaults to the chart's appVersion when left empty.

workloadNamespace: ""

image:
repository: us-central1-docker.pkg.dev/sentryio/streaming-operator/image
tag: ""
pullPolicy: IfNotPresent

resources:
requests:
cpu: 100m
memory: 256Mi
limits:
memory: 256Mi

env: []

labels: {}

podLabels: {}
podAnnotations: {}

serviceAccount:
name: ""

nodeSelector: {}
tolerations: []
affinity: {}
priorityClassName: ""
6 changes: 5 additions & 1 deletion sentry_streams_k8s/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ where = ["."]
include = ["sentry_streams_k8s*"]

[tool.setuptools.package-data]
sentry_streams_k8s = ["py.typed", "templates/deployment.yaml", "templates/container.yaml"]
sentry_streams_k8s = [
"py.typed",
"templates/deployment.yaml",
"templates/container.yaml",
]

[tool.pytest.ini_options]
minversion = "6.0"
Expand Down
Loading
Loading