Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to configure Kubernetes-prometheus install

Shulou Source: shulou.com Published: 2022-05-31 13:03:09 10月03日 Update

Today, the editor will share with you the relevant knowledge about how to configure Kubernetes-prometheus install. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

# 1. Package download

Wget http://10.245.254.93/linux/soft/docker/kubernetes/prometheus/kube-prometheus-0.1.0.tar.gz

Tar zxpf kube-prometheus-0.1.0.tar.gz

Cd kube-prometheus-0.1.0

# 2. In the case of offline installation, all image in the manifests directory needs to be downloaded to the local registry, and the yaml file needs to be modified to point to the local

Sed-I "s | quay.io/prometheus | ispcdocker.com/coreos | g" manifests/*yaml

Sed-I "s | quay.io/coreos | ispcdocker.com/coreos | g" manifests/*yaml

Sed-I "s | k8s.gcr.io | ispcdocker.com/coreos | g" manifests/*yaml

Sed-I "s | grafana/grafana:6.0.1 | ispcdocker.com/coreos/grafana:6.1.6 | g" manifests/*yaml

# 3. There are too many yaml files in the manifests directory, so the default method is used and cannot be executed in full priority order. Although some of the file names have been officially changed to the beginning of the number 0, the effect is not good. In the case of out of order, there will only be no error: ServiceMonitor can not find it. So, add a new subdirectory, store the yaml files starting with 0 separately, and execute them first.

Mkdir manifests/first

Mv manifests/0*yaml manifests/first

Kubectl create-f manifests/first/

Kubectl create-f manifests/

# 4. Query status

# kubectl-n monitoring top pods

# kubectl-n monitoring get all

# kubectl-n monitoring get pod

# kubectl get customresourcedefinitions

# kubectl-n monitoring get svc

# kubectl-n monitoring get endpoints

# kubectl-n monitoring get servicemonitors

These are all the contents of this article "how to configure Kubernetes-prometheus install". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Tags: File knowledge article configuration content beginning situation number directory order different large confused sequence most subitems subdirectories official that is point to Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker NVidia MySQL Shulou Information Redmi