Add Logging to a Cluster
In this tutorial, we are going to show how you can use a Zarf component to inject zero-config, centralized logging into your Zarf cluster.
More specifically, you’ll be adding a Promtail / Loki / Grafana (PLG) stack to the Retro Arcade Tutorial by installing Zarf’s “logging” component.
- You’ll need an internet connection to grab the Zarf Init Package if it’s not already on your machine.
Prior to this tutorial you’ll want to have a working cluster with Zarf initialized.
- Zarf binary installed on your $PATH: (Installing Zarf)
- Initialize a cluster.
- Perform the Retro Arcade Tutorial.
- Run the
zarf initcommand on your cluster.
$ zarf init- When prompted to deploy the package select
yfor Yes, then hit theenterkey.
When prompted to deploy the logging component selectyfor Yes, then hit theenterkey.
- You can automatically accept the logging component, and confirm the package using the
--confirmand--componentsflags.
- Review the
zarf initcommand output for the following:
You should see a section for Logging. You will need these credentials later on.
- If you haven’t already in the prerequisites, deploy the Retro Arcade Tutorial.
To open Grafana you can use the zarf connect logging command.
You’ll be redirected the /login page where you have to sign in with the Grafana credentials you saved in a previous step.

Once you’ve successfully logged in go to:
- The “Explore” page (Button on the left that looks like a compass)
- Select
Lokiin the dropdown, and then - Enter
{app="game"}into the Log Browser query input field

Submit that query and you’ll get back a dump of all the game pod logs that Loki has collected.

- Use the
zarf package listcommand to get a list of the installed packages and their components. This will give you the name of the init package and the logging component to remove it.
- Use the
zarf package removecommand to remove theloggingcomponent from the init package. Don’t forget the--confirmflag. Otherwise you’ll receive an error.