Git Product home page Git Product logo

pinot-playground's Introduction

Pinot Playground

Simple project to play with Apache Pinot:

  • installation in k8s
  • installation of cert-manager
  • monitor certificates expiration

All the deployments are done in minikube on MacOS.

Install

Minikube

Follow instruction to install minikube provided at https://minikube.sigs.k8s.io/docs/start/ To be able to interact with Docker running in minikube VM:

eval $(minikube docker-env)

Helm

If helm is not installed on your system

brew install helm

Apache Pinot

Following Apache Pinot documentation:

helm repo add pinot https://raw.githubusercontent.com/apache/pinot/master/kubernetes/helm
kubectl create ns pinot-quickstart
helm install pinot pinot/pinot -n pinot-quickstart --set cluster.name=pinot --set server.replicaCount=2

To verify the deployment

kubectl -n pinot-quickstart get all

For more details, go to https://docs.pinot.apache.org/basics/getting-started/kubernetes-quickstart#2.-setting-up-a-pinot-cluster-in-kubernetes

Kafka

Kafka is used to collect the alerts emitted by the cert-monitor. The topic is cert-monitor-alerts. Install Kafka

helm repo add incubator https://charts.helm.sh/incubator
helm install -n pinot-quickstart kafka incubator/kafka --set replicas=1,zookeeper.image.tag=latest

To verify the deployment

kubectl get all -n pinot-quickstart | grep kafka

To create the cert-monitor-alerts topic

kubectl -n pinot-quickstart exec kafka-0 -- kafka-topics --zookeeper kafka-zookeeper:2181 --topic cert-monitor-alerts --create --partitions 1 --replication-factor 1

Cert-manager

Install cert-manager with regular manifest

kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml

To verify the deployment

kubectl -n cert-manager get all

For more details, go to https://cert-manager.io/docs/installation/

To create Issuers

kubectl apply -f cert-manager/kubernetes/issuers.yml

To create a certificate. The created certificate will expire every hour. It is created in the sandbox namespace with the name vergnes-com.

kubectl apply -f cert-manager/kubernetes/certificate.yml

Simulate cert-manager outage

The cert-manager deployment is responsible of renewing the certificates before their expiration. To verify that the cert-monitor can detect expired certificates we can simulate that the cert-manager is down by setting the number of replicas to 0.

To simulate that the cert-manager is down

kubectl -n cert-manager scale deploy/cert-manager --replicas=0

To restore the deployment of the cert-manager

kubectl -n cert-manager scale deploy/cert-manager --replicas=1

Cert-monitor

This section is related to the cert-monitor that will list all certificate CRD to verify their expiration. The cert-monitor is deployed as a k8s cron job that runs every minute. The cert-monitor generates alerts as messages in the kafka topic cert-monitor-alerts. The alert is JSON encoded, it contains: level, message, certificate location (name, namespace), timestamp, pod name who generated the alert.

All commands described in that section must be run in the cert-monitor directory.

cd cert-monitor

Build

make docker

Deployment

kubectl create ns cert-monitor
kubectl -n cert-monitor apply -f kubernetes/rbac.yml
kubectl -n cert-monitor apply -f kubernetes/config.yml
kubectl -n cert-monitor apply -f kubernetes/job.yml

To see the logs of last job

kubectl -n cert-monitor logs `kubectl -n cert-monitor get po | grep cert-monitor | tail -1 | awk '{print $1}'`

pinot-playground's People

Watchers

Denis Vergnes 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.