Skip to content

Practice Exercise 1

Practice Exericise 1: Accessing the prom UI

Objective: The goal of this exercise is to provide interns with hands-on experience in monitoring a Linux host using various tools and commands. Upon completing this exercise, interns should be able to create scripts that can monitor any linux host.

Step 1: Download Kubeconfig

  1. Open a terminal on your local machine.

  2. Use the following command to download the kubeconfig file for your namespace:

    wget https://raw.githubusercontent.com/RobssR/Mon1/main/Monitoring-Acad-kubeconfig.yaml

  3. Then use this command to use context in the yaml file when using kubectl

    export KUBECONFIG=~/Downloads/Monitoring-Acad-kubeconfig.yaml

  4. Confirm that the kubeconfig.yaml file has been successfully exported and usable.

    kubectl get namespaces

Step 2: Check Prometheus Pods

  1. Ensure that you have the kubectl command-line tool installed on your machine.

  2. Use the following command to list all the pods/deployment in your namespace:

    kubectl get pods -n <YOUR NAMESPACE>

  3. Identify the Prometheus pods in the list. Note the pod names for reference.

Step 3: Access Prometheus UI

  1. Open a web browser and navigate to the Prometheus UI using the following format:

    arduinoCopy code

    http://<your-initials>-prom.acad.opswerks.net

    Replace <your-initials> with your actual initials (e.g., dlogpit). http://dlogpit-prom.acad.opswerks.net

  2. You will be prompted to enter your credentials. Use the provided login credentials to access the Prometheus UI.

Step 4: Getting Familiar with the Prometheus UI

  1. Once logged in, explore the Prometheus UI to monitor metrics and performance data.

  2. Familiarize yourself with the available tabs and features such as Graph, Alerts, Status, and Targets.

  3. Use the query language to retrieve specific metrics by entering expressions in the "Expression" input box.

  4. Experiment with different queries and visualizations to understand the capabilities of Prometheus.

Note: If you encounter any issues or have questions, reach out to your mentor/curator or the designated medium for assistance.