From f4d431f80a45daeca8f320693c2c8b34b1cd8bd1 Mon Sep 17 00:00:00 2001 From: alecsandru Date: Sat, 4 May 2024 17:24:05 +0000 Subject: [PATCH] Update 'k8s/setup_calico.yml' --- k8s/setup_calico.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/k8s/setup_calico.yml b/k8s/setup_calico.yml index 315981c..26a5f7e 100644 --- a/k8s/setup_calico.yml +++ b/k8s/setup_calico.yml @@ -25,5 +25,9 @@ - "kubectl apply -f $HOME/calico/custom-resources.yaml" args: creates: $HOME/calico/custom-resources.yaml + - name: Check if Metrics API is installed + shell: "kubectl get pods -n kube-system | grep metrics | wc -l" + register: METRICS_COUNT - name: Setup Metrics API - shell: "kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/high-availability.yaml" \ No newline at end of file + shell: "kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/high-availability.yaml" + when: METRICS_COUNT.stdout|int < 1 \ No newline at end of file