cleanup monitoring
This commit is contained in:
parent
68e250b918
commit
318e766cab
|
@ -2,6 +2,8 @@ apiVersion: apps/v1
|
|||
kind: Deployment
|
||||
metadata:
|
||||
name: grafana
|
||||
labels:
|
||||
app: grafana
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
|
@ -22,7 +24,7 @@ spec:
|
|||
- name: GF_DATABASE_TYPE
|
||||
value: mysql
|
||||
- name: GF_DATABASE_HOST
|
||||
value: mariadb.monitoring.svc:3306
|
||||
value: mariadb.grafana.svc:3306
|
||||
- name: GF_DATABASE_NAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
|
@ -53,6 +55,9 @@ apiVersion: v1
|
|||
kind: Service
|
||||
metadata:
|
||||
name: grafana
|
||||
labels:
|
||||
app: grafana
|
||||
monitor: main
|
||||
spec:
|
||||
selector:
|
||||
app: grafana
|
||||
|
@ -66,6 +71,8 @@ apiVersion: networking.k8s.io/v1beta1
|
|||
kind: Ingress
|
||||
metadata:
|
||||
name: grafana
|
||||
labels:
|
||||
app: grafana
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /
|
||||
cert-manager.io/cluster-issuer: letsencrypt
|
|
@ -1,9 +1,9 @@
|
|||
bases:
|
||||
- ../../mariadb
|
||||
- ../mariadb
|
||||
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- grafana-deployment.yaml
|
||||
- grafana-servicemonitor.yaml
|
||||
|
||||
configMapGenerator:
|
||||
- name: grafana-datasources
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: grafana
|
|
@ -1,14 +0,0 @@
|
|||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: grafana
|
||||
labels:
|
||||
monitor: main
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
managed-by: kustomize
|
||||
app: grafana
|
||||
endpoints:
|
||||
- port: http
|
||||
path: /metrics
|
|
@ -2,7 +2,6 @@ bases:
|
|||
- kube-state-metrics
|
||||
- node-exporter
|
||||
- prometheus
|
||||
- grafana
|
||||
- prometheus-operator
|
||||
|
||||
resources:
|
||||
|
|
|
@ -1,6 +1,2 @@
|
|||
resources:
|
||||
- node-exporter-daemonset.yaml
|
||||
- node-exporter-servicemonitor.yaml
|
||||
|
||||
commonLabels:
|
||||
app: node-exporter
|
|
@ -3,6 +3,8 @@ kind: DaemonSet
|
|||
metadata:
|
||||
name: node-exporter
|
||||
namespace: kube-monitoring
|
||||
labels:
|
||||
app: node-exporter
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
|
@ -53,6 +55,9 @@ apiVersion: v1
|
|||
kind: Service
|
||||
metadata:
|
||||
name: nodes-exporter
|
||||
labels:
|
||||
app: node-exporter
|
||||
monitor: main
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: node-exporter
|
||||
labels:
|
||||
monitor: main
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
managed-by: kustomize
|
||||
app: node-exporter
|
||||
endpoints:
|
||||
- port: http-metrics
|
||||
path: /metrics
|
|
@ -3,15 +3,5 @@ kind: RemoteResources
|
|||
metadata:
|
||||
name: prometheus-operator
|
||||
resources:
|
||||
- url: https://raw.githubusercontent.com/coreos/prometheus-operator/master/example/rbac/prometheus-operator/prometheus-operator-cluster-role-binding.yaml
|
||||
sha256: 22c1f67d0417fc743660d3e55b2d2c19b767f62dfb5326bda97b5bbfba875b6f
|
||||
- url: https://raw.githubusercontent.com/coreos/prometheus-operator/master/example/rbac/prometheus-operator/prometheus-operator-cluster-role.yaml
|
||||
sha256: 6475a9fe2a044a3653d9047c9e57598afd6deefb72bbe6521e3a101f2148cada
|
||||
- url: https://raw.githubusercontent.com/coreos/prometheus-operator/master/example/rbac/prometheus-operator/prometheus-operator-deployment.yaml
|
||||
sha256: ceb21dc7274285143301ca9ab7ef4dec07c3d83a8b15113b5ccdbd73ecaad49a
|
||||
- url: https://raw.githubusercontent.com/coreos/prometheus-operator/master/example/rbac/prometheus-operator/prometheus-operator-service-account.yaml
|
||||
sha256: f9cb00698e38c3db99a3b750b4a27ba2bb07e6574ceaa13eb5aa976bb72ca5f6
|
||||
- url: https://raw.githubusercontent.com/coreos/prometheus-operator/master/example/rbac/prometheus-operator/prometheus-operator-service-monitor.yaml
|
||||
sha256: 26ceeabca8dd0c6069e1ad918e8b02df67b3667864c4cf985c48a3b07692c6ae
|
||||
- url: https://raw.githubusercontent.com/coreos/prometheus-operator/master/example/rbac/prometheus-operator/prometheus-operator-service.yaml
|
||||
sha256: f600f2aa9b4b2090d1ab52018d7cf74853e40edfd71532db4f2e9323cf6f3505
|
||||
- url: https://raw.githubusercontent.com/coreos/prometheus-operator/master/bundle.yaml
|
||||
sha256: 557721b7638055102c150f68a924b6c4d0b36439a0fb87cb0cddbaf89e1c2c57
|
|
@ -1,7 +1,7 @@
|
|||
resources:
|
||||
- prometheus-crd.yaml
|
||||
- prometheus.yaml
|
||||
- prometheus-rbac.yaml
|
||||
- prometheus-servicemonitor.yaml
|
||||
- servicemonitors.yaml
|
||||
|
||||
commonLabels:
|
||||
app: prometheus
|
|
@ -3,31 +3,15 @@ kind: Prometheus
|
|||
metadata:
|
||||
name: main
|
||||
spec:
|
||||
podMetadata:
|
||||
labels:
|
||||
managed-by: kustomize
|
||||
serviceAccountName: prometheus
|
||||
serviceMonitorSelector:
|
||||
matchLabels:
|
||||
monitor: main
|
||||
resources:
|
||||
requests:
|
||||
memory: 400Mi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: prometheus-main
|
||||
labels:
|
||||
prometheus: main
|
||||
spec:
|
||||
selector:
|
||||
prometheus: main
|
||||
ports:
|
||||
- name: web
|
||||
protocol: TCP
|
||||
port: 9090
|
||||
targetPort: web
|
||||
memory: 300Mi
|
||||
limits:
|
||||
memory: 500Mi
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
kind: Ingress
|
||||
|
@ -47,5 +31,5 @@ spec:
|
|||
paths:
|
||||
- path: /
|
||||
backend:
|
||||
serviceName: prometheus-main
|
||||
serviceName: prometheus-operated
|
||||
servicePort: web
|
|
@ -3,20 +3,33 @@ kind: ServiceMonitor
|
|||
metadata:
|
||||
name: prometheus
|
||||
labels:
|
||||
app: prometheus
|
||||
monitor: main
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
managed-by: kustomize
|
||||
app: prometheus
|
||||
prometheus: main
|
||||
operated-prometheus: "true"
|
||||
endpoints:
|
||||
- port: web
|
||||
path: /metrics
|
||||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: servicemonitor-http
|
||||
labels:
|
||||
monitor: main
|
||||
spec:
|
||||
namespaceSelector:
|
||||
any: true
|
||||
selector:
|
||||
matchLabels:
|
||||
monitor: main
|
||||
endpoints:
|
||||
- port: http
|
||||
path: /metrics
|
||||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: kubelet
|
||||
labels:
|
|
@ -2,6 +2,7 @@ bases:
|
|||
- ../../base/kubernetes-dashboard
|
||||
- ../../base/gitea
|
||||
- ../../base/nextcloud
|
||||
- ../../base/grafana
|
||||
- ../../base/monitoring
|
||||
|
||||
resources:
|
||||
|
@ -35,16 +36,6 @@ patchesJson6902:
|
|||
- op: replace
|
||||
path: /spec/rules/0/host
|
||||
value: kubernetes-dashboard.staging.badjware.dev
|
||||
- target:
|
||||
<<: *ingress_target
|
||||
name: prometheus
|
||||
patch: |-
|
||||
- op: replace
|
||||
path: /spec/tls/0/hosts/0
|
||||
value: prometheus.staging.badjware.dev
|
||||
- op: replace
|
||||
path: /spec/rules/0/host
|
||||
value: prometheus.staging.badjware.dev
|
||||
- target:
|
||||
<<: *ingress_target
|
||||
name: grafana
|
||||
|
|
Loading…
Reference in New Issue