Skip to content

Commit 6183f52

Browse files
committed
Add catsrc grpcPodConfig for nodeselector, priorityclass, tolerations
1 parent 566a1df commit 6183f52

File tree

7 files changed

+165
-8
lines changed

7 files changed

+165
-8
lines changed

_topic_maps/_topic_map.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,9 @@ Topics:
16611661
- Name: Using OLM on restricted networks
16621662
File: olm-restricted-networks
16631663
Distros: openshift-origin,openshift-enterprise
1664+
- Name: Catalog source pod scheduling
1665+
File: olm-cs-podsched
1666+
Distros: openshift-origin,openshift-enterprise
16641667
- Name: Managing platform Operators
16651668
File: olm-managing-po
16661669
Distros: openshift-enterprise,openshift-origin

modules/olm-catalogsource.adoc

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,24 @@ spec:
4343
sourceType: grpc <7>
4444
grpcPodConfig:
4545
securityContextConfig: <security_mode> <8>
46+
nodeSelector: <9>
47+
custom_label: <label>
48+
priorityClassName: system-cluster-critical <10>
49+
tolerations: <11>
50+
- key: "key1"
51+
operator: "Equal"
52+
value: "value1"
53+
effect: "NoSchedule"
4654
updateStrategy:
47-
registryPoll: <9>
55+
registryPoll: <12>
4856
interval: 30m0s
4957
status:
5058
connectionState:
5159
address: example-catalog.{global_ns}.svc:50051
5260
lastConnect: 2021-08-26T18:14:31Z
53-
lastObservedState: READY <10>
54-
latestImageRegistryPoll: 2021-08-26T18:46:25Z <11>
55-
registryService: <12>
61+
lastObservedState: READY <13>
62+
latestImageRegistryPoll: 2021-08-26T18:46:25Z <14>
63+
registryService: <15>
5664
createdAt: 2021-08-26T16:16:37Z
5765
port: 50051
5866
protocol: grpc
@@ -75,8 +83,11 @@ Set the `olm.catalogImageTemplate` annotation to your index image name and use o
7583
* `configmap`: OLM parses config map data and runs a pod that can serve the gRPC API over it.
7684
--
7785
<8> Specify the value of `legacy` or `restricted`. If the field is not set, the default value is `legacy`. In a future {product-title} release, it is planned that the default value will be `restricted`. If your catalog cannot run with `restricted` permissions, it is recommended that you manually set this field to `legacy`.
78-
<9> Automatically check for new versions at a given interval to stay up-to-date.
79-
<10> Last observed state of the catalog connection. For example:
86+
<9> Optional: For `grpc` type catalog sources, overrides the default node selector for the pod serving the content in `spec.image`, if defined.
87+
<10> Optional: For `grpc` type catalog sources, overrides the default priority class name for the pod serving the content in `spec.image`, if defined. Kubernetes provides `system-cluster-critical` and `system-node-critical` priority classes by default. Setting the field to empty (`""`) assigns the pod the default priority. Other priority classes can be defined manually.
88+
<11> Optional: For `grpc` type catalog sources, overrides the default tolerations for the pod serving the content in `spec.image`, if defined.
89+
<12> Automatically check for new versions at a given interval to stay up-to-date.
90+
<13> Last observed state of the catalog connection. For example:
8091
+
8192
--
8293
* `READY`: A connection is successfully established.
@@ -85,8 +96,8 @@ Set the `olm.catalogImageTemplate` annotation to your index image name and use o
8596
--
8697
+
8798
See link:https://grpc.github.io/grpc/core/md_doc_connectivity-semantics-and-api.html[States of Connectivity] in the gRPC documentation for more details.
88-
<11> Latest time the container registry storing the catalog image was polled to ensure the image is up-to-date.
89-
<12> Status information for the catalog's Operator Registry service.
99+
<14> Latest time the container registry storing the catalog image was polled to ensure the image is up-to-date.
100+
<15> Status information for the catalog's Operator Registry service.
90101
====
91102

92103
Referencing the `name` of a `CatalogSource` object in a subscription instructs OLM where to search to find a requested Operator:

modules/olm-node-selector.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * operators/admin/olm-cs-podsched.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="olm-node-selector_{context}"]
7+
= Overriding the node selector for catalog source pods
8+
9+
.Prequisites
10+
11+
* `CatalogSource` object of source type `grpc` with `spec.image` defined
12+
13+
.Procedure
14+
15+
* Edit the `CatalogSource` object and add or modify the `spec.grpcPodConfig` section to include the following:
16+
+
17+
[source,yaml]
18+
----
19+
grpcPodConfig:
20+
nodeSelector:
21+
custom_label: <label>
22+
----
23+
+
24+
where `<label>` is the label for the node selector that you want catalog source pods to use for scheduling.

