Skip to content

Commit

Permalink
fix: update prometheus monitoring on MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
samwang0723 committed Jun 1, 2024
1 parent eb53f08 commit ae15011
Show file tree
Hide file tree
Showing 5 changed files with 4,775 additions and 18 deletions.
6 changes: 4 additions & 2 deletions deployment/helm/grafana/gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: grafana-gateway
namespace: monitoring
spec:
selector:
istio: ingressgateway
Expand All @@ -17,14 +18,15 @@ apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: grafana-virtualservice
namespace: monitoring
spec:
hosts:
- "*"
gateways:
- grafana-gateway
- grafana-gateway.monitoring.svc.cluster.local
http:
- route:
- destination:
host: grafana.default.svc.cluster.local
host: prometheus-grafana.monitoring.svc.cluster.local
port:
number: 80
3 changes: 3 additions & 0 deletions deployment/helm/istio/istio-ingressgateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ spec:
- name: grafana
port: 3005
targetPort: 3005
- name: prometheus
port: 3006
targetPort: 3006
27 changes: 11 additions & 16 deletions deployment/helm/mysql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -317,18 +317,12 @@ primary:
## @param primary.resources.requests The requested resources for MySQL primary containers
##
resources:
## Example:
## limits:
## cpu: 250m
## memory: 256Mi
##
limits: {}
## Examples:
## requests:
## cpu: 250m
## memory: 256Mi
##
requests: {}
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 250m
memory: 256Mi
## Configure extra options for liveness probe
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes
## @param primary.livenessProbe.enabled Enable livenessProbe
Expand Down Expand Up @@ -1036,7 +1030,7 @@ volumePermissions:
metrics:
## @param metrics.enabled Start a side-car prometheus exporter
##
enabled: false
enabled: true
## @param metrics.image.registry Exporter image registry
## @param metrics.image.repository Exporter image repository
## @param metrics.image.tag Exporter image tag (immutable tags are recommended)
Expand All @@ -1047,7 +1041,7 @@ metrics:
image:
registry: docker.io
repository: bitnami/mysqld-exporter
tag: 0.14.0-debian-11-r116
tag: latest
digest: ""
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
Expand Down Expand Up @@ -1185,7 +1179,7 @@ metrics:
serviceMonitor:
## @param metrics.serviceMonitor.enabled Create ServiceMonitor Resource for scraping metrics using PrometheusOperator
##
enabled: false
enabled: true
## @param metrics.serviceMonitor.namespace Specify the namespace in which the serviceMonitor resource will be created
##
namespace: ""
Expand Down Expand Up @@ -1221,7 +1215,8 @@ metrics:
## @param metrics.serviceMonitor.labels Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
##
labels: {}
labels:
release: prometheus
## @param metrics.serviceMonitor.annotations ServiceMonitor annotations
##
annotations: {}
Expand Down
32 changes: 32 additions & 0 deletions deployment/helm/prometheus/gateway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: prometheus-gateway
namespace: monitoring
spec:
selector:
istio: ingressgateway
servers:
- port:
name: http
number: 3006
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: prometheus-virtualservice
namespace: monitoring
spec:
hosts:
- "*"
gateways:
- prometheus-gateway.monitoring.svc.cluster.local
http:
- route:
- destination:
host: prometheus-kube-prometheus-prometheus.monitoring.svc.cluster.local
port:
number: 9090
Loading

0 comments on commit ae15011

Please sign in to comment.