helper-lokistack

by tjungbauer

Helm chartv1.0.25Apache-2.0Verified publisher

The only purpose of this helper chart is to provide a template for the LokiStack Custom Resource, so it must not be re-defined for multiple services.

About this chart

helper-lokistack

Description

The only purpose of this helper chart is to provide a template for the LokiStack Custom Resource, so it must not be re-defined for multiple services.

This Helm Chart is configuring the LokiStack object. This is for example required for OpenShift Logging and Network Observability.

Dependencies

This chart has the following dependencies:

RepositoryNameVersion
https://charts.stderr.at/tpl~1.0.31

It is best used with a full GitOps approach such as Argo CD does. For example, https://github.com/tjungbauer/openshift-clusterconfig-gitops

Maintainers

NameEmailUrl
tjungbauer[email protected]https://blog.stderr.at/

Sources

Source:

Source code: https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-lokistack

Parameters

Values

KeyTypeDefaultDescription
additionalAnnotationsstring{}Additional annotations on the LokiStack resource (merged with Argo CD metadata via tpl.argocdMetadata).
additionalLabelsobject{}Additional labels on the LokiStack resource.
admin_groupslistnoneAdminGroups defines a list of groups, whose members are considered to have admin-privileges by the Loki Operator. Setting this to an empty array disables admin groups. By default the following groups are considered admin-groups: - system:cluster-admins - cluster-admin - dedicated-admin
enabledboolfalseEnable or disable LokiStack configuration
limits.global.retention_daysint7This is for log streams only, not the retention of the object store. Data retention must be configured on the bucket.
limits.global.streamslistN/ASets retention policy for all log streams. Note: This field does not impact the retention period for stored logs in object storage. Be sure to keep the correct syntax to the selector
limits.tenantsobjectN/ASets retention policy by tenant. Valid tenant types are application, audit, and infrastructure.
limits.tenants.applicationobjectN/AType Application
limits.tenants.application.retentionobjectnoneSet retention time for application logs
limits.tenants.application.retention.streamslistN/ASet specific streams for the applications logs
limits.tenants.application.retention.streams[0]object{"days":4,"selector":"'{kubernetes_namespace_name=~\"test.+\"}'"}Retention time for the selector namespace =~test. Be sure to keep the correct syntax to the selector
limits.tenants.auditobjectN/AType Audit
limits.tenants.audit.retentionobjectnoneSet retention time for audit logs
limits.tenants.audit.retention.streamslistN/ASet specific streams for the audit logs
limits.tenants.audit.retention.streams[0]object{"days":1,"selector":"'{kubernetes_namespace_name=~\"openshift-cluster.+\"}'"}Retention time for the selector namespace starting with openshift-cluster. Be sure to keep the correct syntax to the selector
limits.tenants.infrastructureobjectN/AType Infrastructure
limits.tenants.infrastructure.retentionobjectnoneSet retention time for infrastructure logs
limits.tenants.infrastructure.retention.streamslistN/ASet specific streams for the infrastructure logs
limits.tenants.infrastructure.retention.streams[0]object{"days":1,"selector":"'{kubernetes_namespace_name=~\"openshift-cluster.+\"}'"}Retention time for the selector namespace starting with openshift-cluster. Be sure to keep the correct syntax to the selector
modestringstaticMode defines the mode in which lokistack-gateway component will be configured. Can be either: static (default), dynamic, openshift-logging, openshift-network
namestring"logging-loki"Name of the LokiStack object
namespacestring"openshift-logging"Namespace of the LokiStack object
networkPoliciesobject{"ruleSet":"None"}NEW since Loki 6.4: The Operator can automatically create NetworkPolicies for the LokiStack components. The values can either be 'None' or 'RestrictIngressEgress' RestrictIngressEgress will deploy a set of Policies that restrict the communication to and from the Loki components.
podPlacementsobject{}Control pod placement for LokiStack components. You can define a list of tolerations for the following components: compactor, distributer, gateway, indexGateway, ingester, querier, queryFrontend, ruler
storage.schemas[0]objectv13Version for writing and reading logs. Can be v11, v12 or v13
storage.schemas[0].effectiveDatestring2020-10-11EffectiveDate is the date in UTC that the schema will be applied on. To ensure readibility of logs, this date should be before the current date in UTC.
storage.secret.namestring"logging-loki-s3"Name of a secret in the namespace configured for object storage secrets.
storage.secret.typestrings3Type of object storage that should be used
storage.sizestring1x.extra-smallSize defines one of the supported Loki deployment scale out sizes. Can be either: - 1x.demo - 1x.extra-small (Default) - 1x.small - 1x.medium
storage.tls_caKeystringservice-ca.crtKey of Configmap that contains the CAs
storage.tls_caNamestringopenshift-service-ca.crtName of Configmap that contains the CAs
storageclassnamestringgp3-csiStorage class name defines the storage class for ingester/querier PVCs.
syncwaveint3Syncwave for the LokiStack object.

