Friday, February 14, 2020

Full Guide for using Bitnami Prometheus Operator Helm Chart with Additional Scrape Configuration

"The Prometheus Operator for Kubernetes provides easy monitoring definitions for Kubernetes services and deployment and management of Prometheus instances."
Bitnami kindly provided/maintained a Helm Chart of Prometheus Operator make it easy to start/deploy the Prometheus Operator in Kubernetes Cluster. Today, we will walk through the steps to get it running in your Kubernetes cluster.


  • Set up Helm and add Bitnami Helm Repo
    • You need have a Kubernetes cluster ready to deploy the Prometheus Operator on, I am using the docker-desktop cluster running on Windows 10. 
    • You need do "helm init" to install the Tiller to your running K8S cluster.
    • You need run "helm repo add bitnami https://charts.bitnami.com/bitnami" to add Bitnami Helm Repo.
  • Create the secret that contains your Additional Scrape Configuration
    • Create a local file named: additional-scrape-configs.yaml with content looks like:
    • Run the following command to make a secret out of the configuration file:
    • Apply the secret file to create the secret in your Kubernetes Cluster:
  • Install the bitnami/prometheus-operator Helm chart
  • Port forwarding for the prometheus to access it from your host machine
    • If everything went well, you should be able to access the prometheus from you host's web browser at http://localhost:9090
  • Last, you can start your prometheus instrumented app on your host to let the prometheus scrape some data.
    • You can go to the Targets on http://localhost:9090 to verify that the static target(s) configured Additional Scrape Configuration is UP.
If you don't have the correct named secret created or the format is malformed, the prometheus pod will not be started, and it is pretty hard to understand what is going on. Luckily you can watch the log from your svc/prometheus-operator-operator by using the following command to diagnose:
  • kubectl logs -f  svc/prometheus-operator-operator

Monday, February 10, 2020

Using FFmpeg streaming unix desktop to windows via UDP

"FFmpeg is a free and open-source project consisting of a vast software suite of libraries and programs for handling video, audio, and other multimedia files and streams."

FFmpeg is powerful, and sometime it is hard to figure out what exact the parameters to be used to achieve your goal with it. Today, we will teach you how to streaming Linux desktop to remote windows by using FFmpeg.

First, on your linux box start the FFmpeg streaming with the following command:

Note: The IP in the UDP url should be the remote windows IP. The FFmpeg will post the streaming data to that IP.

Then, on your remote windows box, start VLC 2.2.5 (an older version, be aware of that the current version 3.0.8, will not work, it just shows black screen when connect to the UDP streaming on windows), add a Network Stream:

udp://@0.0.0.01234

Voila, now you can view your Linux desktop on Windows now.

Wednesday, January 22, 2020

NATS multiple seed cluster

"NATS.io is a simple, secure and high performance open source messaging system for cloud native applications, IoT messaging, and microservices architectures."

There are some documents for NATS clustering, here and here.

Today, we would like to start a NATS cluster with two seed servers, the architecture look like: 


// To fill in the architecture diagram


Here are the steps for starting up the cluster:

  • Start up the two seed servers (seed1 and seed2):

  • Start three cluster servers (server A, B, C):


Voila! You get the cluster running, now it's time test it out:
  • Start subscriber and publisher:

Full Guide for using Bitnami Prometheus Operator Helm Chart with Additional Scrape Configuration

"The Prometheus Operator for Kubernetes provides easy monitoring definitions for Kubernetes services and deployment and management of...