From 6ff186974e0150c7fd60c625bf033071908e64f5 Mon Sep 17 00:00:00 2001 From: Zhiwei Yin Date: Wed, 9 Oct 2024 12:57:20 +0800 Subject: [PATCH] update cma (#15) Signed-off-by: Zhiwei Yin --- configuration/addonhostedconfig.yaml | 9 ++++++++ configuration/workmanagercma.yaml | 23 +++++++++++++++++++ hack/e2e.sh | 5 ++++ policy/charts/cluster-lifecycle/values.yaml | 2 +- .../config-policy-clustermanagementaddon.yaml | 2 ++ ...licy-framework-clustermanagementaddon.yaml | 3 +++ policy/charts/grc/values.yaml | 6 ++++- policy/values.yaml | 12 ++++------ 8 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 configuration/addonhostedconfig.yaml create mode 100644 configuration/workmanagercma.yaml diff --git a/configuration/addonhostedconfig.yaml b/configuration/addonhostedconfig.yaml new file mode 100644 index 0000000..dd1d36f --- /dev/null +++ b/configuration/addonhostedconfig.yaml @@ -0,0 +1,9 @@ +apiVersion: addon.open-cluster-management.io/v1alpha1 +kind: AddOnDeploymentConfig +metadata: + name: addon-hosted-config + namespace: multicluster-engine +spec: + customizedVariables: + - name: managedKubeConfigSecret + value: external-managed-kubeconfig diff --git a/configuration/workmanagercma.yaml b/configuration/workmanagercma.yaml new file mode 100644 index 0000000..cee7c1e --- /dev/null +++ b/configuration/workmanagercma.yaml @@ -0,0 +1,23 @@ +apiVersion: addon.open-cluster-management.io/v1alpha1 +kind: ClusterManagementAddOn +metadata: + annotations: + addon.open-cluster-management.io/lifecycle: addon-manager + name: work-manager +spec: + addOnMeta: + description: work-manager provides action, view and rbac settings + displayName: work-manager + installStrategy: + placements: + - name: global + namespace: open-cluster-management-global-set + rolloutStrategy: + type: All + type: Placements + supportedConfigs: + - defaultConfig: + name: addon-hosted-config + namespace: multicluster-engine + group: addon.open-cluster-management.io + resource: addondeploymentconfigs diff --git a/hack/e2e.sh b/hack/e2e.sh index 3769c32..7aad67a 100755 --- a/hack/e2e.sh +++ b/hack/e2e.sh @@ -69,6 +69,11 @@ echo "" echo "###### Wait unitl MCE CR is Available ######" waitForReady "kubectl get mce multiclusterengine | grep -c \"Available\"" 1 +echo "" +echo "###### create addonhostedconfig ######" +kubectl apply -f ./configuration/addonhostedconfig.yaml + + echo "" echo "#### Install Policy addons #####" make install-policy diff --git a/policy/charts/cluster-lifecycle/values.yaml b/policy/charts/cluster-lifecycle/values.yaml index 7b4025e..744ee4b 100644 --- a/policy/charts/cluster-lifecycle/values.yaml +++ b/policy/charts/cluster-lifecycle/values.yaml @@ -9,6 +9,6 @@ global: hubconfig: nodeSelector: null proxyConfigs: {} - replicaCount: 1 + replicaCount: 2 tolerations: [] org: open-cluster-management diff --git a/policy/charts/grc/templates/config-policy-clustermanagementaddon.yaml b/policy/charts/grc/templates/config-policy-clustermanagementaddon.yaml index ec655a0..1705dd8 100644 --- a/policy/charts/grc/templates/config-policy-clustermanagementaddon.yaml +++ b/policy/charts/grc/templates/config-policy-clustermanagementaddon.yaml @@ -9,3 +9,5 @@ spec: supportedConfigs: - group: addon.open-cluster-management.io resource: addondeploymentconfigs + defaultConfig: + {{- toYaml .Values.global.cma.defaultConfig | nindent 8 }} diff --git a/policy/charts/grc/templates/governance-policy-framework-clustermanagementaddon.yaml b/policy/charts/grc/templates/governance-policy-framework-clustermanagementaddon.yaml index 76f9da9..5eba13b 100644 --- a/policy/charts/grc/templates/governance-policy-framework-clustermanagementaddon.yaml +++ b/policy/charts/grc/templates/governance-policy-framework-clustermanagementaddon.yaml @@ -9,3 +9,6 @@ spec: supportedConfigs: - group: addon.open-cluster-management.io resource: addondeploymentconfigs + defaultConfig: + {{- toYaml .Values.global.cma.defaultConfig | nindent 8 }} + diff --git a/policy/charts/grc/values.yaml b/policy/charts/grc/values.yaml index c92ef75..0ab8ef2 100644 --- a/policy/charts/grc/values.yaml +++ b/policy/charts/grc/values.yaml @@ -12,9 +12,13 @@ global: pullSecret: null pullPolicy: Always hubSize: Small + + cma: + defaultConfig: {} + hubconfig: nodeSelector: null proxyConfigs: {} - replicaCount: 1 + replicaCount: 2 tolerations: [] org: open-cluster-management diff --git a/policy/values.yaml b/policy/values.yaml index d35ff77..8fc56be 100644 --- a/policy/values.yaml +++ b/policy/values.yaml @@ -15,10 +15,8 @@ global: # klusterlet_addon_controller: "registry.redhat.io/rhacm2/klusterlet-addon-controller-rhel9@sha256:478e3e6cda0d74f43b0f05911d023344108a5cd79d57d5cc9f268ad064848a00" namespace: multicluster-engine pullSecret: open-cluster-management-image-pull-credentials -grc: - hubconfig: - replicaCount: 2 - -cluster-lifecycle: - hubconfig: - replicaCount: 2 + + cma: + defaultConfig: + name: addon-hosted-config + namespace: multicluster-engine