Skip to content

Commit b68d2bd

Browse files
authored
Merge pull request #497 from mbaldessari/acm-iib-overrides
acm iib overrides
2 parents 72a8b26 + 8119368 commit b68d2bd

4 files changed

Lines changed: 48 additions & 8 deletions

File tree

acm/templates/multiclusterhub.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
{{- $channel := "" }}
2+
{{- if .Values.acm.mce_operator.channel }}
3+
{{- $channel = printf ",\"channel\": \"%s\"" .Values.acm.mce_operator.channel }}
4+
{{- end }}
15
apiVersion: operator.open-cluster-management.io/v1
26
kind: MultiClusterHub
37
metadata:
48
name: multiclusterhub
59
namespace: open-cluster-management
610
annotations:
711
argocd.argoproj.io/sync-wave: "-1"
8-
{{- if kindIs "map" .Values.clusterGroup.subscriptions }}
9-
installer.open-cluster-management.io/mce-subscription-spec: '{"source": "{{ default "redhat-operators" .Values.clusterGroup.subscriptions.acm.source }}" }'
10-
{{- end }}
12+
installer.open-cluster-management.io/mce-subscription-spec: '{"source": "{{ default "redhat-operators" .Values.acm.mce_operator.source }}" {{- $channel }} }'
1113
spec: {}

acm/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ clusterGroup:
3030
# - name: clusterGroup
3131
# value: region-one
3232

33+
acm:
34+
# Just used for IIB testing, drives the source and channel for the MCE
35+
# subscription triggered by ACM
36+
mce_operator:
37+
source: redhat-operators
38+
channel: null
39+
40+
41+
3342
secretStore:
3443
name: vault-backend
3544
kind: ClusterSecretStore

ansible/roles/iib_ci/README.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,51 @@ oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patc
3838
oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"emptyDir":{}}}}'
3939
```
4040

41+
### Gitops operator
42+
4143
Then in case of the `openshift-gitops-operator` we would install with:
4244

4345
```sh
4446
export CHANNEL=$(oc get -n openshift-marketplace packagemanifests -l "catalog=iib-${IIB}" --field-selector "metadata.name=${OPERATOR}" -o jsonpath='{.items[0].status.defaultChannel}')
4547
make EXTRA_HELM_OPTS="--set main.gitops.operatorSource=iib-${IIB} --set main.gitops.channel=${CHANNEL}" install
4648
```
4749

48-
To install ACM (`export OPERATOR=advanced-cluster-management`) or any other
49-
operator (except the gitops one) from an IIB we would call the following as a
50-
final step:
50+
### ACM operator
51+
52+
The advanced-cluster-management operator is a little bit more complex than the others because it
53+
also installes another operator called MCE multicluster-engine. So to install ACM you typically
54+
need two IIBs (one for acm and one for mce). With those two at hand, do the following (the ordering must be
55+
consistent: the first IIB corresponds to the first OPERATOR, etc).
56+
57+
```sh
58+
export OPERATOR=advanced-cluster-management,multicluster-engine
59+
export INDEX_IMAGES=registry-proxy.engineering.redhat.com/rh-osbs/iib:713808,registry-proxy.engineering.redhat.com/rh-osbs/iib:718034
60+
make load-iib
61+
```
62+
63+
Once the IIBs are loaded into the cluster we need to run the following steps:
64+
65+
```sh
66+
export ACM_CHANNEL=$(oc get -n openshift-marketplace packagemanifests -l "catalog=iib-713808" --field-selector "metadata.name=advanced-cluster-management" -o jsonpath='{.items[0].status.defaultChannel}')
67+
export MCE_CHANNEL=$(oc get -n openshift-margetplace packagemanifests -l "catalog=iib-718034" --field-selector "metadata.name=multicluster-engine" -o jsonpath='{.items[0].status.defaultChannel}')
68+
make EXTRA_HELM_OPTS="--set main.extraParameters[0].name=clusterGroup.subscriptions.acm.source --set main.extraParameters[0].value=iib-713808 \
69+
--set main.extraParameters[1].name=clusterGroup.subscriptions.acm.channel --set main.extraParameters[1].value=${ACM_CHANNEL} \
70+
--set main.extraParameters[2].name=acm.mce_operator.source --set main.extraParameters[2].value="iib-718034" \
71+
--set main.extraParameters[3].name=acm.mce_operator.channel --set main.extraParameters[3].value=${MCE_CHANNEL}" install
72+
```
73+
74+
*Note*: In this case the `acm` in `clusterGroup.subscriptions.acm.*` is the name of the key in the subscriptions in `values-hub.yaml`
75+
76+
### Other operators
77+
78+
To install operators other than gitops and acm do the following:
5179

5280
```sh
5381
export CHANNEL=$(oc get -n openshift-marketplace packagemanifests -l "catalog=iib-${IIB}" --field-selector "metadata.name=${OPERATOR}" -o jsonpath='{.items[0].status.defaultChannel}')
54-
make EXTRA_HELM_OPTS="--set main.extraParameters[0].name=clusterGroup.subscriptions.acm.source --set main.extraParameters[0].value=iib-${IIB} --set main.extraParameters[1].name=clusterGroup.subscriptions.acm.channel --set main.extraParameters[1].value=${CHANNEL}" install
82+
make EXTRA_HELM_OPTS="--set main.extraParameters[0].name=clusterGroup.subscriptions.<subname>.source --set main.extraParameters[0].value=iib-${IIB} --set main.extraParameters[1].name=clusterGroup.subscriptions.<subname>.channel --set main.extraParameters[1].value=${CHANNEL}" install
5583
```
5684

57-
*Note*: In this case `acm` is the name of the subscription in `values-hub.yaml`
85+
*Note*: Replace `<subname>` with the actual name of the subscription dictionary in `values-hub.yaml`
5886

5987
## Useful commands
6088

tests/acm-industrial-edge-factory.expected.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ metadata:
2222
namespace: open-cluster-management
2323
annotations:
2424
argocd.argoproj.io/sync-wave: "-1"
25+
installer.open-cluster-management.io/mce-subscription-spec: '{"source": "redhat-operators" }'
2526
spec: {}
2627
---
2728
# Source: acm/templates/policies/ocp-gitops-policy.yaml

0 commit comments

Comments
 (0)