Skip to content

Commit 2e8ac31

Browse files
committed
Add objectOverrides concepts page
1 parent c307237 commit 2e8ac31

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

modules/concepts/pages/overrides.adoc

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,58 @@ They will *not* be applied to:
151151

152152
* Jobs, that are used to setup systems the product depends on e.g. create a database schema for Superset or Airflow.
153153
154+
[#object-overrides]
155+
== Object overrides
156+
157+
Sometime you need to override Kubernetes objects other than the generated Pods, e.g. ServiceAccounts or the StatefulSet/Deployment/DaemonSet.
158+
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.
159+
160+
On every Stackable CRD that get's reconciled into a set of Kubernetes objects we offer a field `.spec.objectOverrides`.
161+
You can set it to a list of arbitrary YAML objects, which need to be valid Kubernetes objects.
162+
163+
For every object it creates, the operator will walk the list of overrides from top to bottom.
164+
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).
165+
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.
166+
167+
A consequence of this is, that you can only modify objects the operator creates, and not deploy any additional arbitrary objects.
168+
169+
[source,yaml]
170+
----
171+
apiVersion: zookeeper.stackable.tech/v1alpha1
172+
kind: ZookeeperCluster
173+
metadata:
174+
name: simple-zk
175+
spec:
176+
# ...
177+
objectOverrides:
178+
- apiVersion: apps/v1
179+
kind: StatefulSet
180+
metadata:
181+
name: simple-zk-server-default
182+
namespace: default
183+
labels:
184+
custom: label
185+
spec:
186+
replicas: 2
187+
podManagementPolicy: Parallel
188+
- apiVersion: v1
189+
kind: ServiceAccount
190+
metadata:
191+
name: simple-zk-serviceaccount
192+
namespace: default
193+
labels:
194+
im-on: AWS
195+
annotations:
196+
custom: AWS
197+
- apiVersion: policy/v1
198+
kind: PodDisruptionBudget
199+
metadata:
200+
name: simple-zk-server
201+
namespace: default
202+
spec:
203+
maxUnavailable: 42
204+
----
205+
154206
[#jvm-argument-overrides]
155207
== JVM argument overrides
156208

0 commit comments

Comments
 (0)