Grafana | Prometheus | Loki | ArgoCD
Grafana | Prometheus | Alertmanager
- Installing via official Helm charts method:
kube-prometheus-stack
YAML
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
finalizers:
- resources-finalizer.argocd.argoproj.io
name: kube-prometheus-stack
namespace: argocd
spec:
destination:
namespace: monitoring
server: https://kubernetes.default.svc
project: default
source:
chart: kube-prometheus-stack
helm:
values: |-
prometheus-node-exporter:
hostRootFsMount:
enabled: false
prometheusOperator:
admissionWebhooks:
failurePolicy: Ignore
repoURL: https://prometheus-community.github.io/helm-charts
targetRevision: 46.6.0
syncPolicy:
syncOptions:
- ServerSideApply=true
- CreateNamespace=true
# https://blog.ediri.io/kube-prometheus-stack-and-argocd-25-server-side-apply-to-the-rescue
loki-stack (Persistance logs using s3 bucket AWS)
Create secret:
Bash
kubectl create secret generic s3-secret --from-literal=AWS_ACCESS_KEY_ID='AKIXXXXXXXXXXXXXUBD' --from-literal=AWS_SECRET_ACCESS_KEY='65N9Z8XXXXXXXXXX8ayzaWxRy4jkGJA6E' -n monitoring
YAML
project: default
source:
repoURL: 'https://grafana.github.io/helm-charts'
targetRevision: 2.8.2
helm:
values: |-
loki:
env:
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: s3-secret
key: AWS_ACCESS_KEY_ID
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: s3-secret
key: AWS_SECRET_ACCESS_KEY
config:
schema_config:
configs:
- from: 2023-06-13
store: boltdb-shipper
object_store: s3
schema: v11
index:
prefix: loki_index_
period: 24h
storage_config:
aws:
s3: s3://eu-west-1/logs.bucketname.com
s3forcepathstyle: true
bucketnames: logs.bucketname.com
region: eu-west-1
insecure: false
sse_encryption: false
boltdb_shipper:
shared_store: s3
cache_ttl: 24h
chart: loki-stack
destination:
server: 'https://kubernetes.default.svc'
namespace: monitoring
syncPolicy:
syncOptions:
- ServerSideApply=true
- CreateNamespace=true
Grafana Dashboards for Loki Kubernetes logs:
Dashboard ID
Dashboard ID