The Loki project is a log aggregation system designed to store and query logs from multiple sources. It's part of the Grafana ecosystem and optimizing for cost-effective and efficient log storage. Loki's design is to work seamlessly with Grafana for visualization and Prometheus for metrics.
This Makefile manages the Loki Helm chart, which simplifies the deployment and management of Loki in a Kubernetes environment. The Makefile provides targets to automate common tasks such as pulling the latest Loki YAML configuration, upgrading Loki, and ensure required tools are present.
Before using the Makefile, ensure you have the following tools installed:
helm
- all: This is the default target that runs
check-tools
,clean
, andmanifests
targets in sequence. - init: Adds the Grafana Helm repository and updates the Helm repository index.
- manifests: Removes the previous Loki YAML file and pulls the latest Loki
YAML configuration from the Helm chart using the specified
values.yaml
file. - upgrade: Removes the previous Loki YAML file and upgrades the Loki deployment using the latest configuration from the Helm chart.
- check-tools: Ensures that the required tools (e.g., Helm) are available on the system.
- help: Displays usage information for the Makefile targets.
-
Initialize Helm Repository
Before using the Makefile, you need to initialize the Helm repository:
make init
-
Generate Loki Manifests
To generate the Loki YAML configuration file, run:
make manifests
This will remove the previous
loki.yaml
file and pull the latest configuration from the Helm chart. -
Upgrade Loki
To upgrade the Loki deployment with the latest configuration, run:
make upgrade
This will remove the previous
loki.yaml
file and upgrade the Loki deployment. -
Check Required Tools
Ensure the installation of required tools by running:
make check-tools
This will check that Helm is available on your system.
-
Display Help
To display the help message with information about the Makefile targets, run:
make help
- DEFAULT_VERSION: The default version of Loki to use (e.g.,
6.22.0
). - LOKI_VERSION: The version of Loki to use, which can be overridden by setting this variable.
- LOKI_OUTPUT_YAML: The output file for the Loki YAML configuration
(default:
vendor/loki.yaml
). - VALUES_FILE: The path to the
values.yaml
file used for Helm configuration.
To generate the Loki manifests using a specific version and values file, you can run:
make LOKI_VERSION=2.4.1 VALUES_FILE=/path/to/your/values.yaml manifests
This will pull the specified version of Loki and use the provided values.yaml
file for configuration.