These scripts deploy a Prometheus Operator installation (Prometheus, Alertmanager, Grafana) that's pre-configured for Codefresh runtime clusters. It includes alerts and dashboards for monitoring the runtime cluster, as well as configures exporters and cron jobs. What's included:
- Prometheus Operator
- cluster-autoscaler-exporter
dind-volume-cleanup,dind-monitor,dind-exporterandevent-exporter(custom parts with source code not provided)
We create a monitoring namespace and put all the things there.
- kubectl
- helm
- helmfile
If you want Slack or VictorOps notifications write a file: values.yaml.
It may specify:
slack_hook: URL to Slack hookslack_warnings: channel name for warnings, full name like#ops-warningsslack_errors: channel name for errors, full name like#ops-errorsvictorops_api_key: API key to VictorOpsvictorops_routing: VictorOps routing policy nameaffinity: string to set up monitoring affinity/tolerations (see template for more details)prom_ram: Prometheus memory requests and limits, defaults to6Gifor a 8GB instance
use14Giif using a 16GB instance; use24Giif using a 32GB instanceprom_cpu: Prometheus CPU requests (defaults to1, you may want to increase it)
Prometheus CPU limits are twice this valuecoredns: trueset this if using CoreDNS, not Kube-DNS
Please note that if you set slack_hook, you're reqiuired to set both slack_warnings and slack_errors.
If you set victorops_api_key, victorops_routing is also required.
- switch your k8s context to needed
helmfile [-e local] syncto install or update your installationhelmfile destroyto remove the deployment
use -e local if you have values.yaml, if you don't, just omit this part.
kubectl -n monitoring port-forward svc/cprom-prometheus-operator-prometheus 9090
kubectl -n monitoring port-forward svc/cprom-prometheus-operator-alertmanager 9093
kubectl -n monitoring port-forward svc/cprom-grafana 3000:80