Skip to content

oslabs-beta/Kedalyze

Repository files navigation

KEDALyzeLogo

KEDAlyze

An application that visualizes real-time Kubernetes Event Driven Autoscaling (KEDA).

Table Of Contents
  1. Functionality
  2. Features
  3. General Setup
  4. Electron Setup
  5. Cluster Setup
  6. Contributing
  7. License
  8. Authors

Functionality

KEDA is the perfect tool to use for autoscaling kubernetes pods based on event triggers. Gone are the days of only being able to horizontally autoscale new pods only for CPU or memory usage. We know how great of a tool KEDA is, but how can we see all of it's magic happening behind the scenes?

We introduce to you, KEDALyze!

KEDALyze is an open-source product that gives users the ability to visualize KEDA's autoscaling. With Prometheus as the event trigger, watch as promQL queries drive the deployment and termination of pods. Our visualizer displays cluster health, events triggers, and horizontal auto scaling in live time, to give the user security that their applications can handle higher workloads.

Built With:

  • React React Router Redux
  • Express.js MongoDB
  • JWT Electron.js Jest
  • Docker Kubernetes KEDA
  • Prometheus Grafana
  • TypeScript Webpack

(back to top)

Features

Live Metrics

See KEDA autoscaling in action

KEDA

See other metrics from your local Kubernetes cluster

Global APIServer Namespaces Nodes Pods CoreDNS

Autoscaling

Prometheus queries are the event triggers we used to horizontally auto scale our pods. Customizing the KEDA scaled object to use http requests, we are able to deploy replica pods once the requests have reached a certain threshold. We've incorporated Grafana to allow monitoring of the http requests of your application, alongside with the autoscaling that is triggered. Our charts give users the security to know that KEDA is functional, deploying pods at higher workloads and dissipating them when they are no longer necessary.

(back to top)

General Setup

In the config folder, you can see all the configuration files needed to get you started with our application. Please have docker and minikube installed on your computer prior to following the steps in the read me in the config folder.

Installation

  1. Fork and clone the repo

    git clone https://github.com/your-github-handle/Kedalyze.git
  2. Install NPM packages

    npm install
  3. Create .env file at root of directory

    root
     ├─ .env
     ├─ electron
     └─ src
  4. Connect Mongo database in .env

    MONGO_URI = 'YOUR MONGO URI STRING';
  5. Set up JWT secret in .env

    JWT_SECRET = 'your string of choice';
  6. Make sure you cluster is running and then you can run the command

    npm run dev
  7. Run your electron application

    npm run electron-start

(back to top)

Electron Setup

Note: If you are on a Windows operating system, you will need to follow these steps to run electron

Windows Setup for Electron

  1. Download and install all of these dependencies:

    sudo apt install ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils
  2. Go to this link to download X Server, this is how you will see the electron window:

  3. Steps for X server configuration:

    • Under display settings, select Multiple Windows, set the Display number to -1, click next
    • Under select how the client starts, select Start no client, click next
    • Under extra settings, make sure to add a checkmark to disable access control, click next
    • Click save configuration and add the config.xlaunch to your desktop, click finish.
  4. Next go to Windows Security > Firewall & network protection > Allow an app through firewall > Make sure VcXsrv has both public and private checked

  5. Before attempting to npm run anything you will always need to go to your config.xlaunch file and run it first. All you have to do is double click the file and you will see the X server icon in your system tray or taskbar. That is how you know X server is running.

  6. Run this command on your local system this will print your nameserver IP to the terminal:

    export DISPLAY="`grep nameserver /etc/resolv.conf | sed 's/nameserver //'`:0"
  7. Copy the nameserver IP, you will need it for the next step

  8. In the JSON file change the electron-windows script to export DISPLAY="put your nameserver IP here" do not add the quotes in your JSON file

  9. npm start (to start the webpack)

  10. npm run electron-windows

  11. npm run electron-start

  12. The electron application should now launch in an X server window

** Important If you get this error: Missing X server or $DISPLAY The platform failed to initialize. Exiting.

  1. Put this command in the terminal: echo $DISPLAY

  2. If nothing prints to the terminal go to the next step, if a nameserver IP does print make sure it matches the export DISPLAY= in the electron-windows script

  3. Repeat steps 8 and 9, make sure X server is still running, then move on to steps 10 to 12

** Important: Each and every time you want to launch our application on Windows you must: launch X server, and follow steps 8 to 12

** Additional: If you need anymore help with setup on windows visit this link

(back to top)

Cluster Setup

MacOS/Windows/Linux Installation

Follow the steps that apply to you for your operating system to install kubectl and minikube

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give our product a star! Thanks again!

  1. Fork the Open Source Product
  2. Create your Feature Branch git checkout -b feature/AmazingFeature
  3. Commit your Changes git commit -m 'Add some AmazingFeature'
  4. Push to the Branch git push origin feature/AmazingFeature
  5. Open a Pull Request

README for Contributions

License

Distributed under the MIT License. See LICENSE for more information.

Authors

(back to top)