Deploy Node App on Kubernetes

Ticker

6/recent/ticker-posts

Deploy Node App on Kubernetes

 Question : The Nautilus development team has completed development of one of the node applications which they are planning deploy on a Kubernetes cluster. They recently had a meeting with the DevOps team to share their requirements. Based on the DevOps team has listed out the exact requirement to setup the cluster the same way. Fine below more details:

Create a namespace named node-namespace-nautilus.

Create a deployment named node-deployment-nautilus under this new namespace. Replica count should be 2, container should be named as node-container-nautilus, use gcr.io/kodekloud/centos-ssh-enabled:node image and container port should be 80.

Create a service named node-service-nautilus. Service type should be NodePort, target port should be 8080, port should be 80 and nodePort should be 30012.

Make sure all pods are in Running state after the deployment.

You can check the application page by clicking on + button on top left corner and clicking on Select port to view on Host 1, then enter your nodePort.

You can use any labels as per your choice.

Note: The kubectl on jump_host has been configured to work with the kubernetes cluster.

Please Note :-  Perform the below commands based on your question server,  user name & other details that might differ. So please read the task carefully before executing it. All the Best 👍


Solution:  

1. At first  kubectl  utility configure and working from jump server, run below commands

    kubectl get namespace

    kubectl get pods


2. create a new namespace 

    kubectl create namespace node-namespace-nautilus



3.  Create a YAML  file with all the parameters, you can copy from GitLab

    https://gitlab.com/nb-tech-support/devops.git

    Refer Below Video for more clarity )


4.  Run the below command to create a pod

    kubectl create -f /tmp/node.yaml



5.  Wait for  deployment & pods to get running status

        kubectl get deploy -n node-namespace-nautilus

        kubectl get pods -n node-namespace-nautilus


6.  Click on Finish & Confirm to complete the task successful

Happy Learning!!!!


Apart from this if you need more clarity,  I have made a  tutorial video on this , 

please go through and share your comments. Like and share the knowledge



Post a Comment

0 Comments

Latest Posts

KodeKloud Kubernetes Security CKS  Lab Challenge 4 |  Audit-policy | Install & configure falco utility | Inspect the API server audit logs and identify the user