Skip to content

Commit c944d8a

Browse files
authored
OCPQE-31277: Enable MetalLB operator installation via Konflux for HyperShift agent clusters (#73131)
* Use Konflux for installing metallb This is not available in qe-app-registry for 4.21 anymore. * Use combined image-content-sources for hosted cluster Some steps running against the management cluster configure the deprecated ImageContentSourcePolicy, some configure the newer ImageDigestMirrorSet. This commit ensures that these ICSP/IDSM are combined and used together in the hosted cluster. * Add MetalLB CatalogSource step for HyperShift agent clusters Create hypershift-agent-create-metallb-catalogsource step that sets up the Konflux-based MetalLB operator catalog on nested clusters. Supports both connected and disconnected environments. This step is required because the hosted cluster needs its own CatalogSource as the MetalLB operator is installed from it. Similarly to steps enable-qe-catalogsource and cucushift-hypershift-extended-enable-qe-catalogsource, there is a step deploy-konflux-operator running on the management cluster that sets up cluster pull secrets and IDMS/ICSP for Konflux. The pull secret and IDMS/ICSP are passed when creating a hosted cluster. This new step hypershift-agent-create-metallb-catalogsource then only configures the catalog source (secrets and IDMS/ICSP are already set up) on the hosted cluster. * Update related chains and workflows Make sure Konflux is only used for 4.21 * Remove imain from hypershift/agent and add jparrill
1 parent ac7793f commit c944d8a

22 files changed

+226
-38
lines changed

ci-operator/config/openshift/hypershift/openshift-hypershift-release-4.21__periodics-mce.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,12 @@ tests:
8787
NUM_EXTRA_WORKERS=3
8888
PROVISIONING_NETWORK_PROFILE=Disabled
8989
REDFISH_EMULATOR_IGNORE_BOOT_DEVICE=True
90+
KONFLUX_DEPLOY_CATALOG_SOURCE: "true"
91+
KONFLUX_DEPLOY_OPERATORS: "true"
9092
LVM_OPERATOR_SUB_CHANNEL: stable-4.21
9193
LVM_OPERATOR_SUB_SOURCE: lvm-catalogsource
9294
MCE_VERSION: "2.11"
95+
METALLB_OPERATOR_SUB_SOURCE: metallb-konflux
9396
PACKET_METRO: dc
9497
workflow: hypershift-mce-agent-metal3-conformance
9598
- as: e2e-agent-connected-ovn-dualstack-metal-conformance
@@ -107,9 +110,12 @@ tests:
107110
PROVISIONING_NETWORK_PROFILE=Disabled
108111
REDFISH_EMULATOR_IGNORE_BOOT_DEVICE=True
109112
IP_STACK: v4v6
113+
KONFLUX_DEPLOY_CATALOG_SOURCE: "true"
114+
KONFLUX_DEPLOY_OPERATORS: "true"
110115
LVM_OPERATOR_SUB_CHANNEL: stable-4.21
111116
LVM_OPERATOR_SUB_SOURCE: lvm-catalogsource
112117
MCE_VERSION: "2.11"
118+
METALLB_OPERATOR_SUB_SOURCE: metallb-konflux
113119
PACKET_METRO: dc
114120
workflow: hypershift-mce-agent-metal3-conformance
115121
- as: e2e-agent-connected-ovn-ipv4-metal-compact-conformance
@@ -130,9 +136,12 @@ tests:
130136
NUM_EXTRA_WORKERS=3
131137
PROVISIONING_NETWORK_PROFILE=Disabled
132138
REDFISH_EMULATOR_IGNORE_BOOT_DEVICE=True
139+
KONFLUX_DEPLOY_CATALOG_SOURCE: "true"
140+
KONFLUX_DEPLOY_OPERATORS: "true"
133141
LVM_OPERATOR_SUB_CHANNEL: stable-4.21
134142
LVM_OPERATOR_SUB_SOURCE: lvm-catalogsource
135143
MCE_VERSION: "2.11"
144+
METALLB_OPERATOR_SUB_SOURCE: metallb-konflux
136145
PACKET_METRO: dc
137146
workflow: hypershift-mce-agent-metal3-conformance
138147
- as: e2e-agent-disconnected-ovn-ipv6-metal-conformance
@@ -189,9 +198,12 @@ tests:
189198
NUM_EXTRA_WORKERS=3
190199
PROVISIONING_NETWORK_PROFILE=Disabled
191200
REDFISH_EMULATOR_IGNORE_BOOT_DEVICE=True
201+
KONFLUX_DEPLOY_CATALOG_SOURCE: "true"
202+
KONFLUX_DEPLOY_OPERATORS: "true"
192203
LVM_OPERATOR_SUB_CHANNEL: stable-4.21
193204
LVM_OPERATOR_SUB_SOURCE: lvm-catalogsource
194205
MCE_VERSION: "2.11"
206+
METALLB_OPERATOR_SUB_SOURCE: metallb-konflux
195207
OADP_OPERATOR_SUB_CHANNEL: stable-1.4
196208
OADP_OPERATOR_SUB_SOURCE: qe-app-registry
197209
test:
@@ -315,9 +327,12 @@ tests:
315327
dependencies:
316328
HOSTEDCLUSTER_RELEASE_IMAGE_LATEST: release:421-latest
317329
env:
330+
KONFLUX_DEPLOY_CATALOG_SOURCE: "true"
331+
KONFLUX_DEPLOY_OPERATORS: "true"
318332
LVM_OPERATOR_SUB_CHANNEL: stable-4.21
319333
LVM_OPERATOR_SUB_SOURCE: lvm-catalogsource
320334
MCE_VERSION: "2.11"
335+
METALLB_OPERATOR_SUB_SOURCE: metallb-konflux
321336
TEST_SUITE: openshift/conformance/parallel/minimal
322337
test:
323338
- ref: hypershift-mce-multi-version-test-info

ci-operator/step-registry/hypershift/agent/OWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ approvers:
22
- csrwng
33
- enxebre
44
- sjenning
5-
- imain
65
- LiangquanLi930
76
- heliubj18
87
- eranco74
98
- avishayt
9+
- jparrill
1010
options: {}
1111
reviewers:
1212
- csrwng
1313
- enxebre
1414
- sjenning
15-
- imain
1615
- LiangquanLi930
1716
- heliubj18
1817
- eranco74
1918
- avishayt
19+
- jparrill

ci-operator/step-registry/hypershift/agent/conformance/hypershift-agent-conformance-workflow.metadata.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
"csrwng",
66
"enxebre",
77
"sjenning",
8-
"imain",
98
"LiangquanLi930",
109
"heliubj18",
1110
"eranco74",
12-
"avishayt"
11+
"avishayt",
12+
"jparrill"
1313
],
1414
"reviewers": [
1515
"csrwng",
1616
"enxebre",
1717
"sjenning",
18-
"imain",
1918
"LiangquanLi930",
2019
"heliubj18",
2120
"eranco74",
22-
"avishayt"
21+
"avishayt",
22+
"jparrill"
2323
]
2424
}
2525
}

