在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):kayrus/prometheus-kubernetes开源软件地址(OpenSource Url):https://github.com/kayrus/prometheus-kubernetes开源编程语言(OpenSource Language):Shell 100.0%开源软件介绍(OpenSource Introduction):See also Elasticsearch+Kibana Kubernetes complete example PrerequisitesKubectl
NamespaceThis example uses Upload etcd TLS keypairIn case when you use TLS keypair and TLS auth for your etcd cluster, please put corresponding TLS keypair into the kubectl --namespace=monitoring create secret generic --from-file=ca.pem=/path/to/ca.pem --from-file=client.pem=/path/to/client.pem --from-file=client-key.pem=/path/to/client-key.pem etcd-tls-client-certs otherwise create a dummy secret: kubectl --namespace=monitoring create secret generic --from-literal=ca.pem=123 --from-literal=client.pem=123 --from-literal=client-key.pem=123 etcd-tls-client-certs Upload Ingress controller server TLS keypairsIn order to provide secure endpoint available trough the Internet you have to set kubectl create --namespace=monitoring secret tls example-tls --cert=cert.crt --key=key.key Detailed information is available here. Ingress manifest example. Create Ingress basic auth entryWith the Set proper external URLs to have correct links in notificationsRun AssumptionsDisk mount pointsThis repo assumes that your Kubernetes worker nodes contain two observable mount points:
If you wish to change these values, you have to modify Data storageThis repo uses Grafana dashboardsInitial Grafana dashboards were taken from this repo and adjusted. Ingress controllerExample of an ingress controller to get an access from outside: apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/auth-realm: Authentication Required
ingress.kubernetes.io/auth-secret: internal-services-auth
ingress.kubernetes.io/auth-type: basic
kubernetes.io/ingress.allow-http: "false"
name: ingress-monitoring
namespace: monitoring
spec:
tls:
- hosts:
- prometheus.example.com
- grafana.example.com
secretName: example-tls
rules:
- host: prometheus.example.com
http:
paths:
- path: /
backend:
serviceName: prometheus-svc
servicePort: 9090
- path: /alertmanager
backend:
serviceName: alertmanager
servicePort: 9093
- host: grafana.example.com
http:
paths:
- path: /
backend:
serviceName: grafana
servicePort: 3000 If you still don't have an Ingress controller installed, you can use manifests from the AlertingIncluded alert rulesPrometheus alert rules which are already included in this repo:
Notifications
Updating configurationPrometheus configurationUpdate command line parametersModify kubectl --namespace=monitoring apply -f prometheus-deployment.yaml If deployment manifest was changed, all Prometheus pods will be restarted with data loss. Update configfileUpdate ./update_prometheus_config.sh
# or
./update_prometheus_rules.sh These scripts will update configmaps, wait until changes will be delivered into the pod volume (if the configmap was not changed, this script will work forever) and reload the configs. You can also reload configs manually using the commands below: curl -XPOST --user "%username%:%password%" https://prometheus.example.com/-/reload
# or
kubectl --namespace=monitoring exec $(kubectl --namespace=monitoring get pods -l app=prometheus -o jsonpath={.items..metadata.name}) -- killall -HUP prometheus Alertmanager configurationUpdate command line parametersModify kubectl --namespace=monitoring apply -f alertmanager-deployment.yaml If deployment manifest was changed, all Alertmanager pods will be restarted with data loss. Update configfileUpdate ./update_alertmanager_config.sh
# or
./update_alertmanager_templates.sh These scripts will update configmaps, wait until changes will be delivered into the pod volume (if the configmap was not changed, this script will work forever) and reload the configs. You can also reload configs manually using the commands below: curl -XPOST --user "%username%:%password%" https://prometheus.example.com/alertmanager/-/reload
# or
kubectl --namespace=monitoring exec $(kubectl --namespace=monitoring get pods -l app=alertmanager -o jsonpath={.items..metadata.name}) -- killall -HUP alertmanager Pictures |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论