...

/

Installing Loki, Grafana, Prometheus, and the Demo App

Installing Loki, Grafana, Prometheus, and the Demo App

Learn how to install Loki, Grafana, and Prometheus.

Prerequisites

We’ll run the Loki stack inside a Kubernetes cluster. That’s our first requirement.

We’ll need a Kubernetes cluster with the NGINX Ingress controller. The address through which we can access Ingress should be stored in the environment variable INGRESS_HOST.

That’s it. Those are all the prerequirements.

As always, we’ve prepared Gists for creating clusters based on Google Kubernetes Engine (GKE), AWS Elastic Kubernetes Service (EKS), and Azure Kubernetes Service (AKS).

For this chapter, we’ll experiment with EKS cluster. The Gist for deploying the cluster can be found in this lesson. However, the Gist to install ingress host is given below. For practicing the commands on our platform, all the prerequisites are installed already. We’ll be able to run the commands in the project followed by this chapter.

Press + to interact
######################
# Ingress Controller #
######################
kubectl apply \
--filename https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.1/deploy/static/provider/aws/deploy.yaml
export INGRESS_HOSTNAME=$(kubectl \
--namespace ingress-nginx \
get svc ingress-nginx-controller \
--output jsonpath="{.status.loadBalancer.ingress[0].hostname}")
export INGRESS_HOST=$(\
dig +short $INGRESS_HOSTNAME)
echo $INGRESS_HOST
# Repeat the `export` commands if the output is empty
# If the output contains more than one IP, wait for a while longer, and repeat the `export` commands.
# If the output continues having more than one IP, choose one of them and execute `export INGRESS_HOST=[...]` with `[...]` being the selected IP.

Use them, or roll out your own cluster. Just remember that, if you choose to go with your own, you might need to change a command or two in the following examples.

Now that we have a cluster with Ingress and the address stored in the environment variable INGRESS_HOST, we’ll need to ensure that we have the helm CLI. We’ll use it to deploy all the tools we’ll need as well as a demo app. For the project associated with this chapter, helm CLI is already installed, but for your local machine, please visit the Installing Helm page for the relevant information.

Installing Loki Stack

Now that we have all the ...