ci-operator/step-registry/hypershift/agent/create/add-worker-manual/hypershift-agent-create-add-worker-manual-ref.metadata.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
"csrwng",
66
"enxebre",
77
"sjenning",
8-
"imain",
98
"LiangquanLi930",
109
"heliubj18",
1110
"eranco74",
12-
"avishayt"
11+
"avishayt",
12+
"jparrill"
1313
],
1414
"reviewers": [
1515
"csrwng",
1616
"enxebre",
1717
"sjenning",
18-
"imain",
1918
"LiangquanLi930",
2019
"heliubj18",
2120
"eranco74",
22-
"avishayt"
21+
"avishayt",
22+
"jparrill"
2323
]
2424
}
2525
}

ci-operator/step-registry/hypershift/agent/create/config-dns/hypershift-agent-create-config-dns-ref.metadata.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
"csrwng",
66
"enxebre",
77
"sjenning",
8-
"imain",
98
"LiangquanLi930",
109
"heliubj18",
1110
"eranco74",
12-
"avishayt"
11+
"avishayt",
12+
"jparrill"
1313
],
1414
"reviewers": [
1515
"csrwng",
1616
"enxebre",
1717
"sjenning",
18-
"imain",
1918
"LiangquanLi930",
2019
"heliubj18",
2120
"eranco74",
22-
"avishayt"
21+
"avishayt",
22+
"jparrill"
2323
]
2424
}
2525
}

ci-operator/step-registry/hypershift/agent/create/hostedcluster/hypershift-agent-create-hostedcluster-ref.metadata.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
"csrwng",
66
"enxebre",
77
"sjenning",
8-
"imain",
98
"LiangquanLi930",
109
"heliubj18",
1110
"eranco74",
12-
"avishayt"
11+
"avishayt",
12+
"jparrill"
1313
],
1414
"reviewers": [
1515
"csrwng",
1616
"enxebre",
1717
"sjenning",
18-
"imain",
1918
"LiangquanLi930",
2019
"heliubj18",
2120
"eranco74",
22-
"avishayt"
21+
"avishayt",
22+
"jparrill"
2323
]
2424
}
2525
}

ci-operator/step-registry/hypershift/agent/create/hypershift-agent-create-chain.metadata.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
"csrwng",
66
"enxebre",
77
"sjenning",
8-
"imain",
98
"LiangquanLi930",
109
"heliubj18",
1110
"eranco74",
12-
"avishayt"
11+
"avishayt",
12+
"jparrill"
1313
],
1414
"reviewers": [
1515
"csrwng",
1616
"enxebre",
1717
"sjenning",
18-
"imain",
1918
"LiangquanLi930",
2019
"heliubj18",
2120
"eranco74",
22-
"avishayt"
21+
"avishayt",
22+
"jparrill"
2323
]
2424
}
2525
}

