Skip to content

spiharsh/virtual-kubelet-web-mock-csharp

 
 

Repository files navigation

Virtual Kubelet Web Provider C# Mock Implementation

This project is a sample API implementation for the Virtual Kubelet web provider written in C# on .NET Core

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 the API via docker

To run the Mock API via docker run

docker run -p 5000:5000 stuartleeks/vk-web-mock

This will expose the API on http://localhost:5000.

Running locally for development

To run the API locally, run dotnet run (or dotnet watch run to monitor for file changes and automatically restart the site)

Connecting the API with Virtual Kubelet locally

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

export WEB_ENDPOINT_URL=http://localhost:5000/

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.

About

Mock API for the Virtual Kubelet web provider written in C#

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 73.6%
  • HTML 21.2%
  • CSS 2.9%
  • Dockerfile 1.3%
  • Other 1.0%