diff --git a/README.md b/README.md index b7b590b18032b66c5d49b9ad9d8a387bfab01251..f0d8b12f4f4ad7fea01d3327d3d5640a4ef3bdf4 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,6 @@ To tear it all down again, run: hack/cluster-monitoring/teardown ``` -> All services in the manifest still contain the `prometheus.io/scrape = true` -> annotations. It is not used by the Prometheus Operator. They remain for -> pre Prometheus v1.3.0 deployments as in [this example configuration](https://github.com/prometheus/prometheus/blob/6703404cb431f57ca4c5097bc2762438d3c1968e/documentation/examples/prometheus-kubernetes.yml). - ## Monitoring custom services The example manifests in [/manifests/examples/example-app](/manifests/examples/example-app) diff --git a/assets/prometheus/prometheus.yaml b/assets/prometheus/prometheus.yaml index ea10a6081d9693a0b39b97dc6b985ef0e26ef583..d48d56483973dc1eef38f90abc80a7848f33bff7 100644 --- a/assets/prometheus/prometheus.yaml +++ b/assets/prometheus/prometheus.yaml @@ -65,4 +65,4 @@ scrape_configs: regex: "kube-(.*)-prometheus-discovery" - action: keep source_labels: [__meta_kubernetes_endpoint_port_name] - regex: "prometheus" + regex: "prometheus.*" diff --git a/manifests/alertmanager/alertmanager-config.yaml b/manifests/alertmanager/alertmanager-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8f7fce5b2ffddfca2262f5b90c76aa69a004bc98 --- /dev/null +++ b/manifests/alertmanager/alertmanager-config.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: alertmanager-main +data: + alertmanager.yaml: |- + global: + resolve_timeout: 5m + route: + group_by: ['job'] + group_wait: 30s + group_interval: 5m + repeat_interval: 12h + receiver: 'webhook' + receivers: + - name: 'webhook' + webhook_configs: + - url: 'http://alertmanagerwh:30500/' diff --git a/manifests/alertmanager/alertmanager-service.yaml b/manifests/alertmanager/alertmanager-service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..86599c3544bda5a2cb6732786a81e8930e6477ed --- /dev/null +++ b/manifests/alertmanager/alertmanager-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: alertmanager-main +spec: + type: NodePort + ports: + - name: web + nodePort: 30903 + port: 9093 + protocol: TCP + targetPort: web + selector: + alertmanager: alertmanager-main diff --git a/manifests/alertmanager/alertmanager.yaml b/manifests/alertmanager/alertmanager.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ce67f3bb30870f0b220547edf5827bae96eaad22 --- /dev/null +++ b/manifests/alertmanager/alertmanager.yaml @@ -0,0 +1,9 @@ +apiVersion: "monitoring.coreos.com/v1alpha1" +kind: "Alertmanager" +metadata: + name: "alertmanager-main" + labels: + alertmanager: "main" +spec: + replicas: 3 + version: v0.5.1 diff --git a/manifests/etcd/etcd-bootkube-gce.yaml b/manifests/etcd/etcd-bootkube-gce.yaml index 542f5fe7edacb191592268c55f3f26d13e5220a1..ee8f391ce19ed3568fbd004326a522cc95f95255 100644 --- a/manifests/etcd/etcd-bootkube-gce.yaml +++ b/manifests/etcd/etcd-bootkube-gce.yaml @@ -5,8 +5,6 @@ metadata: labels: app: etcd etcd: k8s - annotations: - prometheus.io/scrape: 'true' spec: type: ClusterIP clusterIP: None @@ -29,4 +27,4 @@ subsets: ports: - name: api port: 2379 - protocol: TCP \ No newline at end of file + protocol: TCP diff --git a/manifests/etcd/etcd-bootkube-vagrant-multi.yaml b/manifests/etcd/etcd-bootkube-vagrant-multi.yaml index 9f956922b2d2a0d1ddbbfe21e7699d4b63fb03c0..38cdc9c40f9db356121d28a20f7e25886f4cfc44 100644 --- a/manifests/etcd/etcd-bootkube-vagrant-multi.yaml +++ b/manifests/etcd/etcd-bootkube-vagrant-multi.yaml @@ -5,8 +5,6 @@ metadata: labels: app: etcd etcd: k8s - annotations: - prometheus.io/scrape: 'true' spec: type: ClusterIP clusterIP: None @@ -29,4 +27,4 @@ subsets: ports: - name: api port: 2379 - protocol: TCP \ No newline at end of file + protocol: TCP diff --git a/manifests/examples/example-app/example-app.yaml b/manifests/examples/example-app/example-app.yaml index 59a9b44dad3d75f5fc196e4e6f85abcc67437c10..adb6602b888f42446eb0cfe7760d944b5605417b 100644 --- a/manifests/examples/example-app/example-app.yaml +++ b/manifests/examples/example-app/example-app.yaml @@ -4,8 +4,6 @@ metadata: name: example-app labels: tier: frontend - annotations: - prometheus.io/scrape: 'true' spec: selector: app: example-app diff --git a/manifests/examples/example-app/prometheus-frontend.yaml b/manifests/examples/example-app/prometheus-frontend.yaml index a367ae220130a3003b9ba60299e0e94b3776e31b..80fd9e0474dfab05e95e7ec51b637c91e5b24705 100644 --- a/manifests/examples/example-app/prometheus-frontend.yaml +++ b/manifests/examples/example-app/prometheus-frontend.yaml @@ -6,8 +6,20 @@ metadata: labels: prometheus: frontend spec: - version: v1.3.0 + version: v1.4.1 serviceMonitors: - selector: matchLabels: tier: frontend + resources: + requests: + # 2Gi is default, but won't schedule if you don't have a node with >2Gi + # memory. Modify based on your target and time-series count for + # production use. This value is mainly meant for demonstration/testing + # purposes. + memory: 400Mi + alerting: + alertmanagers: + - namespace: monitoring + name: alertmanager-main + port: web diff --git a/manifests/exporters/kube-state-metrics-svc.yaml b/manifests/exporters/kube-state-metrics-svc.yaml index 3b996b889f573c80b03d072524bd841da040426b..8b68484b072e09d05f15b5b6b7520a0860a69415 100644 --- a/manifests/exporters/kube-state-metrics-svc.yaml +++ b/manifests/exporters/kube-state-metrics-svc.yaml @@ -1,8 +1,6 @@ apiVersion: v1 kind: Service metadata: - annotations: - prometheus.io/scrape: 'true' labels: app: kube-state-metrics name: kube-state-metrics diff --git a/manifests/exporters/node-exporter-ds.yaml b/manifests/exporters/node-exporter-ds.yaml index b2cceee93e619ebbecbd7e8eb2981530bb81889c..0bbfe8ebce5eadd10a382e1f471cdc67ccd5f5f9 100644 --- a/manifests/exporters/node-exporter-ds.yaml +++ b/manifests/exporters/node-exporter-ds.yaml @@ -12,7 +12,7 @@ spec: hostNetwork: true hostPID: true containers: - - image: quay.io/prometheus/node-exporter:0.12.0 + - image: quay.io/prometheus/node-exporter:0.13.0 args: - "-collector.procfs=/host/proc" - "-collector.sysfs=/host/sys" diff --git a/manifests/exporters/node-exporter-svc.yaml b/manifests/exporters/node-exporter-svc.yaml index e9286e2b2fa8327e4fd913b71347c652ac90fb49..f2d24a422375075f7d5ee3f5f6650ceb33f7d7b7 100644 --- a/manifests/exporters/node-exporter-svc.yaml +++ b/manifests/exporters/node-exporter-svc.yaml @@ -3,8 +3,6 @@ kind: Service metadata: labels: app: node-exporter - annotations: - prometheus.io/scrape: 'true' name: node-exporter spec: type: ClusterIP diff --git a/manifests/grafana/grafana-svc.yaml b/manifests/grafana/grafana-svc.yaml index 0fd4e87bbf015f81beca8389d963f2c82753f798..adb26233b195fbf3b3c6ee16640752ea06731920 100644 --- a/manifests/grafana/grafana-svc.yaml +++ b/manifests/grafana/grafana-svc.yaml @@ -4,8 +4,6 @@ metadata: name: grafana labels: app: grafana - annotations: - prometheus.io/scrape: 'true' spec: type: NodePort ports: @@ -14,4 +12,4 @@ spec: protocol: TCP nodePort: 30902 selector: - app: grafana \ No newline at end of file + app: grafana diff --git a/manifests/k8s/kube-controller-manager-bootkube-vagrant-multi.yaml b/manifests/k8s/kube-controller-manager-bootkube-vagrant-multi.yaml index 316076f394802778c2dd3001fd93769b92717f0b..2e6b4db956d030d0fe7459af1bbdb66f160ff2ad 100644 --- a/manifests/k8s/kube-controller-manager-bootkube-vagrant-multi.yaml +++ b/manifests/k8s/kube-controller-manager-bootkube-vagrant-multi.yaml @@ -4,8 +4,6 @@ metadata: name: kube-controller-manager-prometheus-discovery labels: k8s-app: kube-controller-manager - annotations: - prometheus.io/scrape: 'true' spec: selector: k8s-app: kube-controller-manager diff --git a/manifests/k8s/kube-dns-bootkube-vagrant-multi.yaml b/manifests/k8s/kube-dns-bootkube-vagrant-multi.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4ae570f8b689f339a8287468cb5cd014dd1e7bd4 --- /dev/null +++ b/manifests/k8s/kube-dns-bootkube-vagrant-multi.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + name: kube-dns-prometheus-discovery + labels: + k8s-app: kube-dns +spec: + selector: + k8s-app: kube-dns + type: ClusterIP + clusterIP: None + ports: + - name: prometheus-skydns + port: 10055 + targetPort: 10055 + protocol: TCP + - name: prometheus-dnsmasq + port: 10054 + targetPort: 10054 + protocol: TCP diff --git a/manifests/k8s/kube-scheduler-bootkube-vagrant-multi.yaml b/manifests/k8s/kube-scheduler-bootkube-vagrant-multi.yaml index 67360ec248b7e19a8d2908e928df329b3f011e4e..b79853d22f5233b028777e42fa9b808c47fc4939 100644 --- a/manifests/k8s/kube-scheduler-bootkube-vagrant-multi.yaml +++ b/manifests/k8s/kube-scheduler-bootkube-vagrant-multi.yaml @@ -4,8 +4,6 @@ metadata: name: kube-scheduler-prometheus-discovery labels: k8s-app: kube-scheduler - annotations: - prometheus.io/scrape: 'true' spec: selector: k8s-app: kube-scheduler diff --git a/manifests/prometheus/prometheus-k8s-cm.yaml b/manifests/prometheus/prometheus-k8s-cm.yaml index 59c6389be89ecdc02e628aac0134f13e0500d2cf..a8846b92b800d00021634bc5d82fbcd11fac8af3 100644 --- a/manifests/prometheus/prometheus-k8s-cm.yaml +++ b/manifests/prometheus/prometheus-k8s-cm.yaml @@ -68,7 +68,7 @@ data: regex: "kube-(.*)-prometheus-discovery" - action: keep source_labels: [__meta_kubernetes_endpoint_port_name] - regex: "prometheus" + regex: "prometheus.*" kind: ConfigMap metadata: creationTimestamp: null diff --git a/manifests/prometheus/prometheus-k8s.yaml b/manifests/prometheus/prometheus-k8s.yaml index 0d13f1e152797301a29abf252b672c068312176c..602ff146552b255a209a943df30154658a4b1291 100644 --- a/manifests/prometheus/prometheus-k8s.yaml +++ b/manifests/prometheus/prometheus-k8s.yaml @@ -5,4 +5,16 @@ metadata: labels: prometheus: k8s spec: - version: v1.3.0 + version: v1.4.1 + resources: + requests: + # 2Gi is default, but won't schedule if you don't have a node with >2Gi + # memory. Modify based on your target and time-series count for + # production use. This value is mainly meant for demonstration/testing + # purposes. + memory: 400Mi + alerting: + alertmanagers: + - namespace: monitoring + name: alertmanager-main + port: web