diff --git a/ci-operator/config/openshift/aws-vpce-operator/openshift-aws-vpce-operator-main.yaml b/ci-operator/config/openshift/aws-vpce-operator/openshift-aws-vpce-operator-main.yaml index de98c7fe99bfd..65221016db149 100644 --- a/ci-operator/config/openshift/aws-vpce-operator/openshift-aws-vpce-operator-main.yaml +++ b/ci-operator/config/openshift/aws-vpce-operator/openshift-aws-vpce-operator-main.yaml @@ -1,4 +1,8 @@ base_images: + ocm-cli: + name: ocm-cli + namespace: ci + tag: latest rosa-aws-cli: name: rosa-aws-cli namespace: ci @@ -126,6 +130,19 @@ tests: OPERATOR_DEPLOYMENT_NAME: aws-vpce-operator OPERATOR_NAME: aws-vpce-operator workflow: rosa-cluster-lease-e2e-workflow +- as: rosa-hcp-mc-e2e + cron: 0 9 * * 0 + steps: + cluster_profile: rosa-e2e-01 + env: + CLUSTER_SECTOR: rosa-e2e + GINKGO_FOCUS: VpcEndpointTemplate MC Controller + HOSTED_CP: "true" + OCM_LOGIN_ENV: staging + OPENSHIFT_VERSION: "4.21" + OPERATOR_NAME: aws-vpce-operator + REGION: us-west-2 + workflow: rosa-operator-mc-e2e zz_generated_metadata: branch: main org: openshift diff --git a/ci-operator/config/openshift/route-monitor-operator/openshift-route-monitor-operator-master.yaml b/ci-operator/config/openshift/route-monitor-operator/openshift-route-monitor-operator-master.yaml index 5227768c25ddf..362026dc8729b 100644 --- a/ci-operator/config/openshift/route-monitor-operator/openshift-route-monitor-operator-master.yaml +++ b/ci-operator/config/openshift/route-monitor-operator/openshift-route-monitor-operator-master.yaml @@ -1,4 +1,8 @@ base_images: + ocm-cli: + name: ocm-cli + namespace: ci + tag: latest rosa-aws-cli: name: rosa-aws-cli namespace: ci @@ -214,6 +218,19 @@ tests: - ref: rosa-operator-coverage-setup test: - ref: rosa-operator-e2e +- as: rosa-hcp-mc-e2e + cron: 0 8 * * 0 + steps: + cluster_profile: rosa-e2e-01 + env: + CLUSTER_SECTOR: rosa-e2e + GINKGO_FOCUS: RHOBS Synthetic Monitoring + HOSTED_CP: "true" + OCM_LOGIN_ENV: staging + OPENSHIFT_VERSION: "4.21" + OPERATOR_NAME: route-monitor-operator + REGION: us-west-2 + workflow: rosa-operator-mc-e2e zz_generated_metadata: branch: master org: openshift diff --git a/ci-operator/jobs/openshift/aws-vpce-operator/openshift-aws-vpce-operator-main-periodics.yaml b/ci-operator/jobs/openshift/aws-vpce-operator/openshift-aws-vpce-operator-main-periodics.yaml index d73551d493da9..bebbb1cf79168 100644 --- a/ci-operator/jobs/openshift/aws-vpce-operator/openshift-aws-vpce-operator-main-periodics.yaml +++ b/ci-operator/jobs/openshift/aws-vpce-operator/openshift-aws-vpce-operator-main-periodics.yaml @@ -1,4 +1,90 @@ periodics: +- agent: kubernetes + cluster: build11 + cron: 0 9 * * 0 + decorate: true + decoration_config: + sparse_checkout_files: + - .ci-operator.yaml + - build/Dockerfile + extra_refs: + - base_ref: main + org: openshift + repo: aws-vpce-operator + sparse_checkout_files: + - .ci-operator.yaml + - build/Dockerfile + labels: + ci-operator.openshift.io/cloud: aws + ci-operator.openshift.io/cloud-cluster-profile: rosa-e2e-01 + ci.openshift.io/generator: prowgen + job-release: "4.22" + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: periodic-ci-openshift-aws-vpce-operator-main-rosa-hcp-mc-e2e + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --lease-server-credentials-file=/etc/boskos/credentials + - --report-credentials-file=/etc/report/credentials + - --secret-dir=/secrets/ci-pull-credentials + - --target=rosa-hcp-mc-e2e + command: + - ci-operator + env: + - name: HTTP_SERVER_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + ports: + - containerPort: 8080 + name: http + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /etc/boskos + name: boskos + readOnly: true + - mountPath: /secrets/ci-pull-credentials + name: ci-pull-credentials + readOnly: true + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: boskos + secret: + items: + - key: credentials + path: credentials + secretName: boskos-credentials + - name: ci-pull-credentials + secret: + secretName: ci-pull-credentials + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator - agent: kubernetes cluster: build11 cron: 0 0 31 2 * diff --git a/ci-operator/jobs/openshift/route-monitor-operator/openshift-route-monitor-operator-master-periodics.yaml b/ci-operator/jobs/openshift/route-monitor-operator/openshift-route-monitor-operator-master-periodics.yaml index 9194f853275dd..977bc3ea11dce 100644 --- a/ci-operator/jobs/openshift/route-monitor-operator/openshift-route-monitor-operator-master-periodics.yaml +++ b/ci-operator/jobs/openshift/route-monitor-operator/openshift-route-monitor-operator-master-periodics.yaml @@ -191,6 +191,92 @@ periodics: - name: result-aggregator secret: secretName: result-aggregator +- agent: kubernetes + cluster: build10 + cron: 0 8 * * 0 + decorate: true + decoration_config: + sparse_checkout_files: + - .ci-operator.yaml + - Dockerfile + extra_refs: + - base_ref: master + org: openshift + repo: route-monitor-operator + sparse_checkout_files: + - .ci-operator.yaml + - Dockerfile + labels: + ci-operator.openshift.io/cloud: aws + ci-operator.openshift.io/cloud-cluster-profile: rosa-e2e-01 + ci.openshift.io/generator: prowgen + job-release: "4.21" + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: periodic-ci-openshift-route-monitor-operator-master-rosa-hcp-mc-e2e + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --lease-server-credentials-file=/etc/boskos/credentials + - --report-credentials-file=/etc/report/credentials + - --secret-dir=/secrets/ci-pull-credentials + - --target=rosa-hcp-mc-e2e + command: + - ci-operator + env: + - name: HTTP_SERVER_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + ports: + - containerPort: 8080 + name: http + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /etc/boskos + name: boskos + readOnly: true + - mountPath: /secrets/ci-pull-credentials + name: ci-pull-credentials + readOnly: true + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: boskos + secret: + items: + - key: credentials + path: credentials + secretName: boskos-credentials + - name: ci-pull-credentials + secret: + secretName: ci-pull-credentials + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator - agent: kubernetes cluster: build10 cron: 0 6 * * 0 diff --git a/ci-operator/step-registry/rosa/operator/cleanup/rosa-operator-cleanup-commands.sh b/ci-operator/step-registry/rosa/operator/cleanup/rosa-operator-cleanup-commands.sh index 34d3d1ffb6c58..ebebbbea2a96b 100755 --- a/ci-operator/step-registry/rosa/operator/cleanup/rosa-operator-cleanup-commands.sh +++ b/ci-operator/step-registry/rosa/operator/cleanup/rosa-operator-cleanup-commands.sh @@ -20,6 +20,11 @@ if [[ -n "${SHARED_DIR:-}" ]]; then OPERATOR_NAMESPACE=$(cat "${SHARED_DIR}/operator-e2e-namespace" 2>/dev/null || true) fi +# Fallback for MC mode where install step doesn't run +if [[ -z "${OPERATOR_NAMESPACE}" && -n "${OPERATOR_NAME:-}" ]]; then + OPERATOR_NAMESPACE="openshift-${OPERATOR_NAME}" +fi + # Collect operator logs as artifacts for debugging if [[ -n "${OPERATOR_NAMESPACE}" && -n "${ARTIFACT_DIR:-}" ]]; then log "Collecting operator logs from ${OPERATOR_NAMESPACE}" diff --git a/ci-operator/step-registry/rosa/operator/mc-e2e/OWNERS b/ci-operator/step-registry/rosa/operator/mc-e2e/OWNERS new file mode 100644 index 0000000000000..57abfdc3a8467 --- /dev/null +++ b/ci-operator/step-registry/rosa/operator/mc-e2e/OWNERS @@ -0,0 +1,10 @@ +approvers: +- dustman9000 +- joshbranham +- bmeng +- ravitri +reviewers: +- dustman9000 +- joshbranham +- bmeng +- ravitri diff --git a/ci-operator/step-registry/rosa/operator/mc-e2e/rosa-operator-mc-e2e-workflow.metadata.json b/ci-operator/step-registry/rosa/operator/mc-e2e/rosa-operator-mc-e2e-workflow.metadata.json new file mode 100644 index 0000000000000..81903ab09d08e --- /dev/null +++ b/ci-operator/step-registry/rosa/operator/mc-e2e/rosa-operator-mc-e2e-workflow.metadata.json @@ -0,0 +1,17 @@ +{ + "path": "rosa/operator/mc-e2e/rosa-operator-mc-e2e-workflow.yaml", + "owners": { + "approvers": [ + "dustman9000", + "joshbranham", + "bmeng", + "ravitri" + ], + "reviewers": [ + "dustman9000", + "joshbranham", + "bmeng", + "ravitri" + ] + } +} \ No newline at end of file diff --git a/ci-operator/step-registry/rosa/operator/mc-e2e/rosa-operator-mc-e2e-workflow.yaml b/ci-operator/step-registry/rosa/operator/mc-e2e/rosa-operator-mc-e2e-workflow.yaml new file mode 100644 index 0000000000000..54734c4a09887 --- /dev/null +++ b/ci-operator/step-registry/rosa/operator/mc-e2e/rosa-operator-mc-e2e-workflow.yaml @@ -0,0 +1,34 @@ +workflow: + as: rosa-operator-mc-e2e + steps: + env: + HOSTED_CP: "true" + CLUSTER_SECTOR: rosa-e2e + ENABLE_BILLING_ACCOUNT: "yes" + OCM_LOGIN_ENV: staging + CHANNEL_GROUP: stable + REPLICAS: "3" + pre: + - chain: rosa-aws-sts-hcp-provision + - ref: rosa-cluster-wait-ready-hosted-cp + - ref: rosa-cluster-credentials-hypershift-mgmt + - ref: rosa-operator-mc-e2e-setup + test: + - ref: rosa-operator-e2e + post: + - chain: rosa-cluster-deprovision + best_effort: true + - chain: rosa-sts-oidc-config-delete + best_effort: true + - ref: rosa-e2e-cleanup-vpc + best_effort: true + - ref: aws-deprovision-stacks + best_effort: true + documentation: |- + Provisions an HCP on a CI sector, fetches the Management Cluster + kubeconfig, runs operator e2e tests against the MC, then deprovisions. + Used for testing MC-resident operator code paths (HCP reconcilers, + synthetic monitoring probes, VPC endpoint management). + + The operator is NOT installed or cleaned up. It is fleet-managed via + MCC/PKO on the MC. Tests run against the existing deployment. diff --git a/ci-operator/step-registry/rosa/operator/mc-e2e/setup/OWNERS b/ci-operator/step-registry/rosa/operator/mc-e2e/setup/OWNERS new file mode 100644 index 0000000000000..57abfdc3a8467 --- /dev/null +++ b/ci-operator/step-registry/rosa/operator/mc-e2e/setup/OWNERS @@ -0,0 +1,10 @@ +approvers: +- dustman9000 +- joshbranham +- bmeng +- ravitri +reviewers: +- dustman9000 +- joshbranham +- bmeng +- ravitri diff --git a/ci-operator/step-registry/rosa/operator/mc-e2e/setup/rosa-operator-mc-e2e-setup-commands.sh b/ci-operator/step-registry/rosa/operator/mc-e2e/setup/rosa-operator-mc-e2e-setup-commands.sh new file mode 100644 index 0000000000000..e4daf3c0a614f --- /dev/null +++ b/ci-operator/step-registry/rosa/operator/mc-e2e/setup/rosa-operator-mc-e2e-setup-commands.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -o nounset +set -o errexit +set -o pipefail + +log(){ + echo -e "\033[1m$(date "+%d-%m-%YT%H:%M:%S") " "${*}\033[0m" >&2 +} + +MC_KUBECONFIG="${SHARED_DIR}/hs-mc.kubeconfig" +if [[ ! -f "${MC_KUBECONFIG}" ]]; then + log "ERROR: MC kubeconfig not found at ${MC_KUBECONFIG}" + log "rosa-cluster-credentials-hypershift-mgmt may have failed" + exit 1 +fi + +cp "${MC_KUBECONFIG}" "${SHARED_DIR}/kubeconfig" +log "MC kubeconfig set for operator e2e" +KUBECONFIG="${SHARED_DIR}/kubeconfig" oc whoami +log "Connected to MC: $(KUBECONFIG="${SHARED_DIR}/kubeconfig" oc whoami --show-server)" diff --git a/ci-operator/step-registry/rosa/operator/mc-e2e/setup/rosa-operator-mc-e2e-setup-ref.metadata.json b/ci-operator/step-registry/rosa/operator/mc-e2e/setup/rosa-operator-mc-e2e-setup-ref.metadata.json new file mode 100644 index 0000000000000..ec3e33c3fc4f1 --- /dev/null +++ b/ci-operator/step-registry/rosa/operator/mc-e2e/setup/rosa-operator-mc-e2e-setup-ref.metadata.json @@ -0,0 +1,17 @@ +{ + "path": "rosa/operator/mc-e2e/setup/rosa-operator-mc-e2e-setup-ref.yaml", + "owners": { + "approvers": [ + "dustman9000", + "joshbranham", + "bmeng", + "ravitri" + ], + "reviewers": [ + "dustman9000", + "joshbranham", + "bmeng", + "ravitri" + ] + } +} \ No newline at end of file diff --git a/ci-operator/step-registry/rosa/operator/mc-e2e/setup/rosa-operator-mc-e2e-setup-ref.yaml b/ci-operator/step-registry/rosa/operator/mc-e2e/setup/rosa-operator-mc-e2e-setup-ref.yaml new file mode 100644 index 0000000000000..a23dead212df8 --- /dev/null +++ b/ci-operator/step-registry/rosa/operator/mc-e2e/setup/rosa-operator-mc-e2e-setup-ref.yaml @@ -0,0 +1,14 @@ +ref: + as: rosa-operator-mc-e2e-setup + from: rosa-aws-cli + commands: rosa-operator-mc-e2e-setup-commands.sh + resources: + requests: + cpu: 100m + memory: 100Mi + timeout: 2m0s + documentation: |- + Bridges MC kubeconfig for operator e2e testing. Copies the MC + kubeconfig produced by rosa-cluster-credentials-hypershift-mgmt + (hs-mc.kubeconfig) to the standard kubeconfig path expected by + rosa-operator-e2e.