Skip to content

Commit e4d13e4

Browse files
authored
Merge pull request #28 from osodevops/fix/issues-26-27
feat: restore topic selection and per-CR job service account (0.2.8)
2 parents a4d1577 + 9375353 commit e4d13e4

18 files changed

Lines changed: 276 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## 0.2.8 - 2026-06-11
6+
7+
### Added
8+
9+
- Add `spec.topics` with include/exclude glob (or `~`-prefixed regex) patterns to `KafkaRestore`, allowing specific topics to be restored from a backup. Fixes [#26](https://github.com/osodevops/strimzi-backup-operator/issues/26).
10+
- Add `spec.template.pod.serviceAccountName` to `KafkaBackup` and `KafkaRestore` so job pods in namespaces other than the operator's can run with a service account that exists there. Fixes [#27](https://github.com/osodevops/strimzi-backup-operator/issues/27).
11+
512
## 0.2.7 - 2026-06-10
613

714
### Fixed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "kafka-backup-operator"
3-
version = "0.2.7"
3+
version = "0.2.8"
44
edition = "2021"
55
rust-version = "1.88"
66
license = "Apache-2.0"

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ The **Kafka Backup Operator** solves these problems with a purpose-built Kuberne
2626
- **Scheduled backups** — cron-based scheduling with timezone support via Kubernetes CronJobs
2727
- **Point-in-time recovery (PITR)** — restore your Kafka cluster to any millisecond-precision timestamp
2828
- **Multi-cloud storage** — back up to Amazon S3, Azure Blob Storage, Google Cloud Storage, or any S3-compatible store (MinIO, Ceph RGW)
29-
- **Topic filtering** — include/exclude topics using regex patterns
29+
- **Topic filtering** — include/exclude topics using glob or regex patterns, for both backup and restore
3030
- **Topic mapping** — rename topics during restore for migration or testing scenarios
3131
- **Consumer group offset restore** — restore consumer group offsets with optional group remapping
3232
- **Retention policies** — automatic pruning of old backups by count or age
3333
- **Compression** — gzip, snappy, lz4, or zstd compression for storage efficiency
3434
- **Prometheus metrics** — built-in observability with backup/restore counters, duration histograms, and storage gauges
35-
- **Pod template customisation** — full control over backup/restore Job pods (affinity, tolerations, host aliases, security context, environment variables)
35+
- **Pod template customisation** — full control over backup/restore Job pods (affinity, tolerations, host aliases, service account, security context, environment variables)
3636
- **Azure Workload Identity** — native support for passwordless Azure authentication
3737

3838
## Architecture
@@ -148,6 +148,11 @@ spec:
148148
name: my-cluster
149149
backupRef:
150150
name: my-cluster-backup
151+
topics:
152+
include:
153+
- "orders-*" # glob, or "~orders-\d+" for regex
154+
exclude:
155+
- "*-internal"
151156
pointInTime:
152157
timestamp: "2026-02-12T14:30:00.000Z"
153158
logging:
@@ -294,6 +299,26 @@ spec:
294299
| `resources.limits.cpu` | CPU limit | `500m` |
295300
| `resources.limits.memory` | Memory limit | `512Mi` |
296301

302+
### Job service accounts across namespaces
303+
304+
Backup and restore Jobs run in the namespace of the `KafkaBackup`/`KafkaRestore`
305+
resource, and by default reference the service account named by
306+
`backupJobs.serviceAccountName` (falling back to the operator's own service
307+
account). Service accounts are namespace-scoped, so for resources created
308+
outside the operator's namespace, set `spec.template.pod.serviceAccountName`
309+
to a service account that exists in that namespace:
310+
311+
```yaml
312+
spec:
313+
template:
314+
pod:
315+
serviceAccountName: kafka-backup-jobs
316+
```
317+
318+
The service account only needs to exist (job pods don't call the Kubernetes
319+
API), but it should carry any workload-identity annotations (IRSA, Azure
320+
Workload Identity) your storage backend requires.
321+
297322
## Logging
298323

299324
The operator deployment and the backup/restore job pods are configured separately.

config/examples/kafka-restore-pitr.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ spec:
1818
name: daily-backup
1919
backupId: "backup-20260213-020000"
2020

21+
# Restore only selected topics from the backup. Glob patterns by default;
22+
# prefix with ~ for regex. Matched against source topic names, before
23+
# topicMapping renames. Omit to restore every topic in the backup.
24+
topics:
25+
include:
26+
- "orders"
27+
- "payments"
28+
2129
pointInTime:
2230
timestamp: "2026-02-13T01:30:00.000Z"
2331

@@ -56,6 +64,9 @@ spec:
5664

5765
template:
5866
pod:
67+
# Service account for the restore job pod; must exist in this namespace.
68+
# Defaults to the operator-wide backupJobs.serviceAccountName.
69+
serviceAccountName: kafka-backup-jobs
5970
hostAliases:
6071
- ip: "10.10.0.5"
6172
hostnames:

deploy/crds/kafkabackups.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,10 @@ spec:
718718
description: Pod security context (pass-through to k8s PodSecurityContext)
719719
type: object
720720
x-kubernetes-preserve-unknown-fields: true
721+
serviceAccountName:
722+
description: Service account for job pods. Must exist in the namespace of this resource. Overrides the operator-wide default (BACKUP_JOB_SERVICE_ACCOUNT).
723+
nullable: true
724+
type: string
721725
tolerations:
722726
description: Pod tolerations (pass-through to k8s Tolerations)
723727
items:

deploy/crds/kafkarestores.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,10 @@ spec:
516516
description: Pod security context (pass-through to k8s PodSecurityContext)
517517
type: object
518518
x-kubernetes-preserve-unknown-fields: true
519+
serviceAccountName:
520+
description: Service account for job pods. Must exist in the namespace of this resource. Overrides the operator-wide default (BACKUP_JOB_SERVICE_ACCOUNT).
521+
nullable: true
522+
type: string
519523
tolerations:
520524
description: Pod tolerations (pass-through to k8s Tolerations)
521525
items:
@@ -540,6 +544,21 @@ spec:
540544
- targetTopic
541545
type: object
542546
type: array
547+
topics:
548+
description: Topics to restore, selected by include/exclude glob (or `~`-prefixed regex) patterns matched against source topic names in the backup. All topics are restored when omitted. Filtering is applied before topicMapping renames.
549+
nullable: true
550+
properties:
551+
exclude:
552+
description: Glob patterns for topics to exclude
553+
items:
554+
type: string
555+
type: array
556+
include:
557+
description: Glob patterns for topics to include
558+
items:
559+
type: string
560+
type: array
561+
type: object
543562
required:
544563
- backupRef
545564
- strimziClusterRef

deploy/helm/strimzi-backup-operator/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: strimzi-backup-operator
33
description: Kubernetes operator for Kafka backup and restore, integrated with Strimzi
44
type: application
5-
version: 0.2.7
6-
appVersion: "0.2.7"
5+
version: 0.2.8
6+
appVersion: "0.2.8"
77
home: https://github.com/osodevops/strimzi-backup-operator
88
sources:
99
- https://github.com/osodevops/strimzi-backup-operator

deploy/helm/strimzi-backup-operator/crds/kafkabackups.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,10 @@ spec:
718718
description: Pod security context (pass-through to k8s PodSecurityContext)
719719
type: object
720720
x-kubernetes-preserve-unknown-fields: true
721+
serviceAccountName:
722+
description: Service account for job pods. Must exist in the namespace of this resource. Overrides the operator-wide default (BACKUP_JOB_SERVICE_ACCOUNT).
723+
nullable: true
724+
type: string
721725
tolerations:
722726
description: Pod tolerations (pass-through to k8s Tolerations)
723727
items:

deploy/helm/strimzi-backup-operator/crds/kafkarestores.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,10 @@ spec:
516516
description: Pod security context (pass-through to k8s PodSecurityContext)
517517
type: object
518518
x-kubernetes-preserve-unknown-fields: true
519+
serviceAccountName:
520+
description: Service account for job pods. Must exist in the namespace of this resource. Overrides the operator-wide default (BACKUP_JOB_SERVICE_ACCOUNT).
521+
nullable: true
522+
type: string
519523
tolerations:
520524
description: Pod tolerations (pass-through to k8s Tolerations)
521525
items:
@@ -540,6 +544,21 @@ spec:
540544
- targetTopic
541545
type: object
542546
type: array
547+
topics:
548+
description: Topics to restore, selected by include/exclude glob (or `~`-prefixed regex) patterns matched against source topic names in the backup. All topics are restored when omitted. Filtering is applied before topicMapping renames.
549+
nullable: true
550+
properties:
551+
exclude:
552+
description: Glob patterns for topics to exclude
553+
items:
554+
type: string
555+
type: array
556+
include:
557+
description: Glob patterns for topics to include
558+
items:
559+
type: string
560+
type: array
561+
type: object
543562
required:
544563
- backupRef
545564
- strimziClusterRef

0 commit comments

Comments
 (0)