This process assume you already have:
make loki-install
This command will do:
- initialize the environment variables at
variables.sh - Execute the
setup-loki-fluentbit.shto do the following actions:- Set or enable the Caffeine - Flood Risk Tool Subscription.
- Connect to the
rhd-caff-stag-aks-xxxxK8s cluster. - Add the Grafana helm chart repo and update local helm index.
- Create the
monitoringnamespace. - Install Loki stack via Helm chart.
As long the loki stack is deployed, the configmap/loki-fluent-bit-loki resource should be modified to allow the fluentbit
collect logs at the /var/log/containers/*.log directory over all aks nodes (it is being deployed as a Daemonset)
A kubernetes filter was added to check K8s metadata like labels, namespaces, containers etc. in order to get the calculationId label as an index label to filter logs based on it.
Then, the fluentbit-configmap.yaml file should be executed:
kubectl apply fluentbit-configmap.yaml
After this, will be necessary to restart the fluentbit service which is running as a daemonset, so is neccesary to apply:
kubectl rollout restart daemonset loki-fluent-bit-loki -n observability
daemonset.apps/loki-fluent-bit-loki restarted
Perhaps before to execute make loki-install you can give execution permissions to variables.sh and setup-loki-fluentbit.sh files:
chmod +x ./variables.sh
chmod +x ./setup-loki-fluentbit.sh