Coder Social home page Coder Social logo

tsaie79 / virtual-kubelet-web-mock-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stuartleeks/virtual-kubelet-web-mock-python

1.0 0.0 0.0 4 KB

Mock API for the Virtual Kubelet web provider written in Python

License: MIT License

Python 100.00%

virtual-kubelet-web-mock-python's Introduction

Virtual Kubelet Web Provider Python Mock Implementation

This project is a sample API implementation for the Virtual Kubelet web provider written in Python

This API simply stores the a list of the pods that it has been requested to create, marks them as started and serves up their status

+----------------+         +---------------------------+          +------------------------------+
|                |         |                           |   HTTP   |                              |
|   Kubernetes   | <-----> |   Virtual Kubelet: Web    | <------> |   This sample/mock API       |
|                |         |                           |          |                              |
+----------------+         +---------------------------+          +------------------------------+

Running locally for development

To run the API locally, run flask run --host 0.0.0.0 --port 3000

Connecting the API with Virtual Kubelet locally

To connect Virtual Kubelet to the API, set the WEB_ENDPOINT_URL environment variable to http://localhost:3000/ (or whatever you have exposed the API as)

export WEB_ENDPOINT_URL=http://localhost:3000/

Then run virtual-kubelet with the --provider web switch. This will run Virtual Kubelet on your local machine. It will connect to Kubernetes based on the kubectl config, and connect to the API defined in the WEB_ENDPOINT_URL environment variable

Visualising the API state

You can use kubectl commands to query running pods, but you can also run Virtual Kubelet Web UI to connect to the API directly and show details of the running pods and their status.

virtual-kubelet-web-mock-python's People

Contributors

stuartleeks avatar

Stargazers

Jeng-Yuan Tsai 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.