From 2e8ac31c8a18a4cb86ff6f58d75647a4faabb19a Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 21 Nov 2025 10:38:20 +0100 Subject: [PATCH 1/6] Add objectOverrides concepts page --- modules/concepts/pages/overrides.adoc | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/modules/concepts/pages/overrides.adoc b/modules/concepts/pages/overrides.adoc index 94a497bfa..da0d61f42 100644 --- a/modules/concepts/pages/overrides.adoc +++ b/modules/concepts/pages/overrides.adoc @@ -151,6 +151,58 @@ They will *not* be applied to: * Jobs, that are used to setup systems the product depends on e.g. create a database schema for Superset or Airflow. +[#object-overrides] +== Object overrides + +Sometime you need to override Kubernetes objects other than the generated Pods, e.g. ServiceAccounts or the StatefulSet/Deployment/DaemonSet. +Object overrides allow you to override any Kubernetes object the operator creates are part of it's reconciliation loop, which basically means all objects that are created for a given stacklet. + +On every Stackable CRD that get's reconciled into a set of Kubernetes objects we offer a field `.spec.objectOverrides`. +You can set it to a list of arbitrary YAML objects, which need to be valid Kubernetes objects. + +For every object it creates, the operator will walk the list of overrides from top to bottom. +It will than first check if the override matches the object being created using apiVersion, kind, name and namespace (if set - doesn't need to be the case for cluster scoped objects). +If the override matches, it will be merged in the same way Pod overrides are merged, using the merge algorithm described in the {k8s-openapi-deepmerge}[k8s-openapi docs{external-link-icon}^], which basically tries to mimic the way Kubernetes merges patches onto objects. + +A consequence of this is, that you can only modify objects the operator creates, and not deploy any additional arbitrary objects. + +[source,yaml] +---- +apiVersion: zookeeper.stackable.tech/v1alpha1 +kind: ZookeeperCluster +metadata: + name: simple-zk +spec: + # ... + objectOverrides: + - apiVersion: apps/v1 + kind: StatefulSet + metadata: + name: simple-zk-server-default + namespace: default + labels: + custom: label + spec: + replicas: 2 + podManagementPolicy: Parallel + - apiVersion: v1 + kind: ServiceAccount + metadata: + name: simple-zk-serviceaccount + namespace: default + labels: + im-on: AWS + annotations: + custom: AWS + - apiVersion: policy/v1 + kind: PodDisruptionBudget + metadata: + name: simple-zk-server + namespace: default + spec: + maxUnavailable: 42 +---- + [#jvm-argument-overrides] == JVM argument overrides From 8c213a3a54ed666d43edceea10fa244d7c4aace8 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Sun, 23 Nov 2025 17:45:08 +0100 Subject: [PATCH 2/6] Update modules/concepts/pages/overrides.adoc Co-authored-by: Malte Sander --- modules/concepts/pages/overrides.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/concepts/pages/overrides.adoc b/modules/concepts/pages/overrides.adoc index da0d61f42..42c169c97 100644 --- a/modules/concepts/pages/overrides.adoc +++ b/modules/concepts/pages/overrides.adoc @@ -160,11 +160,11 @@ Object overrides allow you to override any Kubernetes object the operator create On every Stackable CRD that get's reconciled into a set of Kubernetes objects we offer a field `.spec.objectOverrides`. You can set it to a list of arbitrary YAML objects, which need to be valid Kubernetes objects. -For every object it creates, the operator will walk the list of overrides from top to bottom. -It will than first check if the override matches the object being created using apiVersion, kind, name and namespace (if set - doesn't need to be the case for cluster scoped objects). -If the override matches, it will be merged in the same way Pod overrides are merged, using the merge algorithm described in the {k8s-openapi-deepmerge}[k8s-openapi docs{external-link-icon}^], which basically tries to mimic the way Kubernetes merges patches onto objects. +For every resource it creates, the operator processes the list of overrides from top to bottom. +It first checks if an override matches the resource being created by comparing the `apiVersion`, `kind`, `name` and if applicable `namespace` (cluster-scoped resources may omit the namespace). +If an override matches, it is merged using the same mechanism as Pod overrides, using the merge algorithm described in the {k8s-openapi-deepmerge}[k8s-openapi docs{external-link-icon}^], which closely mimics the way Kubernetes applies patches to resources. -A consequence of this is, that you can only modify objects the operator creates, and not deploy any additional arbitrary objects. +As a result, you can only modify resources created by the operator. This mechanism does not work to deploy any additional arbitrary Kubernetes resources. [source,yaml] ---- From 7ce83e1c4a0b077dff162e0896fdadd5815051e2 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Sun, 23 Nov 2025 17:47:49 +0100 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: Malte Sander --- modules/concepts/pages/overrides.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/concepts/pages/overrides.adoc b/modules/concepts/pages/overrides.adoc index 42c169c97..0553612e3 100644 --- a/modules/concepts/pages/overrides.adoc +++ b/modules/concepts/pages/overrides.adoc @@ -155,10 +155,10 @@ They will *not* be applied to: == Object overrides Sometime you need to override Kubernetes objects other than the generated Pods, e.g. ServiceAccounts or the StatefulSet/Deployment/DaemonSet. -Object overrides allow you to override any Kubernetes object the operator creates are part of it's reconciliation loop, which basically means all objects that are created for a given stacklet. +Object overrides let you modify any Kubernetes resource that the operator creates as part of its reconciliation loop, which essentially includes all objects associated with a given stacklet. -On every Stackable CRD that get's reconciled into a set of Kubernetes objects we offer a field `.spec.objectOverrides`. -You can set it to a list of arbitrary YAML objects, which need to be valid Kubernetes objects. +On every Stackable CRD that is reconciled into a set of Kubernetes objects we provide the field `.spec.objectOverrides`. +This field accepts a list of arbitrary YAML objects, each of which must be a valid Kubernetes resource. For every resource it creates, the operator processes the list of overrides from top to bottom. It first checks if an override matches the resource being created by comparing the `apiVersion`, `kind`, `name` and if applicable `namespace` (cluster-scoped resources may omit the namespace). From 953527c31b9b868801e74594bd6a3443b3ac4c2f Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Sun, 23 Nov 2025 17:49:20 +0100 Subject: [PATCH 4/6] Update modules/concepts/pages/overrides.adoc Co-authored-by: Malte Sander --- modules/concepts/pages/overrides.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/concepts/pages/overrides.adoc b/modules/concepts/pages/overrides.adoc index 0553612e3..8a98abf1c 100644 --- a/modules/concepts/pages/overrides.adoc +++ b/modules/concepts/pages/overrides.adoc @@ -154,7 +154,7 @@ They will *not* be applied to: [#object-overrides] == Object overrides -Sometime you need to override Kubernetes objects other than the generated Pods, e.g. ServiceAccounts or the StatefulSet/Deployment/DaemonSet. +Sometimes you need to override Kubernetes objects other than the generated Pods, e.g. ServiceAccounts or the StatefulSet/Deployment/DaemonSet. Object overrides let you modify any Kubernetes resource that the operator creates as part of its reconciliation loop, which essentially includes all objects associated with a given stacklet. On every Stackable CRD that is reconciled into a set of Kubernetes objects we provide the field `.spec.objectOverrides`. From f58df33d9932277b99544ccd0695289ebd6fa43c Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Mon, 24 Nov 2025 10:51:47 +0100 Subject: [PATCH 5/6] Reword first sentence according to suggestion --- modules/concepts/pages/overrides.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/concepts/pages/overrides.adoc b/modules/concepts/pages/overrides.adoc index 8a98abf1c..8b9fc29c6 100644 --- a/modules/concepts/pages/overrides.adoc +++ b/modules/concepts/pages/overrides.adoc @@ -154,7 +154,7 @@ They will *not* be applied to: [#object-overrides] == Object overrides -Sometimes you need to override Kubernetes objects other than the generated Pods, e.g. ServiceAccounts or the StatefulSet/Deployment/DaemonSet. +Sometimes you need to override Kubernetes objects that are not covered by e.g. `podOverrides` or `configOverrides` like ServiceAccounts or the StatefulSet/Deployment/DaemonSet. Object overrides let you modify any Kubernetes resource that the operator creates as part of its reconciliation loop, which essentially includes all objects associated with a given stacklet. On every Stackable CRD that is reconciled into a set of Kubernetes objects we provide the field `.spec.objectOverrides`. From 165ab922a212a6e43a6c253b4789376a39636923 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Mon, 24 Nov 2025 12:18:41 +0100 Subject: [PATCH 6/6] resource -> object --- modules/concepts/pages/overrides.adoc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/concepts/pages/overrides.adoc b/modules/concepts/pages/overrides.adoc index 8b9fc29c6..24179992a 100644 --- a/modules/concepts/pages/overrides.adoc +++ b/modules/concepts/pages/overrides.adoc @@ -155,16 +155,17 @@ They will *not* be applied to: == Object overrides Sometimes you need to override Kubernetes objects that are not covered by e.g. `podOverrides` or `configOverrides` like ServiceAccounts or the StatefulSet/Deployment/DaemonSet. -Object overrides let you modify any Kubernetes resource that the operator creates as part of its reconciliation loop, which essentially includes all objects associated with a given stacklet. +Object overrides let you modify any Kubernetes object that the operator creates as part of its reconciliation loop, which essentially includes all objects associated with a given stacklet. On every Stackable CRD that is reconciled into a set of Kubernetes objects we provide the field `.spec.objectOverrides`. -This field accepts a list of arbitrary YAML objects, each of which must be a valid Kubernetes resource. +This field accepts a list of arbitrary YAML objects, each of which must be a valid Kubernetes object. -For every resource it creates, the operator processes the list of overrides from top to bottom. -It first checks if an override matches the resource being created by comparing the `apiVersion`, `kind`, `name` and if applicable `namespace` (cluster-scoped resources may omit the namespace). -If an override matches, it is merged using the same mechanism as Pod overrides, using the merge algorithm described in the {k8s-openapi-deepmerge}[k8s-openapi docs{external-link-icon}^], which closely mimics the way Kubernetes applies patches to resources. +For every object it creates, the operator processes the list of overrides from top to bottom. +It first checks if an override matches the object being created by comparing the `apiVersion`, `kind`, `name` and if applicable `namespace` (cluster-scoped objects may omit the namespace). +If an override matches, it is merged using the same mechanism as Pod overrides, using the merge algorithm described in the {k8s-openapi-deepmerge}[k8s-openapi docs{external-link-icon}^], which closely mimics the way Kubernetes applies patches to object. -As a result, you can only modify resources created by the operator. This mechanism does not work to deploy any additional arbitrary Kubernetes resources. +As a result, you can only modify object created by the operator. +This mechanism does not work to deploy any additional arbitrary Kubernetes object. [source,yaml] ----