Skip to content
Snippets Groups Projects
Verified Commit 6e5a3c48 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

drop(loki): Currently loki makes mainly problems

I currently don't really use loki while it causes some trouble due to S3
problems. Therefore this patch drops loki again.
parent c7d5a035
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,6 @@ resources: ...@@ -11,7 +11,6 @@ resources:
- nginx-system - nginx-system
- longhorn - longhorn
- monitoring - monitoring
- loki
- flux-system - flux-system
- k8up - k8up
- postgres - postgres
......
Loki
===
Keeping all logs centralised.
Links
---
- [Docs](https://grafana.com/docs/loki/latest/)
- [Helm Chart](https://artifacthub.io/packages/helm/grafana/loki-stack)
- [Source Code](https://github.com/grafana/loki)
This diff is collapsed.
This diff is collapsed.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: loki-system
resources:
- namespace.yaml
- repository.yaml
- loki.yaml
- promtail.yaml
- ../../shared/networkpolicies/allow-from-monitoring.yaml
- ../../shared/networkpolicies/allow-from-same-namespace.yaml
patchesStrategicMerge:
- networkpolicy.yaml
configMapGenerator:
- name: loki-system-grafana-dashboards
files:
- ./dashboards/loki-logs-quick.json
- ./dashboards/troubleshoot-namespace.json
options:
labels:
grafana_dashboard: loki-system
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: loki
namespace: loki-system
spec:
releaseName: loki
chart:
spec:
chart: loki
sourceRef:
kind: HelmRepository
name: grafana
namespace: loki-system
version: 3.10.0
interval: 5m
upgrade:
remediation:
retries: -1
crds: CreateReplace
install:
remediation:
retries: -1
crds: CreateReplace
valuesFrom:
- kind: ConfigMap
name: loki-base-values
valuesKey: values.yaml
- kind: Secret
name: loki-override-values
valuesKey: values-overrides.yaml
optional: true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: loki-base-values
namespace: loki-system
data:
values.yaml: |
loki:
auth_enabled: false
commonConfig:
replication_factor: 1
storage:
type: s3
s3:
endpoint: loki-minio.loki-system.svc.cluster.local:9000
insecure: true
accessKeyId: loki
secretAccessKey: supersecret
s3ForcePathStyle: true
compactor:
shared_store: s3
compaction_interval: 10m
retention_enabled: true
retention_delete_delay: 2h
retention_delete_worker_count: 150
limits_config:
retention_period: 14d
read:
replicas: 2
write:
replicas: 2
ruler:
enabled: false
monitoring:
enabled: true
selfMonitoring:
grafanaAgent:
installOperator: false
networkPolicy:
enabled: false
minio:
enabled: true
mode: standalone
rootUser: loki
rootPassword: supersecret
persistence:
size: 50Gi
networkPolicy:
enabled: true
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-from-grafana
spec:
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
monitoring.shivering-isles.com/network-access-required: "true"
podSelector:
matchLabels:
app.kubernetes.io/name: grafana
podSelector:
matchLabels:
app.kubernetes.io/component: gateway
app.kubernetes.io/instance: loki
app.kubernetes.io/name: loki
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-ingress-to-loki
spec:
ingress:
- from:
- namespaceSelector:
matchLabels:
ingress.shivering-isles.com/network-access-required: "true"
ports:
- port: http
protocol: TCP
podSelector:
matchExpressions:
- key: app.kubernetes.io/component
operator: In
values:
- gateway
matchLabels:
app.kubernetes.io/instance: loki
app.kubernetes.io/name: loki
policyTypes:
- Ingress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-loki-metrics
namespace: loki-system
spec:
ingress:
- ports:
- port: http-metrics
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/instance: loki
app.kubernetes.io/name: loki
policyTypes:
- Ingress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-loki-minio
namespace: loki-system
spec:
ingress:
- ports:
- port: 9000
protocol: TCP
podSelector:
matchLabels:
release: loki
policyTypes:
- Ingress
---
apiVersion: v1
kind: ConfigMap
metadata:
name: datasource-loki
namespace: loki-system
labels:
grafana_datasource: "1"
data:
loki-stack-datasource.yaml: |-
apiVersion: 1
datasources:
- name: Loki
type: loki
access: proxy
uid: loki-system
url: http://loki-gateway.loki-system.svc.cluster.local
version: 1
isDefault: false
apiVersion: v1
kind: Namespace
metadata:
name: loki-system
labels:
kyverno.shivering-isles.com/class: "system"
pod-security.kubernetes.io/enforce: privileged
pod-security.kubernetes.io/audit: privileged
pod-security.kubernetes.io/warn: privileged
pod-security.kubernetes.io/audit-version: v1.23
pod-security.kubernetes.io/enforce-version: v1.23
pod-security.kubernetes.io/warn-version: v1.23
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-from-monitoring
spec:
podSelector:
matchLabels:
app.kubernetes.io/instance: loki
app.kubernetes.io/name: loki
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: promtail
namespace: loki-system
spec:
releaseName: promtail
chart:
spec:
chart: promtail
sourceRef:
kind: HelmRepository
name: grafana
namespace: loki-system
version: 6.8.2
interval: 5m
upgrade:
remediation:
retries: -1
crds: CreateReplace
install:
remediation:
retries: -1
crds: CreateReplace
valuesFrom:
- kind: ConfigMap
name: promtail-base-values
valuesKey: values.yaml
- kind: Secret
name: promtail-override-values
valuesKey: values-overrides.yaml
optional: true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: promtail-base-values
namespace: loki-system
data:
values.yaml: |
serviceMonitor:
enabled: true
networkPolicy:
enabled: false
# Required for journald collection
containerSecurityContext:
privileged: true
capabilities: null
allowPrivilegeEscalation: true
config:
snippets:
extraScrapeConfigs: |
# Add an additional scrape config for journald
- job_name: journal
journal:
path: /var/log/journal
max_age: 12h
labels:
job: systemd-journal
relabel_configs:
- source_labels:
- __journal__hostname
target_label: hostname
# example label values: kubelet.service, containerd.service
- source_labels:
- __journal__systemd_unit
target_label: unit
# example label values: debug, notice, info, warning, error
- source_labels:
- __journal_priority_keyword
target_label: level
# Mount journal directory and machine-id file into promtail pods
extraVolumes:
- name: journal
hostPath:
path: /var/log/journal
- name: machine-id
hostPath:
path: /etc/machine-id
extraVolumeMounts:
- name: journal
mountPath: /var/log/journal
readOnly: true
- name: machine-id
mountPath: /etc/machine-id
readOnly: true
---
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-from-monitoring-promtail
spec:
ingress:
- ports:
- port: http-metrics
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/instance: promtail
app.kubernetes.io/name: promtail
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
name: grafana
namespace: loki-system
spec:
interval: 30m
url: https://grafana.github.io/helm-charts
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment