From 351e3dafb28f5d6f3b69690924b7ab835ab52317 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Thu, 24 Apr 2025 17:00:19 +0200 Subject: [PATCH] Added promtail --- infra/loki/kustomization.yaml | 1 + infra/loki/promtail.yaml | 18 ++++++++++++++++++ infra/loki/promtail/helm-release.yaml | 18 ++++++++++++++++++ infra/loki/promtail/kustomization.yaml | 13 +++++++++++++ infra/loki/promtail/values.yaml | 14 ++++++++++++++ 5 files changed, 64 insertions(+) create mode 100644 infra/loki/promtail.yaml create mode 100644 infra/loki/promtail/helm-release.yaml create mode 100644 infra/loki/promtail/kustomization.yaml create mode 100644 infra/loki/promtail/values.yaml diff --git a/infra/loki/kustomization.yaml b/infra/loki/kustomization.yaml index 1861eeb..8dfb9d3 100644 --- a/infra/loki/kustomization.yaml +++ b/infra/loki/kustomization.yaml @@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ./loki.yaml + - ./promtail.yaml diff --git a/infra/loki/promtail.yaml b/infra/loki/promtail.yaml new file mode 100644 index 0000000..83fe069 --- /dev/null +++ b/infra/loki/promtail.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: promtail + namespace: flux-system + labels: + alert: flux-infra +spec: + interval: 15m + path: ./infra/loki/promtail + dependsOn: + - name: loki + prune: true + timeout: 2m + sourceRef: + kind: GitRepository + name: flux-system + wait: true diff --git a/infra/loki/promtail/helm-release.yaml b/infra/loki/promtail/helm-release.yaml new file mode 100644 index 0000000..e38344c --- /dev/null +++ b/infra/loki/promtail/helm-release.yaml @@ -0,0 +1,18 @@ +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: promtail +spec: + chart: + spec: + chart: promtail + reconcileStrategy: ChartVersion + sourceRef: + kind: HelmRepository + name: grafana + version: 6.16.6 + interval: 15m + timeout: 5m + valuesFrom: + - kind: ConfigMap + name: promtail-values diff --git a/infra/loki/promtail/kustomization.yaml b/infra/loki/promtail/kustomization.yaml new file mode 100644 index 0000000..f2cecb0 --- /dev/null +++ b/infra/loki/promtail/kustomization.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: loki +resources: + - ./helm-release.yaml + +configurations: + - ../../../common/name-reference/helm-release.yaml + +configMapGenerator: + - name: promtail-values + files: + - ./values.yaml diff --git a/infra/loki/promtail/values.yaml b/infra/loki/promtail/values.yaml new file mode 100644 index 0000000..9aa7293 --- /dev/null +++ b/infra/loki/promtail/values.yaml @@ -0,0 +1,14 @@ +initContainer: + # -- Specifies whether the init container for setting inotify max user instances is to be enabled + - name: init + # -- Docker registry, image and tag for the init container image + image: docker.io/busybox:1.33 + # -- Docker image pull policy for the init container image + imagePullPolicy: IfNotPresent + # -- The inotify max user instances to configure + command: + - sh + - -c + - sysctl -w fs.inotify.max_user_instances=512 + securityContext: + privileged: true