New to KubeDB? Please start here.
Using Custom Configuration File
KubeDB supports user-provided SAP HANA configuration. This tutorial shows how to run HanaDB with a custom global.ini file.
Before You Begin
Prepare a Kubernetes cluster and configure
kubectlto communicate with it. If you do not already have a cluster, you can create one by using kind.Install the KubeDB CLI on your workstation and the KubeDB operator in your cluster by following the steps here.
To keep things isolated, this tutorial uses a separate namespace called
demothroughout this tutorial.
$ kubectl create ns demo
namespace/demo created
Note: YAML files used in this tutorial are stored in docs/examples/hanadb/configuration folder in GitHub repository kubedb/docs.
Overview
KubeDB supports custom HanaDB configuration through a user-provided global.ini file. The spec.configuration.secretName field lets you provide this configuration without manually mounting any volume into the pod.
To apply custom configuration, you create a Kubernetes Secret containing your custom config file and provide its name in spec.configuration.secretName. The operator reads this Secret internally and applies the configuration automatically.
In this tutorial, you configure global.ini with a custom memory allocation limit.
Custom Configuration
Create a Secret that contains a custom global.ini file:
apiVersion: v1
kind: Secret
metadata:
name: hanadb-configuration
namespace: demo
stringData:
global.ini: |
[memorymanager]
global_allocation_limit = 8589934592
$ kubectl apply -f https://github.com/kubedb/docs/raw/v2026.4.27/docs/examples/hanadb/configuration/hanadb-configuration.yaml
secret/hanadb-configuration created
Verify the Secret has the configuration file.
$ kubectl get secret -n demo hanadb-configuration -o yaml
apiVersion: v1
data:
global.ini: <base64-encoded-content>
kind: Secret
metadata:
name: hanadb-configuration
namespace: demo
Create a HanaDB object with spec.configuration.secretName set to the Secret name.
apiVersion: kubedb.com/v1alpha2
kind: HanaDB
metadata:
name: hanadb-custom-config
namespace: demo
spec:
version: "2.0.82"
replicas: 1
configuration:
secretName: hanadb-configuration
storageType: Durable
storage:
storageClassName: local-path
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 64Gi
deletionPolicy: WipeOut
$ kubectl apply -f https://github.com/kubedb/docs/raw/v2026.4.27/docs/examples/hanadb/configuration/custom-hanadb.yaml
hanadb.kubedb.com/hanadb-custom-config created
Wait for the HanaDB instance to become ready.
$ kubectl get hanadb -n demo hanadb-custom-config
NAME VERSION STATUS AGE
hanadb-custom-config 2.0.82 Ready 5m
Check that the pod is running:
$ kubectl get pod -n demo hanadb-custom-config-0
NAME READY STATUS RESTARTS AGE
hanadb-custom-config-0 1/1 Running 0 5m
Check whether the database started with the custom configuration by running hdbsql inside the pod.
$ kubectl exec -it -n demo hanadb-custom-config-0 -- hdbsql \
-u SYSTEM -p <password> \
"SELECT KEY, VALUE FROM SYS.M_INIFILE_CONTENTS WHERE FILE_NAME = 'global.ini' AND KEY = 'global_allocation_limit'"
KEY VALUE
global_allocation_limit 8589934592
This guide covers initial custom configuration during provisioning.
Cleaning up
To clean up the Kubernetes resources created by this tutorial, run:
kubectl patch -n demo hanadb/hanadb-custom-config -p '{"spec":{"deletionPolicy":"WipeOut"}}' --type="merge"
kubectl delete -n demo hanadb/hanadb-custom-config
kubectl delete -n demo secret hanadb-configuration
kubectl delete ns demo































