Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udpate e2e using downstream images #30

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ jobs:
run: |
make e2e-install
env:
KUBECONFIG: /home/runner/.kube/hub-kubeconfig

KUBECONFIG: /home/runner/.kube/hub-kubeconfig
MCEValues: ./test/configuration/mce-values.yaml
PolicyValues: ./test/configuration/policy-values.yaml
- name: Import hosted cluster
run: |
make e2e-import-cluster
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/post-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: POST

on:
workflow_dispatch: {}
push:
branches:
- main
- release-*

env:
GO_VERSION: '1.22'
GO_REQUIRED_MIN_VERSION: ''
USE_EXISTING_CLUSTER: false # set to true to use an existing kind cluster for debugging with act

permissions:
contents: read

jobs:
e2e:
runs-on: ubuntu-latest
steps:
- name: add permisson to docker.sock
run: sudo chown runner:docker /var/run/docker.sock
if: ${{ env.ACT }} # this step only runs locally when using the https://github.com/nektos/act to debug the e2e
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install kind
uses: helm/[email protected]
with:
version: v0.22.0
install_only: true
- name: Test kind works and there is no cluster started
run: |
[[ $(kind get clusters | wc -l) -eq 0 ]]
- name: Set KUBECONFIG dir
run: |
mkdir -p /home/runner/.kube
- name: Create Hub cluster
run: |
kind create cluster --name hub
env:
KUBECONFIG: /home/runner/.kube/hub-kubeconfig
- name: Create Spoke cluster
run: |
kind create cluster --name spoke
env:
KUBECONFIG: /home/runner/.kube/spoke-kubeconfig
- name: Test Hub and Spoke clusters
run: |
kubectl cluster-info --kubeconfig /home/runner/.kube/hub-kubeconfig
kubectl get pods -A --kubeconfig /home/runner/.kube/hub-kubeconfig
kubectl cluster-info --kubeconfig /home/runner/.kube/spoke-kubeconfig
kubectl get pods -A --kubeconfig /home/runner/.kube/spoke-kubeconfig
- name: Create internal kubeconfigs
run: |
kind get kubeconfig --internal --name hub > /home/runner/.kube/hub-internal-kubeconfig
kind get kubeconfig --internal --name spoke > /home/runner/.kube/spoke-internal-kubeconfig
- name: Install MCE+Policy
run: |
make e2e-install
env:
KUBECONFIG: /home/runner/.kube/hub-kubeconfig
UserName: ${{ secrets.IMAGE_PULL_SECRET_USER_NAME }}
Password: ${{ secrets.IMAGE_PULL_SECRET_TOKEN }}
MCEValues: ./test/configuration/mce-ds-values.yaml
PolicyValues: ./test/configuration/policy-ds-values.yaml
- name: Import hosted cluster
run: |
make e2e-import-cluster
env:
KUBECONFIG: /home/runner/.kube/hub-kubeconfig
MANAGED_CLUSTER_NAME: spoke
MANAGED_KUBECONFIG: /home/runner/.kube/spoke-internal-kubeconfig
EXTERNAL_MANAGED_KUBECONFIG: /home/runner/.kube/spoke-internal-kubeconfig
- name: Run e2e
run: |
make test-e2e
env:
KUBECONFIG: /home/runner/.kube/hub-kubeconfig
MANAGED_CLUSTER_NAME: spoke
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export ACM_VERSION?=2.12
export MCE_VERSION?=2.7
export ACM_VERSION?=2.13
export MCE_VERSION?=2.8

GOHOSTOS:=$(shell uname -s | tr '[:upper:]' '[:lower:]')

Expand Down Expand Up @@ -27,7 +27,15 @@ ifeq ($(GOHOSTOS),darwin)
endif
endif


ImageCredentials?=""
UserName?=""
Password?=""

# upstream is ./test/configuration/mce-values.yaml
# downstream is ./test/configuration/mce-ds-values.yaml
MCEValues?="./test/configuration/mce-values.yaml"
PolicyValues?="./test/configuration/policy-values.yaml"

