2 ##############################################################################
3 # Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 if grep -q "cadvisor" /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
12 sed -e "/cadvisor-port=0/d" -i /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
13 systemctl daemon-reload
14 systemctl restart kubelet
17 if kubectl get po -n monitoring |grep prometheus-k8s |grep -q Running
19 echo "monitoring k8s deployment has been done"
21 git clone https://github.com/coreos/prometheus-operator.git
22 cd prometheus-operator
23 kubectl apply -n kube-system -f bundle.yaml
24 cd contrib/kube-prometheus
26 hack/cluster-monitoring/deploy
29 while ! $(kubectl get po -n monitoring |grep prometheus-k8s |grep -q Running);do
30 echo "waiting for monitoring deployment finish!"
34 echo "waiting for monitoring tool works"