Prerequisites
Check whether alicloud-monitor-controller
has been deployed in the kube-system
namespace. If not, upgrade the version of the cluster.
Procedure
- Log on to the Container Service console.
- In the left-side navigation pane under Container Service-Kubernetes, choose .
- Select the target deployment, click Monitor on the right. You can also click Monitor on the Deployment page of the built-in kubernetes dashboard.
In this case, you jump to the corresponding Application group details page of CloudMonitor.
- Application group supports monitoring in two dimensions: group and instance.
- For alarm settings, the index of group level starts with group, and the instance level index starts with pod.
Upgrade cluster version
- Log on to the Container Service console.
- In the left-side navigation pane under Container Service-Kubernetes, choose . Then, in the upper-right corner, click Create by Template.
- Select the target cluster, kube-system namespace, and use the following sample template.
Then click Create.
Note Replace REGION and CLUSTER_ID with your actual cluster information, and redeploy heapster yaml template.
An example of heapster template is as follows. If you have an earlier version of the heapster in the cluster, you can log on to the Kubernetes cluster and run the
kubectl apply -f xxx.yaml
command to upgrade it.apiVersion: extensions/v1beta1 kind: Deployment metadata: name: heapster namespace: kube-system spec: replicas: 1 template: metadata: labels: task: monitoring k8s-app: heapster annotations: scheduler.alpha.kubernetes.io/critical-pod: '' spec: serviceAccount: admin containers: - name: heapster image: registry. ##REGION##.aliyuncs.com/acs/heapster-amd64:v1.5.1.1 imagePullPolicy: IfNotPresent command: - /heapster - --source=kubernetes:https://kubernetes.default - --historical-source=influxdb:http://monitoring-influxdb:8086 - --sink=influxdb:http://monitoring-influxdb:8086 - --sink=socket:tcp://monitor.csk. ##REGION##.aliyuncs.com:8093? clusterId=##CLUSTER_ID##&public=true
The example layout of alicloud-monitor-controller is as follows. Run thekubectl create -f xxx.yaml
command to deploy alicloud-monitor-controller.apiVersion: extensions/v1beta1 kind: Deployment metadata: name: alicloud-monitor-controller namespace: kube-system spec: replicas: 1 template: metadata: labels: task: monitoring k8s-app: alicloud-monitor-controller annotations: scheduler.alpha.kubernetes.io/critical-pod: '' spec: hostNetwork: true tolerations: - effect: NoSchedule operator: Exists key: node-role.kubernetes.io/master - effect: NoSchedule operator: Exists key: node.cloudprovider.kubernetes.io/uninitialized serviceAccount: admin containers: - name: alicloud-monitor-controller image: registry. ##REGION##.aliyuncs.com/acs/alicloud-monitor-controller:v1.0.0 imagePullPolicy: IfNotPresent command: - /alicloud-monitor-controller - agent - --regionId=##REGION## - --clusterId=##CLUSTER_ID## - --logtostderr - --v=4
- Go to the Kubernetes console. In the kube-system namespace, you can see that the two
deployments are running, and the upgrade is complete.
If you do not know the REGION information, you can go to the ECS console and select the region where your cluster resides. The last segment of the page URL address is REGION.
