Skip to content

Files

Latest commit

author
wanglipeng
Jan 16, 2023
91106bf · Jan 16, 2023

History

History
This branch is 587 commits behind flashcatcloud/categraf:main.

k8s

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 20, 2022
Nov 5, 2022
Aug 9, 2022
Jun 17, 2022
Aug 9, 2022
Jul 26, 2022
Aug 8, 2022
Jul 13, 2022
Jan 16, 2023
Jan 16, 2023
Aug 29, 2022
Jul 26, 2022
Jul 26, 2022
Jun 28, 2022
Jul 26, 2022
Sep 19, 2022
Aug 9, 2022
Jul 26, 2022
Jul 26, 2022
Jul 26, 2022
Jul 26, 2022
Sep 15, 2022

monitoring kubernetes control plane with plugin prometheus

if your control plane is in pod, for example, you use kubeadm build k8s cluster. Then kube-controller-manager, kube-scheduler and etcd need some extra work to be discovery.

create service for kube-controller-manager

  1. kubectl apply -f controller-service.yaml
  2. edit /etc/kubernetes/manifests/kube-controller-manager.yaml , modify or add one line - --bind-address=0.0.0.0
  3. wait kube-controller-manager to restart

create service for kube-scheduler

  1. kubectl apply -f scheduler-service.yaml
  2. edit /etc/kubernetes/manifests/kube-scheduler.yaml , modify or add one line - --bind-address=0.0.0.0
  3. wait kube-scheduler to restart

create service for etcd

  1. kubectl apply -f etcd-service-http.yaml
  2. edit /etc/kubernetes/manifests/etcd.yaml , modify - --listen-metrics-urls=http://127.0.0.1:2381 to - --listen-metrics-urls=http://0.0.0.0:2381
  3. wait etcd to restart

create all other objects with deployment

  1. edit deployment.yaml and modify it with your own configure.

    i. replace ${CATEGRAF_NAMESPACE} which located in ClusterRoleBinding part

    ii. replace ${NSERVER_SERVICE_WITH_PORT} which located in ConfigMap part config.toml and in_cluster_scrape.yaml

    if you choose etcd-service.yaml with https mode, then kubectl apply -f etcd-service.yaml.

    iii. replace {data of your etcd ca file} {data of your etcd client cert file} {data of your etcd client key file} in ConfigMap etcd-pki.

  2. kubectl apply -f deployment-etcd-http.yaml -n monitoring

Make sure that deployment.yaml always appears with etcd-service.yaml and deployment-etcd-http appears with etcd-service-http.yaml. They cannot be apply at the same time.

dashboards show


apiserver-dashboards


controller-dashboards


scheduler-dashboards


etcd-dashboards


coredns-dashboards