关于helm:Helm-安装-Kubernetes-监控套件

38次阅读

共计 3213 个字符,预计需要花费 9 分钟才能阅读完成。

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…

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

全网可搜《小陈运维》

文章次要公布于微信公众号

正文完
 0