Skip to content

Commit 3b90625

Browse files
Merge pull request #537 from sathlan/old_versions
Add OpenStack OLM subscription configurations Ability to install a specific version of the operator(s) when multiple versions are available in the OLM catalog. Added new kustomization files and YAML configurations for OpenStack operator subscriptions using OLM. This includes catalog sources, namespaces, and operator groups for openstack-operators, as well as subscription definitions for the OpenStack components when the version is below v1.0.7. Kustomization facilitates version-specific configurations starting with v1.0.3 and v1.0.6, incorporating modifications like the elimination of the AnsibleEE operator in subsequent versions. From version 1.0.7 onwards, only the OpenStack operator is retained. For each overlay we define the same set of ConfigMap that reach a set of relevant parameter in the subscriptions and catalog source definitions. An unexpected mechanism here is that we override the common/olm-subscriptions/kustomization.yaml file from ci-framework for version v1.0.3 and v1.0.6. This enables the dynamic selection of the right overlay. For version v1.0.7 and beyond we used the default overlay and we don't need to overwrite the kustomization file. The problems that we cannot solve with just parameters are: v1.0.3 and v1.0.6 have a different set of subscriptions to include startingCSV parameter is "dynamic" as it's composed of the spec.name.version, not just version. Thus we cannot encode in a kustomize parameter without create our own transformer. As transformwer are not deployed here, it would be too much work to boostrap it. All this disapear starting with v1.0.7 where we have only one subscription to set. Resolves-Part-Of: OSPRH-15056 Reviewed-by: Andrew Bays <[email protected]> Reviewed-by: sathlan <[email protected]> Reviewed-by: John Fulton <[email protected]>
2 parents 9225e06 + 3d0f806 commit 3b90625

File tree

54 files changed

