Giter Club home page Giter Club logo

flink-k8s's Introduction

Flink K8s setup with Prometheus service discovery

This repository hosts manifests to configure a Kubernetes cluster with Flink monitored by Prometheus and Grafana using service discovery. Flink instances are automatically recognized and scraped by Prometheus.

The Docker image used in this setup can be found here.

Prerequisites

  • Kubernetes setup with kubectl installed.

TL;DR

git clone https://github.com/wzorgdrager/flink-k8s
kubectl apply -R -f ./flink-k8s/
kubectl port-forward -n monitoring service/grafana 3000:3000

Access Grafana Flink Dashboard on localhost:3000. This might take a few minutes.

Grafana login details
username: flink
password: flink-awesome

Installation

Clone the repository and apply all configurations:

git clone https://github.com/wzorgdrager/flink-k8s
cd flink-k8s
kubectl apply -f ./01-prometheus/
kubectl apply -f ./02-flink/
kubectl apply -f ./03-grafana/

This deploys a prometheus instance, a grafana instance and a Flink cluster with one JobManager and two TaskManagers (consisting of 16 taskslots each). Flink is configured and deployed to expose (Prometheus) metrics on port 9999 for each Job and TaskManager. Prometheus scrapes Kubernetes endpoints based on a JobManager service and headless TaskManager service routing to the correct metric endpoints. See architecture for a global view. After deploying all the manifests:

  • The JobManager can be accessed by port-forwarding it:
    kubectl port-forward -n flink service/flink-jobmanager 8081:8081
    Now it runs on localhost.
  • The Grafana dashboard can be accessed by port-forwarding as well:
    kubectl port-forward -n monitoring service/grafana 3000:3000
    Now it runs on localhost.
    Username: flink, password: flink-awesome. A Flink dashboard has been imported already. It should look like this:
    grafana

To see the service discovery working scale the TM instances from two to four:
kubectl -n flink scale deployment flink-taskmanager --replicas=4:

You can see these instances pop-up on the Grafana dashboard:
after_scaling

Architecture

architecture

References

Most manifests in this repository are based on the following sources:

flink-k8s's People

Contributors

wzorgdrager avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.