prometheus08-k8s部署prometheus
发表于:2025-02-02 作者:千家信息网编辑
千家信息网最后更新 2025年02月02日,1.基础环境有k8s集群[root@kubemaster01 prometheus]# kubectl get node NAME STATUS ROLES AGE
千家信息网最后更新 2025年02月02日prometheus08-k8s部署prometheus
1.基础环境有k8s集群
[root@kubemaster01 prometheus]# kubectl get node NAME STATUS ROLES AGE VERSION192.168.249.51 Ready63d v1.12.3192.168.249.52 Ready 63d v1.12.3192.168.249.53 Ready 63d v1.12.3You have new mail in /var/spool/mail/root[root@kubemaster01 prometheus]# kubectl get csNAME STATUS MESSAGE ERRORscheduler Healthy ok controller-manager Healthy ok etcd-1 Healthy {"health":"true"} etcd-2 Healthy {"health":"true"} etcd-0 Healthy {"health":"true"} [root@kubemaster01 prometheus]#
2.下载prometheus yaml
for file in prometheus-configmap.yaml prometheus-rbac.yaml prometheus-service.yaml prometheus-statefulset.yaml ;do wget https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/addons/prometheus/$file;done
3.设置动态storageclass
3.1.kubectl apply -f rbac.yml
kind: ServiceAccountapiVersion: v1metadata: name: nfs-client-provisioner---kind: ClusterRoleapiVersion: rbac.authorization.k8s.io/v1metadata: name: nfs-client-provisioner-runnerrules: - apiGroups: [""] resources: ["persistentvolumes"] verbs: ["get", "list", "watch", "create", "delete"] - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["get", "list", "watch", "update"] - apiGroups: ["storage.k8s.io"] resources: ["storageclasses"] verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["events"] verbs: ["create", "update", "patch"]---kind: ClusterRoleBindingapiVersion: rbac.authorization.k8s.io/v1metadata: name: run-nfs-client-provisionersubjects: - kind: ServiceAccount name: nfs-client-provisioner namespace: defaultroleRef: kind: ClusterRole name: nfs-client-provisioner-runner apiGroup: rbac.authorization.k8s.io---kind: RoleapiVersion: rbac.authorization.k8s.io/v1metadata: name: leader-locking-nfs-client-provisionerrules: - apiGroups: [""] resources: ["endpoints"] verbs: ["get", "list", "watch", "create", "update", "patch"]---kind: RoleBindingapiVersion: rbac.authorization.k8s.io/v1metadata: name: leader-locking-nfs-client-provisionersubjects: - kind: ServiceAccount name: nfs-client-provisioner namespace: defaultroleRef: kind: Role name: leader-locking-nfs-client-provisioner apiGroup: rbac.authorization.k8s.io
3.2 设置存储deployment.yaml
apiVersion: v1kind: ServiceAccountmetadata: name: nfs-client-provisioner---kind: DeploymentapiVersion: apps/v1metadata: name: nfs-client-provisionerspec: replicas: 1 selector: matchLabels: app: nfs-client-provisioner strategy: type: Recreate template: metadata: labels: app: nfs-client-provisioner spec: serviceAccountName: nfs-client-provisioner containers: - name: nfs-client-provisioner image: quay.io/external_storage/nfs-client-provisioner:latest volumeMounts: - name: nfs-client-root mountPath: /persistentvolumes env: - name: PROVISIONER_NAME value: fuseim.pri/ifs - name: NFS_SERVER value: 192.168.249.54 - name: NFS_PATH value: /data/k8s/prometheus volumes: - name: nfs-client-root nfs: server: 192.168.249.54 path: /data/k8s/prometheus
3.4 kubectl apply -f class.yaml
apiVersion: storage.k8s.io/v1kind: StorageClassmetadata: name: managed-nfs-storageprovisioner: fuseim.pri/ifs # or choose another name, must match deployment's env PROVISIONER_NAME'parameters: archiveOnDelete: "false"
3.5 备注说明 nfs 是提前部署好的(ip:192.168.249.54)
[root@es prometheus]# cat /etc/exports/data/k8s/prometheus 192.168.249.0/24(rw,sync,no_root_squash)[root@es prometheus]#
4.修改prometheus的存储地址(prometheus-statefulset.yaml)
4.把 prometheus的svc 发布改为nodeport
5.部署
kubectl apply -f prometheus-rbac.yaml prometheus-configmap.yaml prometheus-statefulset.yaml prometheus-service.yaml
6. 访问
7.
存储
动态
地址
基础
备注
环境
集群
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
舟山云软件开发费用
网络安全人工智能论文在哪里下载
web开发连接数据库
信息安全技术和数据库技术
网络安全赛道前景
关于网络安全议论文800字
建党100周年网络安全方案
分布式服务器架构视频
大数据网络安全研究方法
网络安全性和保密性
数据库有用吗
软件开发可转债上市公司
农村留守儿童数据库培训
靠谱的网络安全服务哪里有
什么是云教学管理服务器
江苏电话软件开发预算
决定网络服务器租用价格的参数
仓储系统用什么软件开发
经常与服务器断开连接
哪种服务器主板好
软件开发测试计划报告
stm软件开发周记500字
网络安全挑战战
无限法则怎么连接不上服务器
文件传输助手需要经过服务器
我的世界服务器管理员崩服指令
贵阳市庶足网络技术
pg数据库驱动下载
太极app服务器错误
软件开发技术存在的问题