ci-operator/step-registry/hypershift/agent/create/ingress-nodeport/hypershift-agent-create-ingress-nodeport-ref.metadata.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
"csrwng",
66
"enxebre",
77
"sjenning",
8-
"imain",
98
"LiangquanLi930",
109
"heliubj18",
1110
"eranco74",
12-
"avishayt"
11+
"avishayt",
12+
"jparrill"
1313
],
1414
"reviewers": [
1515
"csrwng",
1616
"enxebre",
1717
"sjenning",
18-
"imain",
1918
"LiangquanLi930",
2019
"heliubj18",
2120
"eranco74",
22-
"avishayt"
21+
"avishayt",
22+
"jparrill"
2323
]
2424
}
2525
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../OWNERS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#!/bin/bash
2+
3+
set -eoux pipefail
4+
5+
function create_marketplace_namespace () {
6+
# Since OCP 4.11, the marketplace is optional. If it is not installed, we need to create the namespace manually.
7+
if ! oc get ns openshift-marketplace; then
8+
cat <<EOF | oc create -f -
9+
apiVersion: v1
10+
kind: Namespace
11+
metadata:
12+
labels:
13+
security.openshift.io/scc.podSecurityLabelSync: "false"
14+
pod-security.kubernetes.io/enforce: baseline
15+
pod-security.kubernetes.io/audit: baseline
16+
pod-security.kubernetes.io/warn: baseline
17+
name: openshift-marketplace
18+
EOF
19+
fi
20+
}
21+
22+
function create_metallb_catalogsource() {
23+
echo "Creating CatalogSource for metallb..."
24+
25+
local catalog_name="metallb-konflux"
26+
local version
27+
28+
version=$(oc get clusterversion version -o jsonpath='{.status.desired.version}' 2>/dev/null | cut -d. -f1-2)
29+
if [[ -z "${version}" ]]; then
30+
echo "Could not detect cluster version"
31+
return 1
32+
fi
33+
34+
echo "Detected OpenShift version: $version"
35+
36+
local index_image
37+
if [[ "${DISCONNECTED}" == "true" ]]; then
38+
local mirror_registry_url
39+
mirror_registry_url=$(cat "${SHARED_DIR}/mirror_registry_url")
40+
index_image="${mirror_registry_url//5000/6003}/redhat-user-workloads/ocp-art-tenant/art-fbc:ocp__${version}__metallb-rhel9-operator"
41+
else
42+
index_image="quay.io/redhat-user-workloads/ocp-art-tenant/art-fbc:ocp__${version}__metallb-rhel9-operator"
43+
fi
44+
45+
if ! oc apply -f - <<EOF
46+
apiVersion: operators.coreos.com/v1alpha1
47+
kind: CatalogSource
48+
metadata:
49+
name: ${catalog_name}
50+
namespace: openshift-marketplace
51+
spec:
52+
displayName: ${catalog_name}
53+
image: "${index_image}"
54+
publisher: OpenShift QE
55+
sourceType: grpc
56+
updateStrategy:
57+
registryPoll:
58+
interval: 15m
59+
EOF
60+
then
61+
echo "CatalogSource apply failed for metallb"
62+
return 1
63+
else
64+
echo "CatalogSource created for metallb"
65+
fi
66+
67+
# Wait for catalog ready
68+
echo "Waiting for CatalogSource to be ready..."
69+
if ! oc wait --for=jsonpath='{.status.connectionState.lastObservedState}'=READY \
70+
catalogsource "$catalog_name" -n openshift-marketplace --timeout=300s 2>/dev/null; then
71+
echo "CatalogSource $catalog_name not ready within timeout"
72+
return 1
73+
else
74+
echo "CatalogSource is ready"
75+
fi
76+
77+
return 0
78+
}
79+
80+
if [[ "${KONFLUX_DEPLOY_CATALOG_SOURCE:-false}" == "false" ]]; then
81+
echo "KONFLUX_DEPLOY_CATALOG_SOURCE is set to false, skipping CatalogSource deployment"
82+
exit 0
83+
fi
84+
85+
if [ -f "${SHARED_DIR}/proxy-conf.sh" ] ; then
86+
source "${SHARED_DIR}/proxy-conf.sh"
87+
fi
88+
89+
if [ ! -f "${SHARED_DIR}/nested_kubeconfig" ]; then
90+
echo "kubeconfig for nested cluster not found in ${SHARED_DIR}/nested_kubeconfig"
91+
exit 1
92+
fi
93+
94+
export KUBECONFIG="${SHARED_DIR}/nested_kubeconfig"
95+
96+
create_marketplace_namespace
97+
create_metallb_catalogsource

0 commit comments

Comments
 (0)