From: garciadeblas Date: Fri, 31 May 2024 15:52:09 +0000 (+0200) Subject: Install Kubernetes metrics server as part of install_kubeadm_cluster.sh X-Git-Tag: release-v16.0-start~24 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=44cb851caff361e3b7ff360ce2b80d0ff5d57faf;p=osm%2Fdevops.git Install Kubernetes metrics server as part of install_kubeadm_cluster.sh Change-Id: I10cf820eb59d57285e001a6870c525b1a1ea6053 Signed-off-by: garciadeblas --- diff --git a/installers/install_kubeadm_cluster.sh b/installers/install_kubeadm_cluster.sh index c64e28f3..8df46190 100755 --- a/installers/install_kubeadm_cluster.sh +++ b/installers/install_kubeadm_cluster.sh @@ -17,6 +17,7 @@ set +eux K8S_VERSION=1.30 K8S_PACKAGE_VERSION="$K8S_VERSION".1-1.1 +K8S_METRICS_VERSION="v0.7.1" # installs kubernetes packages function install_kube() { @@ -108,6 +109,15 @@ function check_and_track_k8s_ready_before_helm() { [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function } +# removes osm deployments and services +function install_k8s_metrics() { + [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function + echo "Installing Kubernetes metrics" + kubectl apply -f "https://github.com/kubernetes-sigs/metrics-server/releases/${K8S_METRICS_VERSION}/download/components.yaml" + kubectl -n kube-system patch deployment metrics-server --type=json -p '[{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--kubelet-insecure-tls"}]' + [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function +} + # removes osm deployments and services function remove_k8s_namespace() { [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function @@ -115,7 +125,6 @@ function remove_k8s_namespace() { kubectl delete ns $1 2>/dev/null [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function } - # main while getopts ":D:d:i:-: " o; do case "${o}" in @@ -171,6 +180,8 @@ deploy_cni_provider taint_master_node check_and_track_k8s_ready_before_helm +install_k8s_metrics + remove_k8s_namespace osm # install_helm has been moved to install_helm_client.sh, run from full_install_osm.sh,