Skip to content

Commit fe8d9bb

Browse files
committed
feat: add design docs for including additional objects in bundles
1 parent 54dd65a commit fe8d9bb

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Adding Pod Disruption Budgets
2+
3+
## Description
4+
5+
OLM supports users including `PodDisruptionBudget` (PDB) objects in their bundle alongside their operator manifests. `PodDisruptionBudgets`
6+
are used to provide detailed information to the kube-scheduler about how many pods in a collection can be available or unavailable at given time.
7+
For more info, see the docs at https://kubernetes.io/docs/tasks/run-application/configure-pdb/#protecting-an-application-with-a-poddisruptionbudget.
8+
9+
## Caveats
10+
11+
PDBs are namespaced resources that only affect certain pods selected by the pod selector. However,
12+
setting `maxUnavailable` to 0 or 0% (or `minAvailable` to 100%) on the PDB means zero voluntary evictions.
13+
This can make a node impossible to drain and block important lifecycle actions like operator upgrades or even cluster upgrades.
14+
15+
Multiple PDBs can exist in one namespace- this can cause conflicts. Be sure to know of existing PDBs in the namespace in which
16+
your operator and operands will exist in the cluster.
17+
18+
PDBs for pods controlled by operators have additional restrictions around them. See https://kubernetes.io/docs/tasks/run-application/configure-pdb/#arbitrary-controllers-and-selectors
19+
for additional details - PDBs for operands managed by OLM-installed operators will fall into these restrictions.
20+
21+
## Conclusions
22+
23+
PDBs are useful for configuring how many operator replicas or operands should run at any given time. However, it's important
24+
to set reasonable values for any PDBs included in the bundle and carefully consider how the PDB can affect the lifecycle of other resources
25+
in the cluster, such as nodes, to ensure cluster autoscaling and cluster upgrades are able to proceed if they are enabled.

doc/design/adding-priority-classes.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Adding Priority Classes
2+
3+
## Description
4+
5+
OLM supports users including `PriorityClass` objects in their bundle alongside their operator manifests. `PriorityClass`
6+
is used to establish a priority, or weight, to a collection of pods in order to aid the kube-scheduler when assigning pods
7+
to nodes. For more info, see the docs at https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass.
8+
9+
## Caveats
10+
11+
`PriorityClass` objects are clusterwide in scope, meaning they can affect the scheduling of pods in all namespaces. All pods
12+
have a default priority of zero, and only those pods explicitly selected by the `PriorityClass` object will be given a priority when created.
13+
Existing pods running on the cluster are not affected by a new `PriorityClass`, but since clusters are dynamic and pods can be
14+
rescheduled as nodes cycle in and out, a `PriorityClass` can have an impact on the long term behavior of the cluster.
15+
16+
Exactly one `PriorityClass` object is allowed to have the `globalDefault` setting set to true - this means that all pods on the cluster
17+
without an explicit priority class will use this default `PriorityClass`. Make sure you understand the effects of setting a global
18+
priority for pods running in the cluster before setting a `PriorityClass` as the `globalDefault`.
19+
20+
Pods with higher priorities can preempt pods with lower priorities when they are being scheduled onto nodes: preemption can result in lower-priority pods being evicted to make room for the higher priority pod.
21+
If the `PriorityClass` of the pod is extremely high (higher than the priority of core components) scheduling the pod can potentially disrupt core components running in the cluster.
22+
23+
Once a `PriorityClass` is removed, no further pods can be created that reference the deleted `PriorityClass`.
24+
25+
## Conclusion
26+
27+
`PriorityClasses` are useful but also potentially far-reaching in nature. Be sure to understand the state of your cluster and
28+
your scheduling requirements before including one in your bundle alongside your operator. Best practice would be to
29+
include a `PriorityClass` that only affects pods like your operator deployment and the respective operands. Setting the `globalDefault`
30+
on a `PriorityClass` to true is not advised in the general sense that it affects all pods scheduled in the cluster, whether or not
31+
they are in the scope of your operator bundle.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Adding Vertical Pod Autoscaler
2+
3+
## Description
4+
5+
OLM supports users including `VerticalPodAutoscaler` (VPA) objects in their bundle alongside their operator manifests. `VerticalPodAutoscalers`
6+
objects are used to configure the VerticalPodAutoscaler controller to dynamically allocate resources to pods based on their usage of CPU, memory,
7+
and other custom metrics. VPAs allow for more efficient use of cluster resources as pod resource needs are continually evaluated and adjusted by the VPA controller.
8+
For more info, see the docs at https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler.
9+
10+
## Caveats
11+
12+
`VerticalPodAutoscaler` objects watch a controller reference, such as deployment, to find a collection of pods to resize. Be sure to pass
13+
the appropriate reference to your operator or operands depending on which you would like the VPA to watch.
14+
15+
The VerticalPodAutoscaler controller must be enabled and active in the cluster for the VPA objects included in the bundle to have an effect.
16+
17+
The VPA will continually terminate pods and adjust the resource limits as needed - be sure your application is tolerant of restarts
18+
before including a VPA alongside it.
19+
20+
Note: at this time it is not recommended for the VPA to run alongside the HorizontalPodAutoscaler.
21+
22+
## Conclusion
23+
24+
Adding a VPA object in your bundle can lead to more efficient use of resource in your cluster. Best practices include limiting
25+
the VPA to only the objects associated with your bundle. Consider your existing autoscaling setup in the cluster before adding
26+
VPA objects to a bundle and installing the bundle on the cluster.

0 commit comments

Comments
 (0)