Skip to content

Commit 51daad6

Browse files
committed
Add cluster runtime constraints handling
Signed-off-by: Per G. da Silva <[email protected]>
1 parent dc5f6de commit 51daad6

5 files changed

+29
-0
lines changed

manifests/0000_50_olm_08-catalog-operator.deployment.ibm-cloud-managed.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ spec:
7878
env:
7979
- name: RELEASE_VERSION
8080
value: "0.0.1-snapshot"
81+
- name: RUNTIME_CONSTRAINTS
82+
value: "/opt/olm/runtime_constraints.json"
8183
nodeSelector:
8284
kubernetes.io/os: linux
8385
tolerations:

manifests/0000_50_olm_08-catalog-operator.deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ spec:
7979
env:
8080
- name: RELEASE_VERSION
8181
value: "0.0.1-snapshot"
82+
- name: RUNTIME_CONSTRAINTS
83+
value: "/opt/olm/runtime_constraints.json"
8284
nodeSelector:
8385
kubernetes.io/os: linux
8486
node-role.kubernetes.io/master: ""

operator-lifecycle-manager.Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ COPY --from=builder /build/bin/package-server /bin/package-server
2727
COPY --from=builder /build/bin/cpb /bin/cpb
2828
COPY --from=builder /build/bin/psm /bin/psm
2929

30+
# Add runtime constraints
31+
COPY --from=builder /build/runtime_constraints/runtime_constraints.json /opt/olm/runtime_constraints.json
32+
3033
# This image doesn't need to run as root user.
3134
USER 1001
3235

runtime_constraints/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Cluster Runtime Constraints
2+
3+
Cluster runtime constraints are base constraints that always get applied to the resolution process to avoid installing
4+
packages that might be unsuitable for the cluster (consumes too many resources, wrong kubernetes/ocp version, etc.).
5+
Currently, there's no first class way to do this. Until we design the canonical way to define
6+
cluster runtime constraints, we are making availing a stopgap solution for IBM and OCP, we:
7+
1. Are adding a file to the downstream OLM image that includes the runtime constraints
8+
2. Have modified the upstream catalog operator to load the runtime constraints in to the resolver if a `RUNTIME_CONSTRAINTS` environment variable is defined
9+
3. Update the deployment manifests for the olm catalog operator deployment to add the `RUNTIME_CONSTRAINTS` environment variable
10+
11+
The upstream PR enabling this behavior is [https://github.com/operator-framework/operator-lifecycle-manager/pull/2498](#2498).
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"properties": [
3+
{
4+
"type": "olm.package",
5+
"value": {
6+
"packageName": "etcd",
7+
"version": "1.0.0"
8+
}
9+
}
10+
]
11+
}

0 commit comments

Comments
 (0)