K8S 部署 prometheus和granfana
16lz
2021-03-26
作者:李毓
现在的helm仓库如下
[root@adm-master prometheus]# helm repo listNAME URL charts https://kubernetes.oss-cn-hangzhou.aliyuncs.com/chartsstable http://mirror.azure.cn/kubernetes/charts aliyuncs https://apphub.aliyuncs.com
拉取peometheus 仓库
helm pull stable/prometheus
执行创建prometheus命令
[root@adm-master ~]# helm install prometheus ./prometheusWARNING: This chart is deprecatedNAME: prometheusLAST DEPLOYED: Thu Mar 25 20:59:00 2021NAMESPACE: monitorSTATUS: deployedREVISION: 1TEST SUITE: NoneNOTES:DEPRECATED and moved to <https://github.com/prometheus-community/helm-charts>The Prometheus server can be accessed via port 80 on the following DNS name from within your cluster:prometheus-server.monitor.svc.cluster.localGet the Prometheus server URL by running these commands in the same shell: export POD_NAME=$(kubectl get pods --namespace monitor -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}") kubectl --namespace monitor port-forward $POD_NAME 9090The Prometheus alertmanager can be accessed via port 80 on the following DNS name from within your cluster:prometheus-alertmanager.monitor.svc.cluster.localGet the Alertmanager URL by running these commands in the same shell: export POD_NAME=$(kubectl get pods -l "app=prometheus,component=alertmanager" -o jsonpath="{.items[0].metadata.name}") kubectl port-forward $POD_NAME 9093####################################################################################### WARNING: Pod Security Policy has been moved to a global property. ########### use .Values.podSecurityPolicy.enabled with pod-based ########### annotations ########### (e.g. .Values.nodeExporter.podSecurityPolicy.annotations) ######################################################################################The Prometheus PushGateway can be accessed via port 9091 on the following DNS name from within your cluster:prometheus-pushgateway.monitor.svc.cluster.localGet the PushGateway URL by running these commands in the same shell: export POD_NAME=$(kubectl get pods --namespace monitor -l "app=prometheus,component=pushgateway" -o jsonpath="{.items[0].metadata.name}") kubectl --namespace monitor port-forward $POD_NAME 9091For more information on running Prometheus, visit:https://prometheus.io/
拉取grafana
helm pull stable/grafana
[root@adm-master ~]# helm install grafana ./grafanaWARNING: This chart is deprecatedNAME: grafanaLAST DEPLOYED: Thu Mar 25 22:15:09 2021NAMESPACE: defaultSTATUS: deployedREVISION: 1NOTES:***********************DEPRECATED************************* The chart is deprecated. Future development has been moved to https://github.com/grafana/helm2-grafana1. Get your 'admin' user password by running: kubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo2. The Grafana server can be accessed via port 80 on the following DNS name from within your cluster: grafana.default.svc.cluster.local Get the Grafana URL to visit by running these commands in the same shell: export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}") kubectl --namespace default port-forward $POD_NAME 30003. Login with the password from step 1 and the username: admin####################################################################################### WARNING: Persistence is disabled!!! You will lose your data when ########### the Grafana pod is terminated. ######################################################################################[root@adm-master ~]# kubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echoG7ylRPHYL4aMGUxWv9YMPShZ6st9TCn1WLbmQlfi
还可以尝试导入模板
Dashboards–Manage–import
输入8919,点击load
©著作权归作者所有:来自51CTO博客作者木子每旒的原创作品,如需转载,请注明出处,否则将追究法律责任更多相关文章
- 使用dnf管理软件包
- 干货 | 万字详解整个数据仓库设计体系
- yum仓库与sed一般应用
- 使用docker Registry快速搭建私有镜像仓库(内附干货)
- K8S中部署mysql-ha高可用集群
- HULK容器镜像仓库简介
- K8S中部署KAFKA集群
- 微软被指剽窃他人开源作品!作者被迫终止该项目
- 利用 Harbor 搭建企业级私有镜像仓库