/ProtoK

A framework for Kubernetes that allows running serverless functions. Made easy for Kubernetes through a beautiful UI.

Primary LanguagePythonMIT LicenseMIT

ProtoK

MIT license made-with-python made-with-VueJS made-with-Node

A framework for Kubernetes that allows running serverless functions. Serverless functions made easy for Kubernetes through a beautiful UI.

Requirements

  1. npm - For managing Node Packages.
  2. Python3 - For managing the Controller Backend.
  3. Git - Source control.

Installation

Setup Kubernetes Infra

  1. sh ./setup.sh -- to apply all the necessary yaml configurations
  2. cd protok_controller; ./crd_controller.py to run python CRD controller
  3. cd protok_controller; ./app.py to run python app
  4. Now Protok Kubernetes infrastructure should be fully setup if all of these go through

Setup Web Frontend/Backend

  1. Clone the repository
$ git clone https://github.com/dprasse/ProtoK.git
  1. Install the required depenendencies from the main folder.
$ npm install
  1. Run the startup script that will install the dependencies and launch the frontend and backend server.
$ npm start
  1. You should now be able to access the frontend through your localhost url http://localhost:8080/

Simple helloworld() demo

  1. curl -k -v -XPOST -H "Content-Type: application/json" -d@./protok_controller/templates/controller_create_function.json http://127.0.0.1:5000/apis/stable.protok.com/v1/namespaces/default/serverlessfunctions -- to create a helloworld function that prints 2 input strings
  2. kubectl get serverlessfunctions -- you should be able to see the newly created function here
  3. kubectl get pods -- make sure that the pods is running
  4. curl -X POST --data '{"message1": "ok", "message2": "ok"}' http://127.0.0.1:8091/api/v1/namespaces/default/services/helloworld:http-function-port/proxy/ -H "Content-Type: application/json"

Info

Credit

  1. Kubernetes - Container Orchestration.
  2. Dr. Vijay Chidambaram - CS378 Virtualization Class
  3. VueJS - Frontend Framework.
  4. BootstrapVue - Frontend Framework.
  5. CreativeTim - Portions of Dashboard Templating.
  6. ExpressJS - Web Backend Framework.
  7. Flask - Python Backend Framework.