DevOps Classroom notes 05/Oct/2026

Pods:

  • pods are the small deployment unit in k8s (which will run the container in k8s)

keypoints:

  • A pod is the atomic unit in k8s cluster
  • Every pod will have its own ipaddress
  • contained having some shared componets
    • networking
    • shared storage
  • every container having its bown cpu, memory.

method to deploy pod in k8s cluster

  1. imperative method
kubectl run  nginx --image=nginx  --restart=Never 
  1. Declerative method
apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - name: nginx
    image: nginx:1.14.2
    ports:
    - containerPort: 80
  restartPolicy: Always

Access pod from locally

kubectl port-forward <resource-type>/<name> [local-port]:<remote-port>
kubectl port-forward pod/nginx-app 80:80

K8s api referances

  1. step 1 need chose type resource creating
  2. api version resource
  3. kind (type of api version resource name)

Sample for pod manfest

  1. apiVersion string APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
  2. kind string Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
  3. metadata ObjectMeta Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  4. spec PodSpec Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  5. status PodStatus Most recently observed status of the pod. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
apiVersion:
kind:
metadata:
spec:
status:

Task

  1. setup k8s cluster
  2. deploy sample pod and access port-farward cmd
  3. Try deploy deployment yaml file
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
kubectl apply -f sample.yaml
kubectl delete pods --all 

Refer here for deployment

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%