Helm 安装 Kubernetes 监控套件

本文涉及的产品
可观测监控 Prometheus 版,每月50GB免费额度
容器服务 Serverless 版 ACK Serverless,317元额度 多规格
可观测可视化 Grafana 版,10个用户账号 1个月
简介: Helm 安装 Grafana Prometheus Altermanager 套件

Helm 安装 Grafana Prometheus Altermanager 套件

安装helm

# 安装helm工具
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

下载离线包

# 添加 prometheus-community 官方Helm Chart仓库
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts

# 下载离线包
helm pull  prometheus-community/kube-prometheus-stack

# 解压下载下来的包
tar xvf kube-prometheus-stack-45.1.0.tgz 

修改镜像地址

# 进入目录进行修改images地址
cd kube-prometheus-stack/
sed -i "s#registry.k8s.io/kube-state-metrics/kube-state-metrics#registry.cn-hangzhou.aliyuncs.com/chenby/kube-state-metrics#g" charts/kube-state-metrics/values.yaml

# 修改为如下
vim values.yaml
···
      image:
        registry: registry.cn-hangzhou.aliyuncs.com
        repository: chenby/kube-webhook-certgen
···

安装

# 进行安装 
helm install  op  . 
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /root/.kube/config
NAME: op
LAST DEPLOYED: Wed Feb 15 17:28:47 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
kube-prometheus-stack has been installed. Check its status by running:
  kubectl --namespace default get pods -l "release=op"

Visit https://github.com/prometheus-operator/kube-prometheus for instructions on how to create & configure Alertmanager and Prometheus instances using the Operator.

修改 svc

# 修改 svc 将其设置为NodePort
kubectl  edit svc op-grafana
kubectl  edit svc op-kube-prometheus-stack-prometheus 
        type: NodePort

查看

root@hello:~# kubectl --namespace default get pods -l "release=op"
NAME                                                READY   STATUS    RESTARTS   AGE
op-kube-prometheus-stack-operator-bf67f6dbc-dsqgq   1/1     Running   0          12m
op-kube-state-metrics-d94c76d4f-r9nkg               1/1     Running   0          12m
op-prometheus-node-exporter-2hlmc                   1/1     Running   0          12m
op-prometheus-node-exporter-8trpl                   1/1     Running   0          12m
op-prometheus-node-exporter-j2lns                   1/1     Running   0          12m
op-prometheus-node-exporter-j4l69                   1/1     Running   0          12m
op-prometheus-node-exporter-krw2v                   1/1     Running   0          12m
root@hello:~# 

# 查看svc
root@hello:~# kubectl --namespace default get svc | grep op
alertmanager-operated                   ClusterIP   None             <none>        9093/TCP,9094/TCP,9094/UDP   12m
op-grafana                              NodePort    10.102.25.207    <none>        80:32174/TCP                 12m
op-kube-prometheus-stack-alertmanager   ClusterIP   10.102.32.128    <none>        9093/TCP                     12m
op-kube-prometheus-stack-operator       ClusterIP   10.109.56.209    <none>        443/TCP                      12m
op-kube-prometheus-stack-prometheus     NodePort    10.101.74.136    <none>        9090:30777/TCP               12m
op-kube-state-metrics                   ClusterIP   10.99.39.208     <none>        8080/TCP                     12m
op-prometheus-node-exporter             ClusterIP   10.99.213.34     <none>        9100/TCP                     12m
prometheus-operated                     ClusterIP   None             <none>        9090/TCP                     12m
root@hello:~# 

# 查看POD
root@hello:~# kubectl --namespace default get pod | grep op
alertmanager-op-kube-prometheus-stack-alertmanager-0   2/2     Running            1 (13m ago)   13m
op-grafana-5cd75cfd86-4df7g                            3/3     Running            0             13m
op-kube-prometheus-stack-operator-bf67f6dbc-dsqgq      1/1     Running            0             13m
op-kube-state-metrics-d94c76d4f-r9nkg                  1/1     Running            0             13m
op-prometheus-node-exporter-2hlmc                      1/1     Running            0             13m
op-prometheus-node-exporter-8trpl                      1/1     Running            0             13m
op-prometheus-node-exporter-j2lns                      1/1     Running            0             13m
op-prometheus-node-exporter-j4l69                      1/1     Running            0             13m
op-prometheus-node-exporter-krw2v                      1/1     Running            0             13m
prometheus-op-kube-prometheus-stack-prometheus-0       2/2     Running            0             13m
root@hello:~# 

访问


# 访问
http://192.168.1.61:30777
http://192.168.1.61:32174
关于

https://www.oiox.cn/

https://www.oiox.cn/index.php/start-page.html

CSDN、GitHub、51CTO、知乎、开源中国、思否、掘金、简书、华为云、阿里云、腾讯云、哔哩哔哩、今日头条、新浪微博、个人博客

全网可搜《小陈运维》

文章主要发布于微信公众号

相关实践学习
通过Ingress进行灰度发布
本场景您将运行一个简单的应用,部署一个新的应用用于新的发布,并通过Ingress能力实现灰度发布。
容器应用与集群管理
欢迎来到《容器应用与集群管理》课程,本课程是“云原生容器Clouder认证“系列中的第二阶段。课程将向您介绍与容器集群相关的概念和技术,这些概念和技术可以帮助您了解阿里云容器服务ACK/ACK Serverless的使用。同时,本课程也会向您介绍可以采取的工具、方法和可操作步骤,以帮助您了解如何基于容器服务ACK Serverless构建和管理企业级应用。 学习完本课程后,您将能够: 掌握容器集群、容器编排的基本概念 掌握Kubernetes的基础概念及核心思想 掌握阿里云容器服务ACK/ACK Serverless概念及使用方法 基于容器服务ACK Serverless搭建和管理企业级网站应用
相关文章
|
21天前
|
Kubernetes 应用服务中间件 nginx
Kubernetes上安装Metallb和Ingress并部署应用程序
Kubernetes上安装Metallb和Ingress并部署nginx应用程序,使用LoadBalancer类型的KubernetesService
87 3
|
2月前
|
Kubernetes 数据库 容器
k8s安装seata单机版
k8s安装seata单机版
|
2月前
|
消息中间件 Kubernetes 容器
k8s安装rabbbitmq
k8s安装rabbbitmq
|
2月前
|
Kubernetes NoSQL MongoDB
k8s安装YAPI
k8s安装YAPI
|
2月前
|
Kubernetes 关系型数据库 MySQL
k8s安装并迁移jumpserver
k8s安装并迁移jumpserver
|
1月前
|
运维 Kubernetes 监控
Loki+Promtail+Grafana监控K8s日志
综上,Loki+Promtail+Grafana 监控组合对于在 K8s 环境中优化日志管理至关重要,它不仅提供了强大且易于扩展的日志收集与汇总工具,还有可视化这些日志的能力。通过有效地使用这套工具,可以显著地提高对应用的运维监控能力和故障诊断效率。
66 0
|
2月前
|
Kubernetes 调度 容器
k8s descheduler 组件安装
k8s descheduler 组件安装
|
2月前
|
Kubernetes 安全 持续交付
在K8S中,二进制安装和Kubeadm安装有什么区别?
在K8S中,二进制安装和Kubeadm安装有什么区别?
|
2月前
|
Kubernetes 容器
在K8S中,helm是什么?如何使用?
在K8S中,helm是什么?如何使用?
|
2月前
|
Prometheus 监控 Kubernetes
在k8S中,状态码监控是怎么做的?
在k8S中,状态码监控是怎么做的?
下一篇
无影云桌面