Create Pods in Kubernetes Cluster Kodekloud

 

Question: The Nautilus DevOps team has started practicing some pods and services deployment on Kubernetes platform as they are planning to migrate most of their applications on Kubernetes platform. Recently one of the team members has been assigned a task to create a pod as per details mentioned below:

    Create a pod named pod-nginx using nginx image with latest tag only and remember to mention the tag i.e nginx:latest.

    Labels app should be set to nginx_app, also container should be named as nginx-container.

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

Solution:

Create the pod.yaml according to question

vi pod.yaml

apiVersion: v1
kind: Pod
metadata:
name: pod-nginx
labels:
app: nginx_app
spec:
containers:
- name: nginx-container
image: nginx:latest

Then run 

kubectl apply -f pod.yaml


Download Coding Interview Book and Get More Tutorials for Coding and Interview Solution: Click Here

Download System Design Interview Book and Get More Tutorials and Interview Solution: Click Here

Do you need more Guidance or Help? Then Book 1:1 Quick Call with Me: Click Here

Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment