Skip to content

Commit 90375d2

Browse files
cbleckerclaude
andauthored
Add CNCF Kubernetes conformance step-registry components (openshift#73714)
This adds reusable step-registry components for running the official CNCF Kubernetes conformance test suite using hydrophone, suitable for generating k8s-conformance submissions for OpenShift Dedicated. Components created: - openshift-conformance-kubernetes-build: Compiles hydrophone binary - openshift-conformance-kubernetes: Runs conformance tests - osd-ccs-aws-k8s-conformance: Complete OSD AWS workflow The implementation uses a two-step pattern where the build step produces the hydrophone binary in SHARED_DIR, and the test step retrieves and executes it against a provisioned cluster. Co-authored-by: Claude Sonnet 4.5 <[email protected]>
1 parent 7423798 commit 90375d2

11 files changed

+147
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
approvers:
2+
- cblecker
3+
- wgordon17
4+
reviewers:
5+
- cblecker
6+
- wgordon17
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../OWNERS
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -o nounset
4+
set -o errexit
5+
set -o pipefail
6+
7+
GOBIN="${SHARED_DIR}" go install sigs.k8s.io/hydrophone@latest
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"path": "openshift/k8s-conformance/build/openshift-k8s-conformance-build-ref.yaml",
3+
"owners": {
4+
"approvers": [
5+
"cblecker",
6+
"wgordon17"
7+
],
8+
"reviewers": [
9+
"cblecker",
10+
"wgordon17"
11+
]
12+
}
13+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ref:
2+
as: openshift-k8s-conformance-build
3+
from_image:
4+
namespace: openshift
5+
name: release
6+
tag: rhel-9-release-golang-1.24-openshift-4.20
7+
commands: openshift-k8s-conformance-build-commands.sh
8+
resources:
9+
requests:
10+
cpu: "1"
11+
memory: 1Gi
12+
documentation: |-
13+
Builds the hydrophone binary (CNCF conformance test runner) and installs it
14+
to SHARED_DIR for use by subsequent test steps.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
set -o nounset
4+
set -o errexit
5+
set -o pipefail
6+
7+
# Handle proxy for disconnected environments
8+
if test -f "${SHARED_DIR}/proxy-conf.sh"; then
9+
# shellcheck disable=SC1091
10+
source "${SHARED_DIR}/proxy-conf.sh"
11+
fi
12+
13+
# Get Kubernetes version from cluster
14+
K8S_VERSION=$(oc version -ojson | jq -r '.serverVersion.gitVersion | sub("[\\+].*"; "")')
15+
echo "Detected Kubernetes version: ${K8S_VERSION}"
16+
17+
# Count unschedulable nodes (masters, control-plane, infra)
18+
UNSCHEDULABLE_NODE_COUNT=$(oc get nodes -ojson | jq --raw-output '
19+
[ .items[].metadata | select (
20+
.labels."node-role.kubernetes.io/master" == "" or
21+
.labels."node-role.kubernetes.io/control-plane" == "" or
22+
.labels."node-role.kubernetes.io/infra" == ""
23+
) | .name ] | length')
24+
echo "Unschedulable node count: ${UNSCHEDULABLE_NODE_COUNT}"
25+
26+
# Allow permissive SCCs for conformance tests
27+
oc adm policy add-scc-to-group privileged system:authenticated system:serviceaccounts
28+
oc adm policy add-scc-to-group anyuid system:authenticated system:serviceaccounts
29+
30+
# Run conformance tests
31+
echo "Starting CNCF Kubernetes conformance tests..."
32+
"${SHARED_DIR}/hydrophone" \
33+
--conformance \
34+
--conformance-image "registry.k8s.io/conformance:${K8S_VERSION}" \
35+
--extra-args="--allowed-not-ready-nodes=${UNSCHEDULABLE_NODE_COUNT}" \
36+
--output-dir "${ARTIFACT_DIR}"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"path": "openshift/k8s-conformance/openshift-k8s-conformance-ref.yaml",
3+
"owners": {
4+
"approvers": [
5+
"cblecker",
6+
"wgordon17"
7+
],
8+
"reviewers": [
9+
"cblecker",
10+
"wgordon17"
11+
]
12+
}
13+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ref:
2+
as: openshift-k8s-conformance
3+
from: cli
4+
cli: latest
5+
commands: openshift-k8s-conformance-commands.sh
6+
timeout: 14400s
7+
grace_period: 10m
8+
resources:
9+
requests:
10+
cpu: "1"
11+
memory: 1Gi
12+
documentation: |-
13+
Runs the official CNCF Kubernetes conformance test suite using hydrophone.
14+
Expects the hydrophone binary to be present in SHARED_DIR (from build step).
15+
Generates results suitable for k8s-conformance repository submissions.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
approvers:
2+
- cblecker
3+
- wgordon17
4+
reviewers:
5+
- cblecker
6+
- wgordon17
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"path": "osd-ccs/aws/k8s-conformance/osd-ccs-aws-k8s-conformance-workflow.yaml",
3+
"owners": {
4+
"approvers": [
5+
"cblecker",
6+
"wgordon17"
7+
],
8+
"reviewers": [
9+
"cblecker",
10+
"wgordon17"
11+
]
12+
}
13+
}

0 commit comments

Comments
 (0)