From 6d6ad68fa3e123d8508ad422f4144abd5a49196d Mon Sep 17 00:00:00 2001 From: Willian Paixao Date: Tue, 9 Apr 2024 12:46:31 +0200 Subject: [PATCH] feat(helm): install loki --- .../apps/observability/kustomization.yaml | 1 + .../observability/loki/app/helmrelease.yaml | 111 ++++++++++++++++++ .../observability/loki/app/kustomization.yaml | 6 + kubernetes/apps/observability/loki/ks.yaml | 21 ++++ .../flux/repositories/helm/kustomization.yaml | 2 +- .../helm/{openebs.yaml => loki.yaml} | 4 +- 6 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 kubernetes/apps/observability/loki/app/helmrelease.yaml create mode 100644 kubernetes/apps/observability/loki/app/kustomization.yaml create mode 100644 kubernetes/apps/observability/loki/ks.yaml rename kubernetes/flux/repositories/helm/{openebs.yaml => loki.yaml} (68%) diff --git a/kubernetes/apps/observability/kustomization.yaml b/kubernetes/apps/observability/kustomization.yaml index 781bd711e..22664f15c 100644 --- a/kubernetes/apps/observability/kustomization.yaml +++ b/kubernetes/apps/observability/kustomization.yaml @@ -4,4 +4,5 @@ kind: Kustomization resources: - ./namespace.yaml - ./kube-prometheus-stack/ks.yaml + - ./loki/ks.yaml - ./prometheus-blackbox-exporter/ks.yaml diff --git a/kubernetes/apps/observability/loki/app/helmrelease.yaml b/kubernetes/apps/observability/loki/app/helmrelease.yaml new file mode 100644 index 000000000..14599d60f --- /dev/null +++ b/kubernetes/apps/observability/loki/app/helmrelease.yaml @@ -0,0 +1,111 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2beta2.json +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: &app loki + namespace: &namespace observability +spec: + interval: 30m + timeout: 15m + chart: + spec: + chart: loki + version: 6.0.0 + sourceRef: + kind: HelmRepository + name: loki + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + strategy: rollback + retries: 3 + values: + loki: + commonConfig: + replication_factor: 1 + schemaConfig: + configs: + - from: "2020-10-24" + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + storage: + type: 'filesystem' + ingester: + chunk_encoding: snappy + tracing: + enabled: false + querier: + max_concurrent: 2 + + gateway: + ingress: + enabled: true + hosts: + - host: &host loki.${SECRET_DOMAIN} + paths: + - path: / + pathType: Prefix + tls: + - hosts: + - *host + + deploymentMode: SingleBinary + singleBinary: + replicas: 1 + resources: + limits: + cpu: 3 + memory: 4Gi + requests: + cpu: 2 + memory: 2Gi + extraEnv: + - name: GOMEMLIMIT + value: 3750MiB + + memberlist: + service: + publishNotReadyAddresses: true + + chunksCache: + writebackSizeLimit: 10MB + + minio: + enabled: false + + backend: + replicas: 0 + read: + replicas: 0 + write: + replicas: 0 + ingester: + replicas: 0 + querier: + replicas: 0 + queryFrontend: + replicas: 0 + queryScheduler: + replicas: 0 + distributor: + replicas: 0 + compactor: + replicas: 0 + indexGateway: + replicas: 0 + bloomCompactor: + replicas: 0 + chunksCache: + enabled: false + bloomGateway: + replicas: 0 + diff --git a/kubernetes/apps/observability/loki/app/kustomization.yaml b/kubernetes/apps/observability/loki/app/kustomization.yaml new file mode 100644 index 000000000..17cbc72b2 --- /dev/null +++ b/kubernetes/apps/observability/loki/app/kustomization.yaml @@ -0,0 +1,6 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./helmrelease.yaml diff --git a/kubernetes/apps/observability/loki/ks.yaml b/kubernetes/apps/observability/loki/ks.yaml new file mode 100644 index 000000000..8cefe44c9 --- /dev/null +++ b/kubernetes/apps/observability/loki/ks.yaml @@ -0,0 +1,21 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app loki + namespace: flux-system +spec: + targetNamespace: observability + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: ./kubernetes/apps/observability/loki/app + prune: true + sourceRef: + kind: GitRepository + name: home-kubernetes + wait: false + interval: 30m + retryInterval: 1m + timeout: 15m diff --git a/kubernetes/flux/repositories/helm/kustomization.yaml b/kubernetes/flux/repositories/helm/kustomization.yaml index 56649f348..b8e251713 100644 --- a/kubernetes/flux/repositories/helm/kustomization.yaml +++ b/kubernetes/flux/repositories/helm/kustomization.yaml @@ -8,8 +8,8 @@ resources: - ./ingress-nginx.yaml - ./jetstack.yaml - ./k8s-gateway.yaml + - ./loki.yaml - ./longhorn.yaml - ./metrics-server.yaml - - ./openebs.yaml - ./prometheus-community-charts.yaml - ./stakater.yaml diff --git a/kubernetes/flux/repositories/helm/openebs.yaml b/kubernetes/flux/repositories/helm/loki.yaml similarity index 68% rename from kubernetes/flux/repositories/helm/openebs.yaml rename to kubernetes/flux/repositories/helm/loki.yaml index d0f105e64..f3699df99 100644 --- a/kubernetes/flux/repositories/helm/openebs.yaml +++ b/kubernetes/flux/repositories/helm/loki.yaml @@ -2,8 +2,8 @@ apiVersion: source.toolkit.fluxcd.io/v1beta2 kind: HelmRepository metadata: - name: openebs + name: loki namespace: flux-system spec: interval: 1h - url: https://openebs.github.io/charts + url: https://grafana.github.io/helm-charts