fmt:
go fmt ./test/e2e
Expand All @@ -42,10 +50,10 @@ install-policy: ensure-helm
$(HELM) upgrade --install policy ./policy

install-e2e-mce: ensure-helm
$(HELM) upgrade --install mce ./hack/mce-chart -f ./test/configuration/mce-values.yaml
$(HELM) upgrade --install mce ./hack/mce-chart -f $(MCEValues) --set images.imageCredentials.userName=$(UserName),images.imageCredentials.password=$(Password)

install-e2e-policy: ensure-helm
$(HELM) upgrade --install policy ./policy -f ./test/configuration/policy-values.yaml
$(HELM) upgrade --install policy ./policy -f $(PolicyValues)

e2e-install:
hack/e2e-install.sh
Expand Down
1 change: 1 addition & 0 deletions hack/e2e-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function waitForReady() {

echo ""
echo "#### Install MCE on Hub cluster ####"

make install-e2e-mce

echo ""
Expand Down
4 changes: 2 additions & 2 deletions hack/mce-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: mce
description: A Helm chart for MCE
version: 2.7.0
appVersion: 2.7.0
version: 1.0.0
appVersion: 1.0.0
5 changes: 4 additions & 1 deletion hack/mce-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@

{{/* Create secret to access docker registry */}}
{{- define "imagePullSecret" }}
{{- with .Values.images }}
{{- if .imageCredentials.dockerConfigJson }}
{{- if and .imageCredentials.userName .imageCredentials.password }}
{{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .imageCredentials.registry (printf "%s:%s" .imageCredentials.userName .imageCredentials.password | b64enc) | b64enc }}
{{- else if .imageCredentials.dockerConfigJson }}
{{- printf "%s" .imageCredentials.dockerConfigJson | b64enc }}
{{- else }}
{{- printf "{}" | b64enc }}
Expand Down
28 changes: 14 additions & 14 deletions hack/mce-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ spec:
- name: OPERAND_IMAGE_HYPERSHIFT_ADDON_OPERATOR_CANARY_TEST
value: quay.io/stolostron/hypershift-addon-operator-canary-test@sha256
- name: OPERAND_IMAGE_HYPERSHIFT_OPERATOR
value: {{ .Values.images.overrides.hypershift_operator }}
value: quay.io/acm-d/hypershift-rhel9-operator:v2.8.0-4
- name: OPERAND_IMAGE_IMAGE_BASED_INSTALL_OPERATOR
value: quay.io/stolostron/image-based-install-operator@sha256
- name: OPERAND_IMAGE_MANAGED_SERVICEACCOUNT
Expand All @@ -126,34 +126,34 @@ spec:
- name: OPERAND_IMAGE_PROVIDER_CREDENTIAL_CONTROLLER
value: quay.io/stolostron/provider-credential-controller@sha256
- name: OPERAND_IMAGE_ADDON_MANAGER
value: {{ .Values.images.overrides.addon_manager }}
value: {{ .Values.images.registry }}/{{ .Values.images.overrides.addon_manager }}
- name: OPERAND_IMAGE_BACKPLANE_OPERATOR
value: {{ .Values.images.overrides.backplane_operator }}
value: {{ .Values.images.registry }}/{{ .Values.images.overrides.backplane_operator }}
- name: OPERAND_IMAGE_HYPERSHIFT_ADDON_OPERATOR
value: {{ .Values.images.overrides.hypershift_addon_operator }}
value: {{ .Values.images.registry }}/{{ .Values.images.overrides.hypershift_addon_operator }}
- name: OPERAND_IMAGE_MANAGEDCLUSTER_IMPORT_CONTROLLER
value: {{ .Values.images.overrides.managedcluster_import_controller }}
value: {{ .Values.images.registry }}/{{ .Values.images.overrides.managedcluster_import_controller }}
- name: OPERAND_IMAGE_MULTICLOUD_MANAGER
value: {{ .Values.images.overrides.multicloud_manager }}
value: {{ .Values.images.registry }}/{{ .Values.images.overrides.multicloud_manager }}
- name: OPERAND_IMAGE_PLACEMENT
value: {{ .Values.images.overrides.placement }}
value: {{ .Values.images.registry }}/{{ .Values.images.overrides.placement }}
- name: OPERAND_IMAGE_REGISTRATION
value: {{ .Values.images.overrides.registration }}
value: {{ .Values.images.registry }}/{{ .Values.images.overrides.registration }}
- name: OPERAND_IMAGE_REGISTRATION_OPERATOR
value: {{ .Values.images.overrides.registration_operator }}
value: {{ .Values.images.registry }}/{{ .Values.images.overrides.registration_operator }}
- name: OPERAND_IMAGE_WORK
value: {{ .Values.images.overrides.work }}
value: {{ .Values.images.registry }}/{{ .Values.images.overrides.work }}
- name: OPERAND_IMAGE_KUBE_RBAC_PROXY_MCE
value: {{ .Values.images.overrides.kube_rbac_proxy_mce }}
value: {{ .Values.images.registry }}/{{ .Values.images.overrides.kube_rbac_proxy_mce }}
- name: OPERAND_IMAGE_CLUSTERLIFECYCLE_STATE_METRICS
value: {{ .Values.images.overrides.clusterlifecycle_state_metrics }}
value: {{ .Values.images.registry }}/{{ .Values.images.overrides.clusterlifecycle_state_metrics }}
- name: OPERATOR_VERSION
value: {{ .Chart.AppVersion }}
- name: OPERATOR_PACKAGE
value: multicluster-engine
- name: OPERATOR_CONDITION_NAME
value: multicluster-engine.v{{ .Chart.AppVersion }}
image: {{ .Values.images.overrides.backplane_operator }}
value: multicluster-engine.v{{ .Values.mceVersion }}
image: "{{ .Values.images.registry }}/{{ .Values.images.overrides.backplane_operator }}"
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
Expand Down
35 changes: 20 additions & 15 deletions hack/mce-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@

replicaCount: 2
availabilityConfig: High
mceVersion: 2.8
replicaCount: 1
availabilityConfig: Basic
images:
registry: "registry.redhat.io/multicluster-engine"

overrides:
backplane_operator: "registry.redhat.io/multicluster-engine/backplane-rhel9-operator@sha256:8c2f526398df56f92bfc62af8e42c3e373c236ab67e58e877cf9690fc480d46a"
registration_operator: "registry.redhat.io/multicluster-engine/registration-operator-rhel9@sha256:8a37700e9848830dca9a3eebd4c8ca6abd7b04dc28ab5cefd743d00dd58be92a"
hypershift_addon_operator: "registry.redhat.io/multicluster-engine/hypershift-addon-rhel9-operator@sha256:af40c47a901c3c1851104427d3fd9db1f0cb6205e37917dc87af57facc90d75d"
hypershift_operator: "registry.redhat.io/multicluster-engine/hypershift-rhel9-operator@sha256:161292cbf4b81c928e6dc9162dc63b02b21c93bfa92b3272f437dc4ff5a02c3a"
managedcluster_import_controller: "registry.redhat.io/multicluster-engine/managedcluster-import-controller-rhel9@sha256:09a2f864c76373c9c6af4e8f7c2ffe4dffecc2637cf1647b7d2926419265e3f4"
multicloud_manager: "registry.redhat.io/multicluster-engine/multicloud-manager-rhel9@sha256:a0873734a8e0d0b5092820d7ded0436c30fd572abdabb01159b53f0bb2e9d4a3"
addon_manager: "registry.redhat.io/multicluster-engine/addon-manager-rhel9@sha256:25cdce9461a24748fc6631fa4394b813deabdb27d0c95956508d2a38c504a6a9"
work: "registry.redhat.io/multicluster-engine/work-rhel9@sha256:1fecd5872ad4a0ce5ddab8a156a54315fc51508a4a18a80d901af7f9af294ec6"
registration: "registry.redhat.io/multicluster-engine/registration-rhel9@sha256:26ef4145f464f1c5cdb6ab42c119766669f7f08e46cbd4185bdbd3f4cd70bb54"
placement: "registry.redhat.io/multicluster-engine/placement-rhel9@sha256:737cf1d7dcdf8c32d96894eebd686caf35959232f3fd774b307cf1df8068d26c"
kube_rbac_proxy_mce: "registry.redhat.io/multicluster-engine/kube-rbac-proxy-mce-rhel9@sha256:b1ada80f881131283a94d84cb37edc4b9725ccea9b66ebf8ccd6956cb515531a"
clusterlifecycle_state_metrics: "registry.redhat.io/multicluster-engine/clusterlifecycle-state-metrics-rhel9@sha256:bf5bb514e4d8af5e38317c3727d4cd9f90c22b293fe3e2367f9f0e179e0ee0c7"
backplane_operator: "backplane-rhel9-operator@sha256:8c2f526398df56f92bfc62af8e42c3e373c236ab67e58e877cf9690fc480d46a"
registration_operator: "registration-operator-rhel9@sha256:8a37700e9848830dca9a3eebd4c8ca6abd7b04dc28ab5cefd743d00dd58be92a"
hypershift_addon_operator: "hypershift-addon-rhel9-operator@sha256:af40c47a901c3c1851104427d3fd9db1f0cb6205e37917dc87af57facc90d75d"
hypershift_operator: "hypershift-rhel9-operator@sha256:161292cbf4b81c928e6dc9162dc63b02b21c93bfa92b3272f437dc4ff5a02c3a"
managedcluster_import_controller: "managedcluster-import-controller-rhel9@sha256:09a2f864c76373c9c6af4e8f7c2ffe4dffecc2637cf1647b7d2926419265e3f4"
multicloud_manager: "multicloud-manager-rhel9@sha256:a0873734a8e0d0b5092820d7ded0436c30fd572abdabb01159b53f0bb2e9d4a3"
addon_manager: "addon-manager-rhel9@sha256:25cdce9461a24748fc6631fa4394b813deabdb27d0c95956508d2a38c504a6a9"
work: "work-rhel9@sha256:1fecd5872ad4a0ce5ddab8a156a54315fc51508a4a18a80d901af7f9af294ec6"
registration: "registration-rhel9@sha256:26ef4145f464f1c5cdb6ab42c119766669f7f08e46cbd4185bdbd3f4cd70bb54"
placement: "placement-rhel9@sha256:737cf1d7dcdf8c32d96894eebd686caf35959232f3fd774b307cf1df8068d26c"
kube_rbac_proxy_mce: "kube-rbac-proxy-mce-rhel9@sha256:b1ada80f881131283a94d84cb37edc4b9725ccea9b66ebf8ccd6956cb515531a"
clusterlifecycle_state_metrics: "clusterlifecycle-state-metrics-rhel9@sha256:bf5bb514e4d8af5e38317c3727d4cd9f90c22b293fe3e2367f9f0e179e0ee0c7"
imageCredentials:
dockerConfigJson: ""
registry: "registry.redhat.io"
userName: ""
password: ""
26 changes: 26 additions & 0 deletions test/configuration/mce-ds-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
mceVersion: 2.8
replicaCount: 1
availabilityConfig: Basic

images:
registry: "quay.io/acm-d"

overrides:
backplane_operator: "backplane-rhel9-operator:v2.8.0-13"
registration_operator: "registration-operator-rhel9:v2.8.0-13"
hypershift_addon_operator: "hypershift-addon-rhel9-operator:v2.8.0-5"
hypershift_operator: "hypershift-rhel9-operator:v2.8.0-14"
managedcluster_import_controller: "managedcluster-import-controller-rhel9:v2.8.0-13"
multicloud_manager: "multicloud-manager-rhel9:v2.8.0-9"
addon_manager: "addon-manager-rhel9:v2.8.0-13"
work: "work-rhel9:v2.8.0-13"
registration: "registration-rhel9:v2.8.0-13"
placement: "placement-rhel9:v2.8.0-13"
kube_rbac_proxy_mce: "kube-rbac-proxy-mce-rhel9:v2.8.0-13"
clusterlifecycle_state_metrics: "clusterlifecycle-state-metrics-rhel9:v2.8.0-10"

imageCredentials:
dockerConfigJson: ""
registry: "quay.io"
userName: ""
password: ""
30 changes: 17 additions & 13 deletions test/configuration/mce-values.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@

mceVersion: 2.8
replicaCount: 1
availabilityConfig: Basic

images:
registry: "quay.io/stolostron"

overrides:
backplane_operator: "quay.io/stolostron/backplane-operator:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
registration_operator: "quay.io/stolostron/registration-operator:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
hypershift_addon_operator: "quay.io/stolostron/hypershift-addon-operator:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
hypershift_operator: "quay.io/acm-d/hypershift-rhel9-operator:v2.8.0-4"
managedcluster_import_controller: "quay.io/stolostron/managedcluster-import-controller:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
multicloud_manager: "quay.io/stolostron/multicloud-manager:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
addon_manager: "quay.io/stolostron/addon-manager:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
work: "quay.io/stolostron/work:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
registration: "quay.io/stolostron/registration:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
placement: "quay.io/stolostron/placement:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
kube_rbac_proxy_mce: "quay.io/stolostron/kube-rbac-proxy-mce:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
clusterlifecycle_state_metrics: "quay.io/stolostron/clusterlifecycle-state-metrics:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
backplane_operator: "backplane-operator:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
registration_operator: "registration-operator:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
hypershift_addon_operator: "hypershift-addon-operator:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
managedcluster_import_controller: "managedcluster-import-controller:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
multicloud_manager: "multicloud-manager:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
addon_manager: "addon-manager:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
work: "work:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
registration: "registration:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
placement: "placement:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
kube_rbac_proxy_mce: "kube-rbac-proxy-mce:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
clusterlifecycle_state_metrics: "clusterlifecycle-state-metrics:2.13.0-SNAPSHOT-2024-12-22-19-33-27"

imageCredentials:
dockerConfigJson: ""
registry: "quay.io"
userName: ""
password: ""
25 changes: 25 additions & 0 deletions test/configuration/policy-ds-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
global:
registryOverride: "quay.io/acm-d"
# registry for ACM 2.11.2
# registryOverride: "registry.redhat.io"
imageOverrides:
# upstream images
governance_policy_propagator: "governance-policy-propagator-rhel9:v2.13.0-11"
governance_policy_addon_controller: "acm-governance-policy-addon-controller-rhel9:v2.13.0-12"
config_policy_controller: "config-policy-controller-rhel9:v2.13.0-14"
governance_policy_framework_addon: "acm-governance-policy-framework-addon-rhel9:v2.13.0-11"
klusterlet_addon_controller: "klusterlet-addon-controller-rhel9:v2.13.0-8"

namespace: multicluster-engine
pullSecret: open-cluster-management-image-pull-credentials

cma:
defaultConfig:
name: addon-hosted-config
namespace: multicluster-engine
grc:
hubconfig:
replicaCount: 1
cluster-lifecycle:
hubconfig:
replicaCount: 1
10 changes: 5 additions & 5 deletions test/configuration/policy-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ global:
# registryOverride: "registry.redhat.io"
imageOverrides:
# upstream images
governance_policy_propagator: "governance-policy-propagator:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
governance_policy_addon_controller: "governance-policy-addon-controller:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
config_policy_controller: "config-policy-controller:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
governance_policy_framework_addon: "governance-policy-framework-addon:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
klusterlet_addon_controller: "klusterlet-addon-controller:2.13.0-SNAPSHOT-2024-11-26-00-59-13"
governance_policy_propagator: "governance-policy-propagator:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
governance_policy_addon_controller: "governance-policy-addon-controller:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
config_policy_controller: "config-policy-controller:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
governance_policy_framework_addon: "governance-policy-framework-addon:2.13.0-SNAPSHOT-2024-12-22-19-33-27"
klusterlet_addon_controller: "klusterlet-addon-controller:2.13.0-SNAPSHOT-2024-12-22-19-33-27"

namespace: multicluster-engine
pullSecret: open-cluster-management-image-pull-credentials
Expand Down
Loading