Prometheus Operator Kubernetes Tutorial: ServiceMonitor - PodMonitor - Step-by-Step

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ค. 2024
  • 🔴 - To support my channel, I’d like to offer Mentorship/On-the-Job Support/Consulting - me@antonputra.com
    ▬▬▬▬▬ Experience & Location 💼 ▬▬▬▬▬
    ► I’m a Senior Software Engineer at Juniper Networks (12+ years of experience)
    ► Located in San Francisco Bay Area, CA (US citizen)
    ▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬
    ► LinkedIn: / anton-putra
    ► Twitter/X: / antonvputra
    ► GitHub: github.com/antonputra
    ► Email: me@antonputra.com
    ▬▬▬▬▬▬ Related videos 👨‍🏫 ▬▬▬▬▬▬
    👉 [Playlist] Kubernetes Tutorials: • Kubernetes Tutorials
    👉 [Playlist] Terraform Tutorials: • Terraform Tutorials fo...
    👉 [Playlist] Network Tutorials: • Network Tutorials
    👉 [Playlist] Apache Kafka Tutorials: • Apache Kafka Tutorials
    👉 [Playlist] Performance Benchmarks: • Performance Benchmarks
    👉 [Playlist] Database Tutorials: • Database Tutorials
    ▬▬▬▬▬▬▬ Timestamps ⏰ ▬▬▬▬▬▬▬
    0:00 Intro
    2:10 Create EKS cluster
    3:03 Install Prometheus Operator
    5:21 Deploy Prometheus
    7:08 Deploy Sample App
    13:13 Deploy Grafana using Helm
    16:23 Prometheus Additional Scrape Configs
    18:31 Prometheus Operator Probe
    20:05 Create Alertmanager with Slack integration
    ▬▬▬▬▬▬▬ Source Code 📚 ▬▬▬▬▬▬▬
    ► GitHub: github.com/antonputra/tutoria...
    #kubernetes #cloud #devops
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 74

  • @AntonPutra
    @AntonPutra  9 หลายเดือนก่อน +3

    🔴 - To support my channel, I’d like to offer Mentorship/On-the-Job Support/Consulting - me@antonputra.com

  • @AshishRaniwala
    @AshishRaniwala ปีที่แล้ว +5

    Extremely well done video and repo. You saved the day!

  • @renanangelodossantos4726
    @renanangelodossantos4726 7 หลายเดือนก่อน +1

    FINALLY got it working. Thanks!

    • @AntonPutra
      @AntonPutra  7 หลายเดือนก่อน +1

      welcome :)

  • @anastrak
    @anastrak ปีที่แล้ว +1

    Thanks for this precious content , very well explained .

  • @ahmedelshafaie
    @ahmedelshafaie ปีที่แล้ว +1

    Awesome, Thank you Anton

  • @suncru
    @suncru ปีที่แล้ว +1

    Thank you, Anton
    That really helped a lot

  • @user-vs5yk3ys1c
    @user-vs5yk3ys1c ปีที่แล้ว +1

    Thanks a lot, this tutorial really helped me!

  • @RafaelDurelli
    @RafaelDurelli ปีที่แล้ว +1

    Best videos as always.

  • @devops22
    @devops22 ปีที่แล้ว +1

    Awesome work ✨

  • @chasim1982
    @chasim1982 ปีที่แล้ว +4

    Great teaching ability, thanks a lot for all amazing & high quality content, please make videos regarding eks & gke logging solutions with grafana loki or with elasticsearch, thanks

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว +2

      Thanks Muhammad, will do!

  • @ziaurrehman4738
    @ziaurrehman4738 ปีที่แล้ว +1

    Thanks, that's what I needed yesterday

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

      Welcome =)

    • @ziaurrehman4738
      @ziaurrehman4738 ปีที่แล้ว

      @@AntonPutra can you explain what is the purpose of prometheus adaptors?

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

      @@ziaurrehman4738 You can use prometheus metrics for horizontal pod autoscaller (by default only cpu and memory), i have a tutorial how to implement

    • @ziaurrehman4738
      @ziaurrehman4738 ปีที่แล้ว

      @@AntonPutra thanks. I will try to find that video on your channel

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว +1

      @@ziaurrehman4738 This one - th-cam.com/video/iodq-4srXA8/w-d-xo.html

  • @piyushdarji7926
    @piyushdarji7926 ปีที่แล้ว +1

    Anton will become big youtuber one day definitely✌🤟

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว +1

      Thanks for the support Piyush!

  • @tadeubernacchi3360
    @tadeubernacchi3360 ปีที่แล้ว

    Nice video, thanks for the content. In the case I'm using `kind: AlertmanagerConfig`. How do I do to make this work with a `PrometheusRule` operator to send notifications to slack? I already have alertmanager up and exposed with TLS on my URL. Once again, thank you

  • @MrBharathkumarraju
    @MrBharathkumarraju ปีที่แล้ว +1

    Extremely useful sir!!!

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว +1

      Thank you!

    • @MrBharathkumarraju
      @MrBharathkumarraju ปีที่แล้ว

      Next time integrate with thanos with compactor and s3 backend

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว +1

      @@MrBharathkumarraju Thanos (Multi Cluster Prometheus) Tutorial: Global View - Long Term Storage - Kubernetes - th-cam.com/video/feHSU0BMcco/w-d-xo.html

    • @MrBharathkumarraju
      @MrBharathkumarraju ปีที่แล้ว

      @@AntonPutra woww you are real k8s monitoring guru!!! and you made them available for free...hatsoff to you!!!

    • @MrBharathkumarraju
      @MrBharathkumarraju ปีที่แล้ว

      @@AntonPutra any videos on loki-promtail and tempo for tracing?

  • @007tnfa
    @007tnfa 10 หลายเดือนก่อน +1

    Hi bro. Thanks for your content. Especially on EKS. How do you make your presentation. With animation of red arrow for exemple. Do you make it yourself, with which tool, or you pay someonelse. It look really nice.

    • @AntonPutra
      @AntonPutra  10 หลายเดือนก่อน

      Thank you! I do it myself using the Adobe suite.

  • @A_Dudkin
    @A_Dudkin 8 หลายเดือนก่อน

    Hi! Thanks Anton for the explanations
    Can you give a hint - how to configure Prometheus how much space in the disk to use for metrics store and for how long to keep them?

    • @AntonPutra
      @AntonPutra  8 หลายเดือนก่อน

      Usually 7 or 14 days, disk size depends on how many targets you have and scrape interval. In all clouds you can increase volume when you reach a limit, just make sure that your kubernetes storage class has "expandable: true". If you need long term checheap storage use thanos.

  • @givemoresibanda9739
    @givemoresibanda9739 ปีที่แล้ว +1

    Thanks for the videos
    Can you do persistent storage for Prometheus using helm am struggling with it

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

      Sure, just set this block - github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L670-L678

  • @clementbenedetti724
    @clementbenedetti724 ปีที่แล้ว +1

    Very nice video, any tuto of multiple clusters to monitor with prometheus agent and a global cluster with prometheus operator using remote write?

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

      Thanks, I'll create one soon for thanos

  • @YordisPrieto
    @YordisPrieto ปีที่แล้ว +1

    Would be nice to provision the target and some dashboard using the helm release if possible

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

      Thanks for the feedback!

  • @drystack86
    @drystack86 ปีที่แล้ว +1

    Anton, do you have any suggestions for how to handle migration from "plain vanilla" Prometheus to Prometheus Operator? For example if I have an existing Prometheus instnace running in my EKS cluster, can I install the Prometheus Operator in that same cluster and then migrate to it?

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว +1

      Yes, you can. Both Prometheus instances can be run in parallel. You need to deploy them using an operator and convert your plain Prometheus config to a service or pod monitor. Make sure that both have the same targets before decommissioning the old one.

  • @angelmanuelcamarero9813
    @angelmanuelcamarero9813 ปีที่แล้ว

    Thanks for this excellent tutorial, but it is possible to add basic auth? I didn't find the way to include a custom web.config.file.

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

      Try this to setup basic auth - github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#httpconfig-1

  • @DikshantRai-od8vq
    @DikshantRai-od8vq หลายเดือนก่อน

    hi @AntonPutra , how did yo manage configuration for alerts. You did not show anything similar to that

    • @AntonPutra
      @AntonPutra  หลายเดือนก่อน

      Well, alerts are configured on the local prometheus (recommendation from Thanos itself), it's usually done by using alert custom resource
      "NOTE: It is recommended to keep deploying rules inside the relevant Prometheus servers locally. Use ruler only on specific cases. Read details below why."
      thanos.io/v0.8/components/rule/#rule-aka-ruler

  • @squalazzo
    @squalazzo ปีที่แล้ว +1

    why not automate even the datasources and dashboards setups? both can be deployed as configmaps and automatically discovered based on some labels
    hint for next video? :) great tutorial, btw!

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว +1

      Thanks for the feedback!

  • @Davidlavieri
    @Davidlavieri 3 หลายเดือนก่อน

    Would you recommend to use helm charts with terraform, we are on an awkward situation where we want to pass secrets to the helm chart and have it force a reload in the pods like kustomize does with helm inflator generator

    • @Davidlavieri
      @Davidlavieri 3 หลายเดือนก่อน

      Well now that I think about it, maybe could use sops/age for secrets do you have video about it ? We want a solution to remove secrets from state

    • @AntonPutra
      @AntonPutra  3 หลายเดือนก่อน

      it's hard to maintain helm charts over time. if you want it for temporary env, qa, staging, dev environment it's ok. but if you plan to maintain that env for over a year, it can be dangerous

    • @Davidlavieri
      @Davidlavieri 3 หลายเดือนก่อน

      Ah do you mean managing helm charts in general or just outside gitops (terraform)?

  • @chasim1982
    @chasim1982 ปีที่แล้ว

    Hi! In probe.yaml , if we provide a incorrect or fake domain, prometheus still shows target is up with incorrect domain url, as a result no alert will be generated, if we access blackbox it will correctly shows the errors, can you please guide about the fix, thanks

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว +1

      can you try using something like status code in the alert? fake domain should not produce 2xx result

  • @gulammoideen9405
    @gulammoideen9405 4 หลายเดือนก่อน

    I am facing issue when applying prometheus, prometheus-main-0 goes in pending state.
    prometheus-main-0 0/2 Pending 0 3m19s

    • @bartsimpson2324
      @bartsimpson2324 4 หลายเดือนก่อน

      probably there is no pv for pvc, check both and logs from this pod

  • @rohittiwari5575
    @rohittiwari5575 ปีที่แล้ว

    Have you tried VictoriaMetrics Operator?

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว +1

      No, first time I hear about it, but I'll take a look.

    • @rohittiwari5575
      @rohittiwari5575 ปีที่แล้ว

      @@AntonPutra Try it, it's better than Prometheus

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

      @@rohittiwari5575 I will. Why it's better?

  • @mohamedelmehdielberiri
    @mohamedelmehdielberiri 5 หลายเดือนก่อน +1

    whenver you ssay operator i hear brother

    • @AntonPutra
      @AntonPutra  5 หลายเดือนก่อน

      working on my english :)

    • @mohamedelmehdielberiri
      @mohamedelmehdielberiri 5 หลายเดือนก่อน

      @@AntonPutra its undrestandable, thanks for the explenation tho

  • @YordisPrieto
    @YordisPrieto ปีที่แล้ว +1

    Second this time 😰

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

      ?

    • @YordisPrieto
      @YordisPrieto ปีที่แล้ว +1

      @@AntonPutra I was the second person to comment 😅 a cultural habit of followers in TH-cam 🥲😅

    • @AntonPutra
      @AntonPutra  ปีที่แล้ว

      @@YordisPrieto 😅

  • @santacloudy
    @santacloudy 6 หลายเดือนก่อน

    wth is all this, this is so freakin confusing, yamls everywhere and weird nonsensical terminology, ugh