How to create a page with buttons to deploy and decommission a container to a kubernetes clusture?

8/16/2019

So basically I want to create a single page with two buttons - one to deploy a container to kubernetes cluster and another to decommission a container. Its basically like a container admin panel and I have to use node js for creating it.

Till now, in order to deploy a simple vanilla tomcat image container using kubernetes, I would create a single tomcat.yaml file and then run the command kubectl apply -f tomcat.yaml to deploy it. But now I want to do the same thing when I click a button. I have already created the 2 buttons using Html. The panel has to be created using node js. When a button is clicked the javascript function will be invoked using an onlick() listener or getelementbyid().I have no idea how to proceed further, i mean how can i come up with a logic to deploy the container and delete upon clicking the buttons.

I want to replicate the behaviour of the commands

kubectl apply -f tomcat.yaml

kubectl delete pods,services,deployments,pvc,pv --all

All I am looking for is a basic idea or approach to get me started. Though I have a bit of experience in development and DevOps, I have zero experience in node js. So it would be helpful if you could kindly guide and help me out.

-- Vignesh Swaminathan
docker-container
kubernetes
node.js

0 Answers