monitoring: use victoriametrics stack

This commit is contained in:
Andrey Kartashov 2022-02-18 20:53:30 +07:00
parent 0d38ea3698
commit 46470b5e2e
17 changed files with 59 additions and 302 deletions

View file

@ -48,3 +48,9 @@ data:
- name: itzg
type: helm
url: https://itzg.github.io/minecraft-server-charts/
- name: prometheus-community
type: helm
url: https://prometheus-community.github.io/helm-charts
- name: vm
type: helm
url: https://victoriametrics.github.io/helm-charts/

View file

@ -1,2 +0,0 @@
requirements.lock
charts/

View file

@ -1,3 +0,0 @@
name: grafana
version: 0.1
apiVersion: v2

View file

@ -1,4 +0,0 @@
dependencies:
- name: grafana
version: '6.1.15'
repository: https://grafana.github.io/helm-charts

View file

@ -1,23 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: datasources
labels:
grafana_datasource: "1"
data:
loki-datasource.yaml: |-
apiVersion: 1
datasources:
- name: Loki
type: loki
access: proxy
url: http://loki.logging:3100
version: 1
prometheus-datasource.yaml: |-
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus-operator-prometheus.monitoring:9090/
version: 1

View file

@ -1,11 +0,0 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: grafana
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /data/grafana

View file

@ -1,12 +0,0 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: grafana
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
volumeMode: Filesystem
volumeName: grafana

View file

@ -1,30 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: grafana-kubegraf
rules:
- apiGroups: [""]
resources:
- namespaces
- pods
- services
- componentstatuses
- nodes
- events
verbs: ["get", "list", "watch"]
- apiGroups: ["batch"]
resources:
- jobs
- cronjobs
verbs: ["get", "list", "watch"]
- apiGroups: ["extensions"]
resources:
- deployments
- daemonsets
verbs: ["get", "list", "watch"]
- apiGroups: ["apps"]
resources:
- statefulsets
- deployments
- daemonsets
verbs: ["get", "list", "watch"]

View file

@ -1,15 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: grafana-kubegraf
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: grafana-kubegraf
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: grafana-kubegraf
- kind: ServiceAccount
name: grafana-kubegraf
namespace: grafana

View file

@ -1,7 +0,0 @@
apiVersion: v1
kind: Secret
metadata:
name: grafana-kubegraf-secret
annotations:
kubernetes.io/service-account.name: grafana-kubegraf
type: kubernetes.io/service-account-token

View file

@ -1,6 +0,0 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: grafana-kubegraf
secrets:
- name: grafana-kubegraf-secret

View file

@ -1,73 +0,0 @@
grafana:
nameOverride: grafana
fullnameOverride: grafana
defaultDashboardsEnabled: false
enabled: true
serviceMonitor:
selfMonitor: false
# secret grafana should be created manually
# it should contain:
# admin-user
# admin-password
# GF_AUTH_GITHUB_CLIENT_SECRET
admin:
existingSecret: grafana
envFromSecret: grafana
ingress:
enabled: true
annotations:
cert-manager.io/cluster-issuer: letsencrypt
hosts:
- grafana.gorilych.ru
tls:
- hosts:
- grafana.gorilych.ru
secretName: grafana-tls
persistence:
enabled: true
type: pvc
existingClaim: grafana
resources:
#limits:
# cpu: 100m
# memory: 128Mi
requests:
cpu: 50m
memory: 128Mi
plugins:
# see also https://github.com/devopsprodigy/kubegraf#installation
- devopsprodigy-kubegraf-app
- grafana-piechart-panel
grafana.ini:
server:
root_url: https://grafana.gorilych.ru
auth.github:
enabled: true
allow_sign_up: false
client_id: 6494b9ed39a915d9ac20
# client_secret: in grafana secret
scopes: user:email,read:org
auth_url: https://github.com/login/oauth/authorize
token_url: https://github.com/login/oauth/access_token
api_url: https://api.github.com/user
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: default
folder: ''
type: file
disableDeletion: false
editable: true
allowUiUpdates: false
options:
path: /var/lib/grafana/dashboards/default
dashboards:
default:
nginx-ingress:
gnetId: 9614
revision: 1
datasource: Prometheus
sidecar:
datasources:
enabled: true

View file

@ -1,2 +1,6 @@
name: monitoring
version: 0.1
dependencies:
- name: victoria-metrics-k8s-stack
version: 0.7.3
repository: https://victoriametrics.github.io/helm-charts/

View file

@ -1,4 +0,0 @@
dependencies:
- name: prometheus-operator
version: '8.15.5'
repository: '@stable'

View file

@ -1,61 +1,51 @@
prometheus-operator:
nameOverride: prometheus-operator
fullnameOverride: prometheus-operator
prometheusOperator:
admissionWebhooks:
enabled: false
tlsProxy:
enabled: false
serviceMonitor:
selfMonitor: false
prometheus:
enabled: true
serviceMonitor:
selfMonitor: false
prometheusSpec:
replicas: 1
securityContext:
runAsUser: 1000
walCompression: true
serviceMonitorSelector: {}
serviceMonitorNamespaceSelector: {}
victoria-metrics-k8s-stack:
nameOverride: monitoring
fullnameOverride: monitoring
argocdReleaseOverride: monitoring
vmsingle:
spec:
storage:
volumeClaimTemplate:
spec:
volumeName: prometheus
resources:
requests:
storage: 10Gi
alertmanager:
enabled: false
defaultRules:
create: false
kubelet:
enabled: true
kubeControllerManager:
enabled: false
kubeScheduler:
enabled: false
kubeEtcd:
enabled: false
coreDns:
enabled: false
kubeDns:
enabled: false
kubeApiServer:
enabled: false
kubeProxy:
enabled: false
kubeStateMetrics:
enabled: true
nodeExporter:
enabled: true
storageClassName: local-path
grafana:
enabled: false
# because of https://github.com/helm/helm/issues/4490
kubeStateMetrics:
enabled: true
nodeExporter:
enabled: true
grafana:
enabled: false
# secret grafana should be created manually
# it should contain:
# admin-user
# admin-password
# GF_AUTH_GITHUB_CLIENT_SECRET
admin:
existingSecret: grafana
envFromSecret: grafana
additionalDataSources:
- name: loki
type: loki
access: proxy
url: http://loki.logging:3100
version: 1
ingress:
enabled: true
ingressClassName: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt
hosts:
- grafana.gorilych.ru
tls:
- secretName: grafana-ingress-tls
hosts:
- grafana.gorilych.ru
persistence:
enabled: true
storageClassName: local-path
grafana.ini:
server:
root_url: https://grafana.gorilych.ru
auth.github:
enabled: true
allow_sign_up: false
client_id: 6494b9ed39a915d9ac20
# client_secret: in grafana secret
scopes: user:email,read:org
auth_url: https://github.com/login/oauth/authorize
token_url: https://github.com/login/oauth/access_token
api_url: https://api.github.com/user

File diff suppressed because one or more lines are too long

View file

@ -1,19 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: grafana
namespace: argocd
spec:
destination:
namespace: grafana
server: https://kubernetes.default.svc
project: default
source:
path: apps/system/grafana
repoURL: git@github.com:amkartashov/gf-k8s
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
prune: true
selfHeal: true