-
-
Notifications
You must be signed in to change notification settings - Fork 13
Add objectOverrides concepts page #807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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. | ||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| On every Stackable CRD that get's reconciled into a set of Kubernetes objects we offer a field `.spec.objectOverrides`. | ||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
| You can set it to a list of arbitrary YAML objects, which need to be valid Kubernetes objects. | ||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| 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. | ||||||||||||||||||||||
|
Comment on lines
+163
to
+167
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| [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 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean PodSpec / PodOverrides? I would write that.