<p>I am new to Kubernetes, so the there might already be new solutions which I am missing here.</p>
<p><strong>Requirement</strong></p>
<p>How do I create and API endpoint in Kubernetes which I can use to spawn new deployments and services?</p>
<p><strong>Why do I require API Endpoint??</strong></p>
<p>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).</p>
<p>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.</p>
<p><strong>If there is any better approach than this please suggest me as well.</strong></p>

dempti
<p>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.</p>
<p>I will share further solution on how I wrote the api using python client and may be even using go ;)</p>