Example values

---
enabled: true

name: logging-loki
namespace: openshift-logging
syncwave: 3

# This is for log streams only, not the retention of the object store
global_retention_days: 4

# storage settings
storage:

  # Size defines one of the support Loki deployment scale out sizes.
  # Can be either:
  #   - 1x.extra-small (Default)
  #   - 1x.small
  #   - 1x.medium
  # size: 1x.extra-small

  # Secret for object storage authentication. Name of a secret in the same namespace as the LokiStack custom resource.
  secret:

    # Name of a secret in the namespace configured for object storage secrets.
    name: logging-loki-s3

    # Type of object storage that should be used
    # Can bei either:
    #  - swift
    #  - azure
    #  - s3 (default)
    #  - alibabacloud
    #  - gcs
    # type: s3

  # Schemas for reading and writing logs.
  # schemas:
  #  # Version for writing and reading logs.
  #  # Can be v11 or v12
  #  #
  #  # Default: v12
  #  - version: v12
  #    # EffectiveDate is the date in UTC that the schema will be applied on. To ensure readibility of logs, this date should be before the current date in UTC.
  #    # Default: 2022-06-01
  #    effectiveDate: "2022-06-01"

# Storage class name defines the storage class for ingester/querier PVCs.
storageclassname: thin-csi

# Mode defines the mode in which lokistack-gateway component will be configured.
# Can be either:
#   - static (default)
#   - dynamic
#   - openshift-logging
#   - openshift-network
mode: openshift-logging

# Control pod placement for LokiStack components
podPlacements:
  compactor:
    nodeSelector:
      key: node-role.kubernetes.io/infra
      value: ''
    tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
      - effect: NoExecute
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
  distributor:
    nodeSelector:
      key: node-role.kubernetes.io/infra
      value: ''
    tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
      - effect: NoExecute
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
  gateway:
    nodeSelector:
      key: node-role.kubernetes.io/infra
      value: ''
    tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
      - effect: NoExecute
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
  indexGateway:
    nodeSelector:
      key: node-role.kubernetes.io/infra
      value: ''
    tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
      - effect: NoExecute
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
  ingester:
    nodeSelector:
      key: node-role.kubernetes.io/infra
      value: ''
    tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
      - effect: NoExecute
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
  querier:
    nodeSelector:
      key: node-role.kubernetes.io/infra
      value: ''
    tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
      - effect: NoExecute
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
  queryFrontend:
    nodeSelector:
      key: node-role.kubernetes.io/infra
      value: ''
    tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
      - effect: NoExecute
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
  ruler:
    nodeSelector:
      key: node-role.kubernetes.io/infra
      value: ''
    tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved
      - effect: NoExecute
        key: node-role.kubernetes.io/infra
        operator: Equal
        value: reserved

Installing the Chart

To install the chart with the release name my-release:

helm install my-release tjungbauer/<chart-name>>

The command deploys the chart on the Kubernetes cluster in the default configuration.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.


Autogenerated from chart metadata using helm-docs v1.14.2

Deploy helper-lokistack with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has helper-lokistack on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charthelper-lokistack is pinned at v1.0.25 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply