k8s-1.28.2 部署prometheus

一、prometheus helm仓库

复制代码
## 网站地址
# https://artifacthub.io/


## prometheus 地址
# https://artifacthub.io/packages/helm/prometheus-community/prometheus

.

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts

helm repo update

二、下载及解压

helm search repo prometheus-community

helm pull prometheus-community/kube-prometheus-stack

三、修改values.yaml文件

复制代码
# alertmanager: 修改

ingress:
    enabled: true
    ingressClassName: nginx
    annotations: {}
    labels: {}
    hosts:
      - alertmanager.kyc.com
    paths:
     - /
storage:
     volumeClaimTemplate:
       spec:
         storageClassName: nfs-logs
         accessModes: ["ReadWriteOnce"]
         resources:
           requests:
             storage: 50Gi

# grafana  修改
ingress:
    enabled: true
    ingressClassName: nginx
    annotations: {}
    labels: {}
    hosts:
      - grafana.kyc.com
    path: /


# prometheus: 修改
ingress:
    enabled: true
    ingressClassName: nginx
    annotations: {}
    labels: {}
    hosts:
      - prometheus.kys.com
    paths:
     - /
## Prometheus StorageSpec for persistent data
    ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/storage.md
    ##
    storageSpec:
    ## Using PersistentVolumeClaim
    ##
      volumeClaimTemplate:
        spec:
          storageClassName: nfs-logs
          accessModes: ["ReadWriteOnce"]
          resources:
            requests:
              storage: 70Gi

helm upgrade --install prometheus ./ -f values.yaml -n prometheus

四、测试

grafana:

密码:

kubectl get secret -n prometheus prometheus-grafana -o jsonpath="{.data.admin-password}"|base64 --decode

五、添加数据源

有默认的,不用配置。

六、下载模板

下载模板:Grafana dashboards | Grafana Labs

七、导入dashboard

相关推荐
GreenMountainEcho1 小时前
Kubernetes 入门篇之 Node 安装与部署
云原生·容器·kubernetes
zyk_5202 小时前
Docker desktop如何汉化
运维·docker·容器
韭菜盖饭2 小时前
解决Docker端口映射后外网无法访问的问题
运维·docker·容器
jingjingjing11113 小时前
笔记:docker安装(ubuntu 20.04)
笔记·docker·容器
ghostwritten3 小时前
Rancher Backup
kubernetes·rancher
qq_339282234 小时前
docker之network
运维·docker·容器
alden_ygq4 小时前
k8s statefulset pod重启顺序
云原生·容器·kubernetes
ghostwritten4 小时前
k8s黑科技:Linux+Vagrant+VirtualBox开启Kubernetes奇幻之旅
linux·科技·kubernetes
@郭小茶6 小时前
windows部署docker
windows·docker·容器
云上艺旅7 小时前
K8S学习之基础七十二:Ingress基于Https代理pod
学习·云原生·容器·https·kubernetes