+1062
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1062
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# OLM subscription that are used for deploying specific versions.
2+
3+
To deploy a specific version rather than the latest from OLM images
4+
containing multiple version definitions, it is necessary to explicitly
5+
set the `startingCSV` parameter.
6+
7+
This kustomization setup accomplishes this for:
8+
- v1.0.3
9+
- v1.0.6: this version no longer includes the AnsibleEE operator
10+
- v1.0.7 and later: these versions only include the OpenStack operator
11+
12+
Refer to the `ci_gen_kustomize_values` role README for configuration
13+
details.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
components:
3+
- ../../../lib/olm-deps
4+
- ../../../lib/olm-openstack-subscriptions/overlays/default
5+
resources:
6+
- values.yaml
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# local-config: referenced, but not emitted by kustomize
2+
---
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
name: olm-values
7+
annotations:
8+
config.kubernetes.io/local-config: 'true'
9+
data:
10+
openstack-operator-channel: "alpha"
11+
openstack-operator-image: "quay.io/openstack-k8s-operators/openstack-operator-index:latest"
12+
openstack-operator-display-name: "CI Test"
13+
openstack-operator-installplanapproval: "Automatic"
14+
openstack-operator-publisher: "Testing Team"
15+
openstack-operator-catalog-source: "openstack-operator-index"
16+
openstack-operator-subscription-namespace: "openstack-operators"
17+
openstack-operator-version: "latest"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
apiVersion: operators.coreos.com/v1alpha1
3+
kind: CatalogSource
4+
metadata:
5+
name: openstack-operator-index
6+
namespace: openshift-marketplace
7+
labels:
8+
category: openstack-catalog
9+
spec:
10+
image: quay.io/openstack-k8s-operators/openstack-operator-index:latest
11+
sourceType: grpc
12+
displayName: CI Test
13+
publisher: Test Team
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
resources:
5+
- catalogsource.yaml
6+
- namespaces.yaml
7+
- operatorgroup.yaml
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: openstack-operators
6+
labels:
7+
pod-security.kubernetes.io/enforce: privileged
8+
security.openshift.io/scc.podSecurityLabelSync: "false"
9+
---
10+
apiVersion: v1
11+
kind: Namespace
12+
metadata:
13+
name: openstack
14+
labels:
15+
pod-security.kubernetes.io/enforce: privileged
16+
security.openshift.io/scc.podSecurityLabelSync: "false"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
apiVersion: operators.coreos.com/v1
3+
kind: OperatorGroup
4+
metadata:
5+
name: openstack
6+
namespace: openstack-operators
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1alpha1
3+
kind: Component
4+
5+
resources:
6+
- ../../base
7+
- openstack-subscription.yaml
8+
9+
replacements:
10+
# CatalogSource
11+
- source:
12+
kind: ConfigMap
13+
name: olm-values
14+
fieldPath: data.openstack-operator-image
15+
targets:
16+
- select:
17+
kind: CatalogSource
18+
labelSelector: category=openstack-catalog
19+
fieldPaths:
20+
- spec.image
21+
- source:
22+
kind: ConfigMap
23+
name: olm-values
24+
fieldPath: data.openstack-operator-publisher
25+
targets:
26+
- select:
27+
kind: CatalagSource
28+
labelSelector: category=openstack-catalog
29+
fieldPaths:
30+
- spec.publisher
31+
- source:
32+
kind: ConfigMap
33+
name: olm-values
34+
fieldPath: data.openstack-operator-display-name
35+
targets:
36+
- select:
37+
kind: CatalogSource
38+
labelSelector: category=openstack-catalog
39+
fieldPaths:
40+
- spec.displayName
41+
- source:
42+
kind: ConfigMap
43+
name: olm-values
44+
fieldPath: data.openstack-operator-catalog-source
45+
targets:
46+
- select:
47+
kind: CatalogSource
48+
labelSelector: category=openstack-catalog
49+
fieldPaths:
50+
- metadata.name
51+
# Subscriptions
52+
- source:
53+
kind: ConfigMap
54+
name: olm-values
55+
fieldPath: data.openstack-operator-channel
56+
targets:
57+
- select:
58+
kind: Subscription
59+
labelSelector: category=openstack-subscription
60+
fieldPaths:
61+
- spec.channel
62+
- source:
63+
kind: ConfigMap
64+
name: olm-values
65+
fieldPath: data.openstack-operator-installplanapproval
66+
targets:
67+
- select:
68+
kind: Subscription
69+
labelSelector: category=openstack-subscription
70+
fieldPaths:
71+
- spec.installPlanApproval
72+
- source:
73+
kind: ConfigMap
74+
name: olm-values
75+
fieldPath: data.openstack-operator-subscription-namespace
76+
targets:
77+
- select:
78+
kind: Subscription
79+
labelSelector: category=openstack-subscription
80+
fieldPaths:
81+
- metadata.namespace
82+
- source:
83+
kind: ConfigMap
84+
name: olm-values
85+
fieldPath: data.openstack-operator-catalog-source
86+
targets:
87+
- select:
88+
kind: Subscription
89+
labelSelector: category=openstack-subscription
90+
fieldPaths:
91+
- spec.source
92+
- source:
93+
kind: ConfigMap
94+
name: olm-values
95+
fieldPath: data.openstack-operator-version
96+
targets:
97+
- select:
98+
kind: Subscription
99+
labelSelector: category=openstack-subscription
100+
fieldPaths:
101+
- spec.startingCSV
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
apiVersion: operators.coreos.com/v1alpha1
3+
kind: Subscription
4+
metadata:
5+
name: openstack
6+
namespace: openstack-operators
7+
labels:
8+
category: openstack-subscription
9+
spec:
10+
channel: alpha
11+
installPlanApproval: Automatic
12+
name: openstack-operator
13+
source: openstack-operator-index
14+
sourceNamespace: openshift-marketplace
15+
startingCSV: openstack-operator.latest
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
apiVersion: operators.coreos.com/v1alpha1
3+
kind: Subscription
4+
metadata:
5+
name: barbican
6+
namespace: openstack-operators
7+
labels:
8+
category: openstack-subscription
9+
spec:
10+
channel: alpha
11+
installPlanApproval: Automatic
12+
name: barbican-operator
13+
source: openstack-operator-index
14+
sourceNamespace: openshift-marketplace
15+
startingCSV: barbican-operator.v1.0.3

0 commit comments

Comments
 (0)