From 727cd0e34014bc98d5a719ab76e51a3ab247c83d Mon Sep 17 00:00:00 2001 From: Marouan MOHAMED Date: Tue, 7 Apr 2020 13:02:22 +0200 Subject: [PATCH] Fix CPU-Temp agent --- k8s/{master-agent.sh => agent.sh} | 9 +++++++-- k8s/api.yaml | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) rename k8s/{master-agent.sh => agent.sh} (81%) diff --git a/k8s/master-agent.sh b/k8s/agent.sh similarity index 81% rename from k8s/master-agent.sh rename to k8s/agent.sh index 3113f42..ed6c8b8 100644 --- a/k8s/master-agent.sh +++ b/k8s/agent.sh @@ -1,6 +1,11 @@ #!/bin/bash -# nohup sh master-agent.sh [YOUR-SECURITY-TOKEN] > /tmp/master-agent.log +# nohup sh agent.sh [NODE-NAME] [YOUR-SECURITY-TOKEN] > /tmp/agent.log if [ -z "$1" ]; then + echo "Node name required !" + exit 1 +fi + +if [ -z "$2" ]; then echo "Security Token required !" exit 1 fi @@ -17,7 +22,7 @@ while true; do exit 1 fi - url="$server?node=master&value=$temperature" + url="$server?node=$2&value=$temperature" responseCode=$(curl --silent --output /dev/null --write-out "%{http_code}" $url) diff --git a/k8s/api.yaml b/k8s/api.yaml index 2cfcc47..35c191d 100644 --- a/k8s/api.yaml +++ b/k8s/api.yaml @@ -159,8 +159,8 @@ spec: tolerations: # this toleration is to have the daemonset runnable on master nodes # remove it if your masters can't run pods - #- key: node-role.kubernetes.io/master - # effect: NoSchedule + - key: node-role.kubernetes.io/master + effect: NoSchedule containers: - name: monitoring-agent image: busybox