modules/olm-priority-class-name.adoc

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * operators/admin/olm-cs-podsched.adoc
4+
5+
ifdef::openshift-origin[]
6+
:global_ns: olm
7+
endif::[]
8+
ifndef::openshift-origin[]
9+
:global_ns: openshift-marketplace
10+
endif::[]
11+
12+
:_content-type: PROCEDURE
13+
[id="olm-priority-class-name_{context}"]
14+
= Overriding the priority class name for catalog source pods
15+
16+
.Prequisites
17+
18+
* `CatalogSource` object of source type `grpc` with `spec.image` defined
19+
20+
.Procedure
21+
22+
* Edit the `CatalogSource` object and add or modify the `spec.grpcPodConfig` section to include the following:
23+
+
24+
[source,yaml]
25+
----
26+
grpcPodConfig:
27+
priorityClassName: <priority_class>
28+
----
29+
+
30+
where `<priority_class>` is one of the following:
31+
+
32+
--
33+
* One of the default priority classes provided by Kubernetes: `system-cluster-critical` or `system-node-critical`
34+
* An empty set (`""`) to assign the default priority
35+
* A pre-existing and custom defined priority class
36+
--
37+
38+
[NOTE]
39+
====
40+
Previously, the only pod scheduling parameter that could be overriden was `priorityClassName`. This was done by adding the `operatorframework.io/priorityclass` annotation to the `CatalogSource` object. For example:
41+
42+
[source,yaml,subs="attributes+"]
43+
----
44+
apiVersion: operators.coreos.com/v1alpha1
45+
kind: CatalogSource
46+
metadata:
47+
name: example-catalog
48+
namespace: namespace: {global_ns}
49+
annotations:
50+
operatorframework.io/priorityclass: system-cluster-critical
51+
----
52+
53+
If a `CatalogSource` object defines both the annotation and `spec.grpcPodConfig.priorityClassName`, the annotation takes precedence over the configuration parameter.
54+
====

modules/olm-tolerations.adoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * operators/admin/olm-cs-podsched.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="olm-tolerations_{context}"]
7+
= Overriding tolerations for catalog source pods
8+
9+
.Prequisites
10+
11+
* `CatalogSource` object of source type `grpc` with `spec.image` defined
12+
13+
.Procedure
14+
15+
* Edit the `CatalogSource` object and add or modify the `spec.grpcPodConfig` section to include the following:
16+
+
17+
[source,yaml]
18+
----
19+
grpcPodConfig:
20+
tolerations:
21+
- key: "<key_name>"
22+
operator: "<operator_type>"
23+
value: "<value>"
24+
effect: "<effect>"
25+
----

operators/admin/olm-cs-podsched.adoc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
:_content-type: ASSEMBLY
2+
[id="olm-cs-podsched"]
3+
= Catalog source pod scheduling
4+
include::_attributes/common-attributes.adoc[]
5+
:context: olm-cs-podsched
6+
7+
toc::[]
8+
9+
When an Operator Lifecycle Manager (OLM) catalog source of source type `grpc` defines a `spec.image`, the Catalog Operator creates a pod that serves the defined image content. By default, this pod defines the following in its spec:
10+
11+
* Only the `kubernetes.io/os=linux` node selector
12+
* No priority class name
13+
* No tolerations
14+
15+
As an administrator, you can override these values by modifying fields in the `CatalogSource` object's optional `spec.grpcPodConfig` section.
16+
17+
[role="_additional-resources"]
18+
.Additional resources
19+
20+
* xref:../../operators/understanding/olm/olm-understanding-olm.adoc#olm-catalogsource_olm-understanding-olm[OLM concepts and resources -> Catalog source]
21+
22+
include::modules/olm-node-selector.adoc[leveloffset=+1]
23+
[role="_additional-resources"]
24+
.Additional resources
25+
26+
* xref:../../nodes/scheduling/nodes-scheduler-node-selectors.adoc#nodes-scheduler-node-selectors[Placing pods on specific nodes using node selectors]
27+
28+
include::modules/olm-priority-class-name.adoc[leveloffset=+1]
29+
[role="_additional-resources"]
30+
.Additional resources
31+
32+
* xref:../../nodes/pods/nodes-pods-priority.adoc#admin-guide-priority-preemption-priority-class_nodes-pods-priority[Pod priority classes]
33+
34+
include::modules/olm-tolerations.adoc[leveloffset=+1]
35+
[role="_additional-resources"]
36+
.Additional resources
37+
38+
* xref:../../nodes/scheduling/nodes-scheduler-taints-tolerations.adoc#nodes-scheduler-taints-tolerations-about_nodes-scheduler-taints-tolerations[Understanding taints and tolerations]
39+

operators/understanding/olm/olm-understanding-olm.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ include::modules/olm-catalogsource.adoc[leveloffset=+2]
2222
* xref:../../../operators/understanding/olm/olm-understanding-dependency-resolution.adoc#olm-dependency-catalog-priority_olm-understanding-dependency-resolution[Catalog priority]
2323
* xref:../../../operators/admin/olm-status.adoc#olm-cs-status-cli_olm-status[Viewing Operator catalog source status by using the CLI]
2424
* xref:../../../authentication/understanding-and-managing-pod-security-admission.adoc#understanding-and-managing-pod-security-admission[Understanding and managing pod security admission]
25+
* xref:../../../operators/admin/olm-cs-podsched.adoc#olm-cs-podsched[Catalog source pod scheduling]
2526
2627
include::modules/olm-catalogsource-image-template.adoc[leveloffset=+3]
2728
include::modules/olm-subscription.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)