Skip to content

Commit 02d3059

Browse files
committed
feat: support pod host aliases
1 parent 6b1c4e8 commit 02d3059

15 files changed

Lines changed: 230 additions & 25 deletions

File tree

CHANGELOG.md

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

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

5+
## Unreleased
6+
7+
### Added
8+
9+
- Add `spec.template.pod.hostAliases` support for `KafkaBackup` and `KafkaRestore` job pods. Fixes [#22](https://github.com/osodevops/strimzi-backup-operator/issues/22).
10+
511
## 0.2.5 - 2026-05-17
612

713
### Changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
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
@@ -19,7 +19,7 @@ path = "src/bin/crdgen.rs"
1919
# Kubernetes
2020
kube = { version = "0.95", features = ["runtime", "derive", "client"] }
2121
kube-runtime = "0.95"
22-
k8s-openapi = { version = "0.23", features = ["v1_30"] }
22+
k8s-openapi = { version = "0.23", features = ["v1_30", "schemars"] }
2323

2424
# Async runtime
2525
tokio = { version = "1", features = ["full", "signal"] }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The **Kafka Backup Operator** solves these problems with a purpose-built Kuberne
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, security context, environment variables)
35+
- **Pod template customisation** — full control over backup/restore Job pods (affinity, tolerations, host aliases, security context, environment variables)
3636
- **Azure Workload Identity** — native support for passwordless Azure authentication
3737

3838
## Architecture

config/examples/kafka-backup-s3.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,10 @@ spec:
6868
limits:
6969
cpu: "2"
7070
memory: "4Gi"
71+
72+
template:
73+
pod:
74+
hostAliases:
75+
- ip: "10.10.0.5"
76+
hostnames:
77+
- "s3.internal"

config/examples/kafka-restore-pitr.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,10 @@ spec:
5353
limits:
5454
cpu: "4"
5555
memory: "8Gi"
56+
57+
template:
58+
pod:
59+
hostAliases:
60+
- ip: "10.10.0.5"
61+
hostnames:
62+
- "s3.internal"

deploy/crds/kafkabackups.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,6 @@ spec:
667667
description: Container security context (pass-through to k8s SecurityContext)
668668
type: object
669669
x-kubernetes-preserve-unknown-fields: true
670-
required:
671-
- securityContext
672670
type: object
673671
pod:
674672
description: Pod-level overrides
@@ -678,6 +676,23 @@ spec:
678676
description: Pod affinity rules (pass-through to k8s Affinity)
679677
type: object
680678
x-kubernetes-preserve-unknown-fields: true
679+
hostAliases:
680+
description: Pod host aliases (pass-through to k8s HostAlias)
681+
items:
682+
description: HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.
683+
properties:
684+
hostnames:
685+
description: Hostnames for the above IP address.
686+
items:
687+
type: string
688+
type: array
689+
ip:
690+
description: IP address of the host file entry.
691+
type: string
692+
required:
693+
- ip
694+
type: object
695+
type: array
681696
imagePullSecrets:
682697
description: Image pull secrets
683698
items:
@@ -709,9 +724,6 @@ spec:
709724
type: object
710725
x-kubernetes-preserve-unknown-fields: true
711726
type: array
712-
required:
713-
- affinity
714-
- securityContext
715727
type: object
716728
type: object
717729
topics:

deploy/crds/kafkarestores.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,6 @@ spec:
465465
description: Container security context (pass-through to k8s SecurityContext)
466466
type: object
467467
x-kubernetes-preserve-unknown-fields: true
468-
required:
469-
- securityContext
470468
type: object
471469
pod:
472470
description: Pod-level overrides
@@ -476,6 +474,23 @@ spec:
476474
description: Pod affinity rules (pass-through to k8s Affinity)
477475
type: object
478476
x-kubernetes-preserve-unknown-fields: true
477+
hostAliases:
478+
description: Pod host aliases (pass-through to k8s HostAlias)
479+
items:
480+
description: HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.
481+
properties:
482+
hostnames:
483+
description: Hostnames for the above IP address.
484+
items:
485+
type: string
486+
type: array
487+
ip:
488+
description: IP address of the host file entry.
489+
type: string
490+
required:
491+
- ip
492+
type: object
493+
type: array
479494
imagePullSecrets:
480495
description: Image pull secrets
481496
items:
@@ -507,9 +522,6 @@ spec:
507522
type: object
508523
x-kubernetes-preserve-unknown-fields: true
509524
type: array
510-
required:
511-
- affinity
512-
- securityContext
513525
type: object
514526
type: object
515527
topicMapping:

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,6 @@ spec:
667667
description: Container security context (pass-through to k8s SecurityContext)
668668
type: object
669669
x-kubernetes-preserve-unknown-fields: true
670-
required:
671-
- securityContext
672670
type: object
673671
pod:
674672
description: Pod-level overrides
@@ -678,6 +676,23 @@ spec:
678676
description: Pod affinity rules (pass-through to k8s Affinity)
679677
type: object
680678
x-kubernetes-preserve-unknown-fields: true
679+
hostAliases:
680+
description: Pod host aliases (pass-through to k8s HostAlias)
681+
items:
682+
description: HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.
683+
properties:
684+
hostnames:
685+
description: Hostnames for the above IP address.
686+
items:
687+
type: string
688+
type: array
689+
ip:
690+
description: IP address of the host file entry.
691+
type: string
692+
required:
693+
- ip
694+
type: object
695+
type: array
681696
imagePullSecrets:
682697
description: Image pull secrets
683698
items:
@@ -709,9 +724,6 @@ spec:
709724
type: object
710725
x-kubernetes-preserve-unknown-fields: true
711726
type: array
712-
required:
713-
- affinity
714-
- securityContext
715727
type: object
716728
type: object
717729
topics:

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,6 @@ spec:
465465
description: Container security context (pass-through to k8s SecurityContext)
466466
type: object
467467
x-kubernetes-preserve-unknown-fields: true
468-
required:
469-
- securityContext
470468
type: object
471469
pod:
472470
description: Pod-level overrides
@@ -476,6 +474,23 @@ spec:
476474
description: Pod affinity rules (pass-through to k8s Affinity)
477475
type: object
478476
x-kubernetes-preserve-unknown-fields: true
477+
hostAliases:
478+
description: Pod host aliases (pass-through to k8s HostAlias)
479+
items:
480+
description: HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.
481+
properties:
482+
hostnames:
483+
description: Hostnames for the above IP address.
484+
items:
485+
type: string
486+
type: array
487+
ip:
488+
description: IP address of the host file entry.
489+
type: string
490+
required:
491+
- ip
492+
type: object
493+
type: array
479494
imagePullSecrets:
480495
description: Image pull secrets
481496
items:
@@ -507,9 +522,6 @@ spec:
507522
type: object
508523
x-kubernetes-preserve-unknown-fields: true
509524
type: array
510-
required:
511-
- affinity
512-
- securityContext
513525
type: object
514526
type: object
515527
topicMapping:

0 commit comments

Comments
 (0)