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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Thumbs.db
# Environment
.env
.env.local
AGENTS.md

# Build artifacts
*.o
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

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

## 0.2.4 - 2026-05-08

### Added

- Add first-class `spec.logging` and `spec.env` support for `KafkaBackup` and `KafkaRestore` job pods. Fixes [#18](https://github.com/osodevops/strimzi-backup-operator/issues/18).

### Changed

- Update the default `kafka-backup` job image to `osodevops/kafka-backup:v0.15.5`.

## 0.2.2 - 2026-04-28

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kafka-backup-operator"
version = "0.2.2"
version = "0.2.4"
edition = "2021"
rust-version = "1.88"
license = "Apache-2.0"
Expand Down
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ spec:
backup:
compression: zstd
parallelism: 4
logging:
level: warn
format: json
modules:
kafka_backup: warn
rdkafka: info
env:
- name: RUST_LOG
value: "kafka_backup=warn,rdkafka=info"
schedule:
cron: "0 2 * * *" # Daily at 2 AM
timezone: "Europe/London"
Expand All @@ -141,6 +150,9 @@ spec:
name: my-cluster-backup
pointInTime:
timestamp: "2026-02-12T14:30:00.000Z"
logging:
level: info
format: json
topicMapping:
- sourceTopic: orders
targetTopic: orders-restored
Expand Down Expand Up @@ -282,6 +294,53 @@ spec:
| `resources.limits.cpu` | CPU limit | `500m` |
| `resources.limits.memory` | Memory limit | `512Mi` |

## Logging

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

Configure the operator deployment log level with Helm:

```yaml
logging:
level: "info,kafka_backup_operator=debug"
format: json
```

Configure `kafka-backup` job logging on each `KafkaBackup` or `KafkaRestore`:

```yaml
apiVersion: kafkabackup.com/v1alpha1
kind: KafkaBackup
metadata:
name: debug-backup
namespace: kafka
spec:
strimziClusterRef:
name: my-kafka-cluster
storage:
type: s3
s3:
bucket: my-kafka-backups
region: eu-west-1
logging:
level: warn
format: json
output: stderr
modules:
kafka_backup: warn
rdkafka: info
```

For environment-based logging, use top-level `spec.env`; these entries are added
to backup and restore job containers:

```yaml
spec:
env:
- name: RUST_LOG
value: "kafka_backup=warn,rdkafka=info"
```

## Monitoring

The operator exposes Prometheus metrics on port `9090` at `/metrics`:
Expand Down
11 changes: 11 additions & 0 deletions config/examples/kafka-backup-s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ spec:
parallelism: 4
stopAtCurrentOffsets: true

logging:
level: warn
format: json
modules:
kafka_backup: warn
rdkafka: info

env:
- name: RUST_LOG
value: "kafka_backup=warn,rdkafka=info"

schedule:
cron: "0 2 * * *"
timezone: "UTC"
Expand Down
8 changes: 8 additions & 0 deletions config/examples/kafka-restore-pitr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ spec:
pointInTime:
timestamp: "2026-02-13T01:30:00.000Z"

logging:
level: info
format: json

env:
- name: RUST_LOG
value: "kafka_backup=info,rdkafka=warn"

topicMapping:
- sourceTopic: "orders"
targetTopic: "orders-restored"
Expand Down
47 changes: 46 additions & 1 deletion deploy/crds/kafkabackups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,55 @@ spec:
type: string
type: array
type: object
env:
description: Additional environment variables for backup job pods
items:
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
image:
description: 'Container image for the backup job (default: osodevops/kafka-backup:v0.15.3)'
description: 'Container image for the backup job (default: osodevops/kafka-backup:v0.15.5)'
nullable: true
type: string
logging:
description: Logging configuration for backup job pods
nullable: true
properties:
format:
description: 'Log format: text or json'
nullable: true
type: string
level:
description: 'Default log level: error, warn, info, debug, or trace'
nullable: true
type: string
modules:
additionalProperties:
type: string
description: Module-specific log levels
type: object
output:
description: 'Log output: stderr, stdout, or a file path supported by kafka-backup'
nullable: true
type: string
rotation:
description: File log rotation settings
nullable: true
properties:
maxFiles:
description: Maximum number of rotated log files to keep
format: uint32
minimum: 0.0
nullable: true
type: integer
maxSizeMb:
description: Maximum size of a log file before rotation, in MiB
format: uint64
minimum: 0.0
nullable: true
type: integer
type: object
type: object
metrics:
description: Metrics configuration for backup job pods
nullable: true
Expand Down
47 changes: 46 additions & 1 deletion deploy/crds/kafkarestores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,55 @@ spec:
nullable: true
type: string
type: object
env:
description: Additional environment variables for restore job pods
items:
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
image:
description: 'Container image for the restore job (default: osodevops/kafka-backup:v0.15.3)'
description: 'Container image for the restore job (default: osodevops/kafka-backup:v0.15.5)'
nullable: true
type: string
logging:
description: Logging configuration for restore job pods
nullable: true
properties:
format:
description: 'Log format: text or json'
nullable: true
type: string
level:
description: 'Default log level: error, warn, info, debug, or trace'
nullable: true
type: string
modules:
additionalProperties:
type: string
description: Module-specific log levels
type: object
output:
description: 'Log output: stderr, stdout, or a file path supported by kafka-backup'
nullable: true
type: string
rotation:
description: File log rotation settings
nullable: true
properties:
maxFiles:
description: Maximum number of rotated log files to keep
format: uint32
minimum: 0.0
nullable: true
type: integer
maxSizeMb:
description: Maximum size of a log file before rotation, in MiB
format: uint64
minimum: 0.0
nullable: true
type: integer
type: object
type: object
metrics:
description: Metrics configuration for restore job pods
nullable: true
Expand Down
4 changes: 2 additions & 2 deletions deploy/helm/strimzi-backup-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: strimzi-backup-operator
description: Kubernetes operator for Kafka backup and restore, integrated with Strimzi
type: application
version: 0.2.3
appVersion: "0.2.2"
version: 0.2.4
appVersion: "0.2.4"
home: https://github.com/osodevops/strimzi-backup-operator
sources:
- https://github.com/osodevops/strimzi-backup-operator
Expand Down
47 changes: 46 additions & 1 deletion deploy/helm/strimzi-backup-operator/crds/kafkabackups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,55 @@ spec:
type: string
type: array
type: object
env:
description: Additional environment variables for backup job pods
items:
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
image:
description: 'Container image for the backup job (default: osodevops/kafka-backup:v0.15.3)'
description: 'Container image for the backup job (default: osodevops/kafka-backup:v0.15.5)'
nullable: true
type: string
logging:
description: Logging configuration for backup job pods
nullable: true
properties:
format:
description: 'Log format: text or json'
nullable: true
type: string
level:
description: 'Default log level: error, warn, info, debug, or trace'
nullable: true
type: string
modules:
additionalProperties:
type: string
description: Module-specific log levels
type: object
output:
description: 'Log output: stderr, stdout, or a file path supported by kafka-backup'
nullable: true
type: string
rotation:
description: File log rotation settings
nullable: true
properties:
maxFiles:
description: Maximum number of rotated log files to keep
format: uint32
minimum: 0.0
nullable: true
type: integer
maxSizeMb:
description: Maximum size of a log file before rotation, in MiB
format: uint64
minimum: 0.0
nullable: true
type: integer
type: object
type: object
metrics:
description: Metrics configuration for backup job pods
nullable: true
Expand Down
47 changes: 46 additions & 1 deletion deploy/helm/strimzi-backup-operator/crds/kafkarestores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,55 @@ spec:
nullable: true
type: string
type: object
env:
description: Additional environment variables for restore job pods
items:
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
image:
description: 'Container image for the restore job (default: osodevops/kafka-backup:v0.15.3)'
description: 'Container image for the restore job (default: osodevops/kafka-backup:v0.15.5)'
nullable: true
type: string
logging:
description: Logging configuration for restore job pods
nullable: true
properties:
format:
description: 'Log format: text or json'
nullable: true
type: string
level:
description: 'Default log level: error, warn, info, debug, or trace'
nullable: true
type: string
modules:
additionalProperties:
type: string
description: Module-specific log levels
type: object
output:
description: 'Log output: stderr, stdout, or a file path supported by kafka-backup'
nullable: true
type: string
rotation:
description: File log rotation settings
nullable: true
properties:
maxFiles:
description: Maximum number of rotated log files to keep
format: uint32
minimum: 0.0
nullable: true
type: integer
maxSizeMb:
description: Maximum size of a log file before rotation, in MiB
format: uint64
minimum: 0.0
nullable: true
type: integer
type: object
type: object
metrics:
description: Metrics configuration for restore job pods
nullable: true
Expand Down
Loading
Loading