Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e627d75
Commit before push to apimachinary
ZobayerAbedin Oct 9, 2025
c416f0f
Commit before push to apimachinary
ZobayerAbedin Oct 10, 2025
89d6dff
Commit before push to apimachinary
ZobayerAbedin Oct 10, 2025
a1255e5
Fix missing deepcopy for hanadb
ZobayerAbedin Oct 10, 2025
8560aac
Include in zz_generated`(in *HanaDBVersion) DeepCopyObject()`, need t…
ZobayerAbedin Oct 10, 2025
af646a4
Fix deepcopy function generation issue for HanaDB
ZobayerAbedin Oct 13, 2025
217d50c
Add HanaDB on features
ZobayerAbedin Oct 15, 2025
20c72d4
Modify constants.go
ZobayerAbedin Oct 23, 2025
c9fafdb
Modify hanadb_helpers.go
ZobayerAbedin Oct 23, 2025
4a60b6b
Exclude unnecessary lines for hanadb
ZobayerAbedin Oct 23, 2025
418c16a
Modify hanadb.go
ZobayerAbedin Oct 24, 2025
758c044
Modify hanadb.go
ZobayerAbedin Oct 30, 2025
b71cddd
Update security context in hanadb_helpers.go
ZobayerAbedin Oct 30, 2025
9c8b21e
Complete request review's changes
ZobayerAbedin Oct 30, 2025
819da8b
Update constants.go
ZobayerAbedin Oct 30, 2025
1d29cf4
Update constants.go
ZobayerAbedin Oct 30, 2025
ec41c19
Update hanadb_helpers.go
ZobayerAbedin Nov 3, 2025
65e208f
Update hanadb_helpers.go
ZobayerAbedin Nov 4, 2025
1e8a50c
Update hanadb_helpers.go
ZobayerAbedin Nov 4, 2025
71b9c07
Update system replication spec hanadb
ZobayerAbedin Nov 12, 2025
3c2abe8
Complete PR review request
ZobayerAbedin Nov 19, 2025
b23d383
Update constants.go
ZobayerAbedin Nov 20, 2025
0d22a8e
Update files from hanadb branch
ZobayerAbedin Nov 25, 2025
2ad7a4e
Add SystemReplication Spec
ZobayerAbedin Dec 29, 2025
a75e915
Merge branch 'master' into hdb-clustering
ZobayerAbedin Jan 4, 2026
ed7fb15
Merge remote-tracking branch 'origin/master' into hdb-clustering
ZobayerAbedin Jan 26, 2026
9220f10
Merge remote-tracking branch 'origin/master' into hdb-clustering
ZobayerAbedin Jan 28, 2026
a1ff648
Add HanaDB monitoring
ZobayerAbedin Jan 29, 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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -439,4 +439,4 @@ ci: verify check-license lint build unit-tests #cover

.PHONY: clean
clean:
rm -rf .go bin
rm -rf .go bin
9 changes: 3 additions & 6 deletions apis/catalog/v1alpha1/hanadb_version_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package v1alpha1

