From 3d04f5a199388dfc9c94c7a60bc3373e7ca5c979 Mon Sep 17 00:00:00 2001 From: Yang Chiu Date: Wed, 4 Dec 2024 14:18:31 +0800 Subject: [PATCH] ci: install metrics server in talos Signed-off-by: Yang Chiu --- pipelines/e2e/scripts/longhorn-setup.sh | 5 +++++ pipelines/utilities/install_metrics_server.sh | 4 ++++ test_framework/scripts/longhorn-setup.sh | 5 +++++ 3 files changed, 14 insertions(+) create mode 100644 pipelines/utilities/install_metrics_server.sh diff --git a/pipelines/e2e/scripts/longhorn-setup.sh b/pipelines/e2e/scripts/longhorn-setup.sh index dac0b3ae9..7f7f317bd 100755 --- a/pipelines/e2e/scripts/longhorn-setup.sh +++ b/pipelines/e2e/scripts/longhorn-setup.sh @@ -8,6 +8,7 @@ source pipelines/utilities/install_csi_snapshotter.sh source pipelines/utilities/create_aws_secret.sh source pipelines/utilities/create_harvester_secret.sh source pipelines/utilities/install_backupstores.sh +source pipelines/utilities/install_metrics_server.sh source pipelines/utilities/create_longhorn_namespace.sh source pipelines/utilities/longhorn_manifest.sh source pipelines/utilities/longhorn_ui.sh @@ -60,6 +61,10 @@ main(){ longhornctl_check fi + if [[ "${DISTRO}" == "talos" ]]; then + install_metrics_server + fi + generate_longhorn_yaml_manifest install_longhorn_by_manifest diff --git a/pipelines/utilities/install_metrics_server.sh b/pipelines/utilities/install_metrics_server.sh new file mode 100644 index 000000000..0554f26c3 --- /dev/null +++ b/pipelines/utilities/install_metrics_server.sh @@ -0,0 +1,4 @@ +install_metrics_server(){ + kubectl apply -f "https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml" + kubectl patch deployment metrics-server -n kube-system --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--kubelet-insecure-tls"}]' +} diff --git a/test_framework/scripts/longhorn-setup.sh b/test_framework/scripts/longhorn-setup.sh index f58f688df..b091c3a9b 100755 --- a/test_framework/scripts/longhorn-setup.sh +++ b/test_framework/scripts/longhorn-setup.sh @@ -5,6 +5,7 @@ set -x source test_framework/scripts/kubeconfig.sh source pipelines/utilities/longhorn_manifest.sh source pipelines/utilities/longhorn_ui.sh +source pipelines/utilities/install_metrics_server.sh # create and clean tmpdir TMPDIR="/tmp/longhorn" @@ -568,6 +569,10 @@ main(){ longhornctl_check fi + if [[ "${DISTRO}" == "talos" ]]; then + install_metrics_server + fi + if [[ "${AIR_GAP_INSTALLATION}" == true ]]; then if [[ "${LONGHORN_INSTALL_METHOD}" == "manifest-file" ]]; then create_registry_secret