Search code examples
kuberneteskubernetes-podkubernetes-apiserver

Create API Endpoints in Kubernetes


I am new to Kubernetes, so the there might already be new solutions which I am missing here.

Requirement

How do I create and API endpoint in Kubernetes which I can use to spawn new deployments and services?

Why do I require API Endpoint??

The requirement is such that new service needs to be get spawned whenever there are information (say name of new service, port it should run on, what config and resources it uses, so on...) pis provided by already running service (say service A).

So, when these informations are fed to the endpoint, a service running behind that api endpoint will create a template based on obtainted infromation, and execute necessary commands to spawn the new services.

If there is any better approach than this please suggest me as well.


Solution

  • For me the solution was to using some standard library e.g. kubernetes python client to interact with kubernetes API from my application as suggested by @mario.

    I will share further solution on how I wrote the api using python client and may be even using go ;)