import (
"fmt"
"strings"

"kubedb.dev/apimachinery/apis"
"kubedb.dev/apimachinery/apis/catalog"
Expand Down Expand Up @@ -56,11 +55,9 @@ func (h HanaDBVersion) ResourcePlural() string {
func (h HanaDBVersion) ValidateSpecs() error {
if h.Spec.Version == "" ||
h.Spec.DB.Image == "" {
fields := []string{
"spec.version",
"spec.db.image",
}
return fmt.Errorf("atleast one of the following specs is not set for HanaDBVersion %q: %s", h.Name, strings.Join(fields, ", "))
return fmt.Errorf(`atleast one of the following specs is not set for HanaDBVersion "%v":
spec.version,
spec.db.image,`, h.Name)
}
return nil
}
20 changes: 15 additions & 5 deletions apis/catalog/v1alpha1/hanadb_version_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ type HanaDBVersion struct {
type HanaDBVersionSpec struct {
// Version
Version string `json:"version"`

// EndOfLife refers if this version reached into its end of the life or not, based on https://endoflife.date/
// +optional
EndOfLife bool `json:"endOfLife"`

// Database Image
DB HanaDatabase `json:"db"`
// Coordinator Image
// +optional
Coordinator HanaDBCoordinator `json:"coordinator,omitempty"`
// Exporter Image
Exporter HanaDBVersionExporter `json:"exporter"`
// Deprecated versions usable but considered as obsolete and best avoided typically superseded
Deprecated bool `json:"deprecated,omitempty"`
// SecurityContext is for the additional config for the DB container
Expand All @@ -78,6 +78,16 @@ type HanaDatabase struct {
Image string `json:"image"`
}

// HanaDBCoordinator is the HanaDB coordinator Container image
type HanaDBCoordinator struct {
Image string `json:"image"`
}

// HanaDBVersionExporter is the image for the HanaDB exporter
type HanaDBVersionExporter struct {
Image string `json:"image"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// HanaDBVersionList is a list of HanaDBVersions
Expand Down
70 changes: 60 additions & 10 deletions apis/catalog/v1alpha1/openapi_generated.go

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

34 changes: 34 additions & 0 deletions apis/catalog/v1alpha1/zz_generated.deepcopy.go

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

3 changes: 3 additions & 0 deletions apis/kubedb/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -2277,6 +2277,9 @@ const (
HanaDBSystemDBSQLPortName = "systemdb-sql"
HanaDBSystemDBSQLPort = 39017

// Metrics exporter port
HanaDBExporterPort = 9668

// Nameserver port for internal communication and system replication
HanaDBNameServerPortName = "nameserver"
HanaDBNameServerPort = 39001
Expand Down
26 changes: 26 additions & 0 deletions apis/kubedb/v1alpha2/hanadb_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,38 @@ func (h *HanaDB) SetDefaults(kc client.Client) {
h.Spec.Replicas = pointer.Int32P(1)
}
}
if h.Spec.Topology != nil && h.Spec.Topology.Mode != nil &&
*h.Spec.Topology.Mode == HanaDBModeSystemReplication &&
h.Spec.Topology.SystemReplication != nil {
if h.Spec.Topology.SystemReplication.ReplicationMode == "" {
h.Spec.Topology.SystemReplication.ReplicationMode = ReplicationModeSync
}
if h.Spec.Topology.SystemReplication.OperationMode == "" {
h.Spec.Topology.SystemReplication.OperationMode = OperationModeLogReplay
}
}

h.setDefaultContainerSecurityContext(&hanadbVersion, h.Spec.PodTemplate)

h.SetHealthCheckerDefaults()

h.setDefaultContainerResourceLimits(h.Spec.PodTemplate)

if h.Spec.Monitor != nil {
if h.Spec.Monitor.Prometheus == nil {
h.Spec.Monitor.Prometheus = &mona.PrometheusSpec{}
}
if h.Spec.Monitor.Prometheus.Exporter.Port == 0 {
h.Spec.Monitor.Prometheus.Exporter.Port = kubedb.HanaDBExporterPort
}
h.Spec.Monitor.SetDefaults()
if h.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser == nil {
h.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser = hanadbVersion.Spec.SecurityContext.RunAsUser
}
if h.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup == nil {
h.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup = hanadbVersion.Spec.SecurityContext.RunAsGroup
}
}
}

func (h *HanaDB) setDefaultContainerSecurityContext(hanadbVersion *catalog.HanaDBVersion, podTemplate *ofst.PodTemplateSpec) {
Expand Down
40 changes: 40 additions & 0 deletions apis/kubedb/v1alpha2/hanadb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kmapi "kmodules.xyz/client-go/api/v1"
mona "kmodules.xyz/monitoring-agent-api/api/v1"
ofst "kmodules.xyz/offshoot-api/api/v2"
)

Expand All @@ -30,6 +31,24 @@ const (
ResourcePluralHanaDB = "hanadbs"
)

// +kubebuilder:validation:Enum=sync;syncmem;async
type ReplicationMode string

const (
ReplicationModeSync ReplicationMode = "sync"
ReplicationModeSyncMem ReplicationMode = "syncmem"
ReplicationModeAsync ReplicationMode = "async"
)

// +kubebuilder:validation:Enum=logreplay;delta_datashipping;logreplay_readaccess
type OperationMode string

const (
OperationModeLogReplay OperationMode = "logreplay"
OperationModeDeltaDataShipping OperationMode = "delta_datashipping"
OperationModeLogReplayReadAccess OperationMode = "logreplay_readaccess"
)

// +kubebuilder:validation:Enum=Standalone;SystemReplication
type HanaDBMode string

Expand Down Expand Up @@ -92,6 +111,10 @@ type HanaDBSpec struct {
// +optional
Configuration *ConfigurationSpec `json:"configuration,omitempty"`

// Monitor is used monitor database instance
// +optional
Monitor *mona.AgentSpec `json:"monitor,omitempty"`

// PodTemplate is an optional configuration for pods used to expose database
// +optional
PodTemplate *ofst.PodTemplateSpec `json:"podTemplate,omitempty"`
Expand All @@ -115,6 +138,23 @@ type HanaDBTopology struct {
// Mode specifies the deployment mode.
// +optional
Mode *HanaDBMode `json:"mode,omitempty"`

// SystemReplication defines configuration for SAP HANA system replication.
// +optional
SystemReplication *HanaDBSystemReplicationSpec `json:"systemReplication,omitempty"`
}

// HanaDBSystemReplicationSpec defines system replication configuration.
type HanaDBSystemReplicationSpec struct {
// ReplicationMode controls when transactions are committed relative to log shipping.
// +optional
// +kubebuilder:default=sync
ReplicationMode ReplicationMode `json:"replicationMode,omitempty"`

// OperationMode controls the log shipping/replay strategy on the secondary.
// +optional
// +kubebuilder:default=logreplay
OperationMode OperationMode `json:"operationMode,omitempty"`
}

// HanaDBStatus defines the observed state of HanaDB.
Expand Down
Loading
Loading