<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dechen Tshering</title>
    <description>The latest articles on DEV Community by Dechen Tshering (@dechen_tshering_3577).</description>
    <link>https://dev.to/dechen_tshering_3577</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3023525%2Fe9273685-10c6-4d47-acff-62c2c9ca4037.jpeg</url>
      <title>DEV Community: Dechen Tshering</title>
      <link>https://dev.to/dechen_tshering_3577</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dechen_tshering_3577"/>
    <language>en</language>
    <item>
      <title>🚀 Understanding Kubernetes Services: ClusterIP, NodePort, LoadBalancer + Manual Scheduling</title>
      <dc:creator>Dechen Tshering</dc:creator>
      <pubDate>Sun, 04 May 2025 16:04:00 +0000</pubDate>
      <link>https://dev.to/dechen_tshering_3577/understanding-kubernetes-services-clusterip-nodeport-loadbalancer-manual-scheduling-3pf2</link>
      <guid>https://dev.to/dechen_tshering_3577/understanding-kubernetes-services-clusterip-nodeport-loadbalancer-manual-scheduling-3pf2</guid>
      <description>&lt;p&gt;Hey everyone! 👋&lt;br&gt;
As part of my DevOps learning in public, I’ve been diving deep into Kubernetes and exploring how Services work—particularly how to expose applications inside and outside the cluster using different service types.&lt;/p&gt;

&lt;p&gt;In this blog, I’ll walk you through my experiments using ClusterIP, NodePort, and LoadBalancer, along with a quick intro to manual pod scheduling on specific nodes.&lt;/p&gt;

&lt;p&gt;Let’s go! 🚀&lt;/p&gt;
&lt;h2&gt;
  
  
  ⚙️ Step 1: Create a ReplicaSet
&lt;/h2&gt;

&lt;p&gt;First, I created a simple ReplicaSet using the following YAML:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# myapp.yml
apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: webapp
spec:
  replicas: 5
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
      - name: mycontainer
        image: nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Apply it:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f myapp.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Demo 1: ClusterIP
&lt;/h2&gt;

&lt;p&gt;ClusterIP is the default service type and is only accessible within the cluster.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# cip.yml
apiVersion: v1
kind: Service
metadata:
  name: mysvc
spec:
  type: ClusterIP
  ports:
  - targetPort: 80     # container port
    port: 5000         # service port
  selector:
    app: web
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Or expose it using the CLI:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl expose rs webapp --target-port=80 --port=5000 --name=mysvc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Access It:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Get the service IP:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get svc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Get any node name:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get nodes -o wide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start a debug pod on that node:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl debug node/&amp;lt;NODE_NAME&amp;gt; -it --image=nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Inside the pod:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt-get update -y &amp;amp;&amp;amp; apt-get install curl -y
curl &amp;lt;SERVICE_IP&amp;gt;:5000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Demo 2: NodePort
&lt;/h2&gt;

&lt;p&gt;NodePort allows you to access your service externally on a static port on any worker node.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# nodeport.yml
apiVersion: v1
kind: Service
metadata:
  name: web-node-port
spec:
  type: NodePort
  ports:
  - targetPort: 80
    port: 80
    nodePort: 30002
  selector:
    app: web
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Or use:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl expose rs webapp --target-port=80 --port=80 --type=NodePort
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Access It:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Get the node IP:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get nodes -o wide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Curl from a debug pod:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl &amp;lt;NODE_IP&amp;gt;:30002
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Demo 3: LoadBalancer
&lt;/h2&gt;

&lt;p&gt;LoadBalancer is commonly used in cloud environments to expose services publicly using an external IP.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# lb.yml
apiVersion: v1
kind: Service
metadata:
  name: mysvc
spec:
  type: LoadBalancer
  ports:
  - targetPort: 80
    port: 80
  selector:
    app: web
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Or via CLI:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl expose rs webapp --target-port=80 --port=80 --type=LoadBalancer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Access It:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get svc
# Use the external IP shown to access your app in the browser

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Note: This works on cloud providers like GCP, AWS, or Azure. On Minikube or bare metal, you may need MetalLB or another load balancer.&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: Manual Scheduling
&lt;/h2&gt;

&lt;p&gt;I also tried manually scheduling a pod to a specific node. This can be helpful when testing specific node configurations or behavior.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# pod.yml
apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
spec:
  containers:
  - name: nginx-container
    image: nginx
  nodeName: &amp;lt;NODE_NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Just replace  with a real node name from:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get nodes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Apply it:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f pod.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Learnings
&lt;/h2&gt;

&lt;p&gt;_&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ClusterIP: Great for internal communication between services.&lt;/li&gt;
&lt;li&gt;NodePort: Exposes apps on every node's IP at a static port.&lt;/li&gt;
&lt;li&gt;LoadBalancer: Best for public access when running on cloud providers.&lt;/li&gt;
&lt;li&gt;Manual scheduling gives control, but use it with caution in production.
_&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're also learning Kubernetes, let’s connect and grow together! 🌱&lt;br&gt;
Drop a comment if this was helpful or if you’ve got tips of your own 🙌&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>container</category>
      <category>yaml</category>
      <category>kubernetesservices</category>
    </item>
    <item>
      <title>Learning Kubernetes: ReplicationController vs ReplicaSet</title>
      <dc:creator>Dechen Tshering</dc:creator>
      <pubDate>Sun, 27 Apr 2025 19:14:17 +0000</pubDate>
      <link>https://dev.to/dechen_tshering_3577/learning-kubernetes-replicationcontroller-vs-replicaset-2dl7</link>
      <guid>https://dev.to/dechen_tshering_3577/learning-kubernetes-replicationcontroller-vs-replicaset-2dl7</guid>
      <description>&lt;p&gt;As I dive deeper into Kubernetes, I’ve been exploring the concepts of ReplicationControllers and ReplicaSets—two core constructs used to ensure high availability and scalability of pods in a Kubernetes cluster.&lt;/p&gt;

&lt;p&gt;In this post, I’ll share what I learned, along with sample YAML definitions and key commands. Hopefully, it helps anyone else navigating this space too!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a ReplicationController?
&lt;/h2&gt;

&lt;p&gt;A ReplicationController (RC) ensures that a specified number of pod replicas are running at any given time. While it’s considered a bit old-school now (ReplicaSet and Deployments have largely replaced it), it’s still a fundamental concept worth understanding.&lt;/p&gt;

&lt;h3&gt;
  
  
  Here’s a sample YAML to create a ReplicationController:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: v1
kind: ReplicationController
metadata: 
  name: myrc
spec: 
  replicas: 5
  template:
    metadata:
      labels: 
        app: web
    spec:
      containers:
      - name: c1
        image: nginx

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Basic ReplicationController Commands
&lt;/h3&gt;

&lt;h4&gt;
  
  
  List all RCs:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get rc or kubectl get replicationcontroller
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Delete an RC:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl delete rc &amp;lt;rc-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Scale the RC:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl scale --replicas=&amp;lt;number&amp;gt; rc/&amp;lt;rc-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is ReplicaSet?
&lt;/h2&gt;

&lt;p&gt;A ReplicaSet (RS) is the next-gen version of RC, introduced with better support for label selectors, including set-based ones. It ensures that a specified number of pod replicas are maintained and is mostly used under the hood by Deployments.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 1: Equality-Based Selector:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: mywebapp
spec:
  replicas: 5
  selector:
    matchLabels: 
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
      - name: c1
        image: nginx

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example 2: Set-Based Selector:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: apps/v1
kind: ReplicaSet
metadata: 
  name: webdata
spec:
  replicas: 4
  selector:
    matchExpressions:
    - key: app
      operator: In
      values:
        - nginx
        - web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
      - name: c1
        image: nginx

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Basic Replica Set Commands:
&lt;/h3&gt;

&lt;h4&gt;
  
  
  List all ReplicaSets
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get rs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows all the ReplicaSets in your current namespace.&lt;/p&gt;

&lt;h4&gt;
  
  
  Describe a ReplicaSet
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe rs &amp;lt;replicaset-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Provides detailed information including events, pod template, and selector.&lt;/p&gt;

&lt;h4&gt;
  
  
  Delete a ReplicaSet
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl delete rs &amp;lt;replicaset-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deletes the ReplicaSet&lt;/p&gt;

&lt;h4&gt;
  
  
  Scale a ReplicaSet
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl scale rs/&amp;lt;replicaset-name&amp;gt; --replicas=3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adjusts the number of desired pod replicas.&lt;/p&gt;

&lt;h4&gt;
  
  
  Edit a ReplicaSet
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl edit rs &amp;lt;replicaset-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Opens the ReplicaSet manifest in your default editor so you can make changes on the fly.&lt;/p&gt;

&lt;h4&gt;
  
  
  Apply from a YAML file
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f webrs.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creates or updates a ReplicaSet from a manifest file.&lt;/p&gt;

&lt;h4&gt;
  
  
  View pods managed by a ReplicaSet
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods -l app=web
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use label selectors to filter pods created by the ReplicaSet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key difference between ReplicationController and ReplicaSet:
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;ReplicationController (RC)&lt;/th&gt;
&lt;th&gt;ReplicaSet (RS)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;API Version&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;v1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;apps/v1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Label Selector Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Equality-based only&lt;/td&gt;
&lt;td&gt;Equality &amp;amp; set-based&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Legacy / older systems&lt;/td&gt;
&lt;td&gt;Modern replacement for RC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Used by Deployment&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Flexibility&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Less flexible&lt;/td&gt;
&lt;td&gt;More flexible&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Community Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Deprecated&lt;/td&gt;
&lt;td&gt;Actively supported&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;After getting comfortable with Replication Controllers and Replica Sets, I’ve realized they’re just the beginning. Now, I’m excited to dive into Deployments—the real game-changer for managing apps in Kubernetes!&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>yaml</category>
      <category>replicaset</category>
    </item>
    <item>
      <title>🚀 Kubernetes Pod Commands &amp; YAML Guide – Quick Reference for Devs &amp; DevOps</title>
      <dc:creator>Dechen Tshering</dc:creator>
      <pubDate>Sun, 27 Apr 2025 18:19:14 +0000</pubDate>
      <link>https://dev.to/dechen_tshering_3577/kubernetes-pod-commands-yaml-guide-quick-reference-for-devs-devops-4ld</link>
      <guid>https://dev.to/dechen_tshering_3577/kubernetes-pod-commands-yaml-guide-quick-reference-for-devs-devops-4ld</guid>
      <description>&lt;p&gt;Whether you're new to Kubernetes or want a clean reference sheet, here’s a quick guide to working with Kubernetes Pods using the CLI and YAML definitions.&lt;br&gt;
This post includes essential commands, how to access pods and containers and how to create pods using YAML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Essential kubectl Commands for Pods.&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Create a pod
&lt;/h1&gt;

&lt;p&gt;kubectl run  --image=&lt;/p&gt;

&lt;h1&gt;
  
  
  List all pods
&lt;/h1&gt;

&lt;p&gt;kubectl get pods&lt;/p&gt;

&lt;h1&gt;
  
  
  List pods with extended details (IP address, node, etc.)
&lt;/h1&gt;

&lt;p&gt;kubectl get pods -o wide&lt;/p&gt;

&lt;h1&gt;
  
  
  Access a running pod shell
&lt;/h1&gt;

&lt;p&gt;kubectl exec -it  -- bash&lt;/p&gt;

&lt;h1&gt;
  
  
  Access a specific container inside a multi-container pod
&lt;/h1&gt;

&lt;p&gt;kubectl exec -it  -c  -- bash&lt;/p&gt;

&lt;h1&gt;
  
  
  Describe pod details
&lt;/h1&gt;

&lt;p&gt;kubectl describe pod &lt;/p&gt;

&lt;h1&gt;
  
  
  Get detailed node information (container runtime, etc.)
&lt;/h1&gt;

&lt;p&gt;kubectl get nodes -o wide&lt;/p&gt;

&lt;h1&gt;
  
  
  Delete a pod
&lt;/h1&gt;

&lt;p&gt;kubectl delete pod &lt;/p&gt;

&lt;p&gt;** Create a Pod Using YAML**&lt;/p&gt;

&lt;h1&gt;
  
  
  vim pod.yaml
&lt;/h1&gt;

&lt;p&gt;apiVersion: v1&lt;br&gt;
kind: Pod&lt;br&gt;
metadata:&lt;br&gt;
  name: abc&lt;br&gt;
spec:&lt;br&gt;
  containers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;name: c1
image: nginx&lt;/li&gt;
&lt;li&gt;name: c2
image: redis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Commands:&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Create resources from YAML
&lt;/h1&gt;

&lt;p&gt;kubectl create -f pod.yaml&lt;/p&gt;

&lt;h1&gt;
  
  
  Delete resources from YAML
&lt;/h1&gt;

&lt;p&gt;kubectl delete -f pod.yaml&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Access Shell Inside Pod/Container&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Access the shell of a pod
&lt;/h1&gt;

&lt;p&gt;kubectl exec -it  -- sh&lt;/p&gt;

&lt;h1&gt;
  
  
  Access a specific container in a pod
&lt;/h1&gt;

&lt;p&gt;kubectl exec -it  -c  -- sh&lt;/p&gt;

&lt;p&gt;If this helped you or you'd like to keep a quick reference around, feel free to bookmark or share this post! 🚀&lt;br&gt;
Let’s keep growing together in the world of Cloud Native, Kubernetes, and DevOps.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>container</category>
      <category>yaml</category>
    </item>
    <item>
      <title>My Kubernetes Learning Notes: Image Pull Policy, Labels &amp; Selectors</title>
      <dc:creator>Dechen Tshering</dc:creator>
      <pubDate>Sun, 20 Apr 2025 15:18:41 +0000</pubDate>
      <link>https://dev.to/dechen_tshering_3577/my-kubernetes-learning-notes-image-pull-policy-labels-selectors-2agh</link>
      <guid>https://dev.to/dechen_tshering_3577/my-kubernetes-learning-notes-image-pull-policy-labels-selectors-2agh</guid>
      <description>&lt;p&gt;Hey folks!&lt;br&gt;
As I continue learning Kubernetes, I’ve been digging into some foundational concepts that I think are super important to understand early on — Image Pull Policies, Labels, and Selectors.&lt;br&gt;
Thought I'd share what I’ve learned so far in case it helps anyone else on the same path!&lt;/p&gt;

&lt;h2&gt;
  
  
  Image Pull Policy in Kubernetes
&lt;/h2&gt;

&lt;p&gt;There are three options:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;h4&gt;
  
  
  Always
&lt;/h4&gt;

&lt;p&gt;This will always pull the image from the container registry (like Docker Hub), no matter what. It’s great if you're constantly updating the image and want to make sure the latest version is always used.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;
  
  
  IfNotPresent
&lt;/h4&gt;

&lt;p&gt;This will only pull the image if it’s not already available locally on the node. It seems to be the default for tagged images, and it is super useful when you’re trying to avoid unnecessary pulls.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h4&gt;
  
  
  Never
&lt;/h4&gt;

&lt;p&gt;This one won’t pull the image at all. Kubernetes just uses whatever is already there on the node. It’s probably best for air-gapped or strictly controlled environments.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Example of how I used it in a YAML file:
&lt;/h4&gt;

&lt;pre&gt;&lt;code&gt;
apiVersion: v1
kind: Pod
metadata:
  name: abc
spec:
  containers:
  - name: nginx-pod
    image: nginx
    &lt;span&gt;imagePullPolicy: IfNotPresent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;
  
  
  Labels in Kubernetes
&lt;/h2&gt;

&lt;p&gt;Labels are basically key-value pairs that we can attach to pods (or other Kubernetes objects). They’re really helpful for organizing, filtering, and managing resources.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
  &lt;span&gt;labels:&lt;/span&gt;
  &lt;span&gt;  department: hr&lt;/span&gt;
spec:
  containers:
  - name: nginx-container
    image: nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;
  
  
  Some commands I learned:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods --show-labels       # Show labels for all pods
kubectl label pod &amp;lt;pod-name&amp;gt; &amp;lt;key&amp;gt;=&amp;lt;value&amp;gt;  # Add a new label
kubectl label pod &amp;lt;pod-name&amp;gt; &amp;lt;key&amp;gt;-         # Remove a label
kubectl label --overwrite pod &amp;lt;pod-name&amp;gt; &amp;lt;key&amp;gt;=&amp;lt;value&amp;gt; # Overwrite an existing label
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Label Selectors — Equality &amp;amp; Set Based
&lt;/h2&gt;

&lt;p&gt;Selectors let you filter pods based on their labels, which is super handy when you have a lot of resources.&lt;/p&gt;

&lt;h4&gt;
  
  
  Equality-Based Selectors
&lt;/h4&gt;

&lt;p&gt;These use = and != to match specific key/value pairs.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
kubectl get pods --&lt;span&gt;selector&lt;/span&gt; department=it   # Only pods with department=it
kubectl get pods --&lt;span&gt;selector department!=it&lt;/span&gt;  # All pods except department=it
kubectl get pods -l department=hr           # Another way to filter by label
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;
  
  
  Set-Based Selectors
&lt;/h4&gt;

&lt;p&gt;These are used when you want to filter by multiple values.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;

kubectl get pods --&lt;span&gt;selector 'department in (hr,prod)'&lt;/span&gt;   # Pods with department=hr or department=prod

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;These might seem like small details at first, but I'm starting to realize how powerful they are when managing pods and organizing deployments at scale.&lt;/p&gt;

&lt;p&gt;Still lots to learn, but this felt like a good checkpoint to share what I’ve picked up&lt;/p&gt;

&lt;p&gt;If you're also learning Kubernetes, I would love to hear what helped you wrap your head around these topics! Drop tips or corrections if I missed anything!&lt;/p&gt;

&lt;p&gt;If you're also learning Kubernetes, I would love to hear what helped you wrap your head around these topics! Drop tips or corrections if I missed anything!&lt;br&gt;
Feel free to connect: &lt;br&gt;
Hashnode - &lt;a href="https://hashnode.com/@dechen-tshering-3577" rel="noopener noreferrer"&gt;https://hashnode.com/@dechen-tshering-3577&lt;/a&gt;&lt;br&gt;
LinkedIn - &lt;a href="https://rb.gy/7w546x" rel="noopener noreferrer"&gt;https://rb.gy/7w546x&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’ll be posting more as I go!&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>yaml</category>
      <category>containers</category>
    </item>
    <item>
      <title>🚀 Kubernetes Pod Commands &amp; YAML Guide – Quick Reference for Devs &amp; DevOps</title>
      <dc:creator>Dechen Tshering</dc:creator>
      <pubDate>Sun, 13 Apr 2025 18:20:16 +0000</pubDate>
      <link>https://dev.to/dechen_tshering_3577/kubernetes-pod-commands-yaml-guide-quick-reference-for-devs-devops-3005</link>
      <guid>https://dev.to/dechen_tshering_3577/kubernetes-pod-commands-yaml-guide-quick-reference-for-devs-devops-3005</guid>
      <description>&lt;p&gt;Whether you're new to Kubernetes or want a clean reference sheet, here’s a quick guide to working with Kubernetes Pods using the CLI and YAML definitions.&lt;br&gt;
This post includes essential commands, how to access pods and containers and how to create pods using YAML.&lt;/p&gt;
&lt;h2&gt;
  
  
  Essential kubectl Commands for Pods.
&lt;/h2&gt;

&lt;p&gt;Create a pod&lt;br&gt;
&lt;code&gt;kubectl run &amp;lt;pod-name&amp;gt; --image=&amp;lt;image-name&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
List all pods&lt;br&gt;
&lt;code&gt;kubectl get pods&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
List pods with extended details (IP address, node, etc.)&lt;br&gt;
&lt;code&gt;kubectl get pods -o wide&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Access a running pod shell&lt;br&gt;
&lt;code&gt;kubectl exec -it &amp;lt;pod-name&amp;gt; -- bash&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Access a specific container inside a multi-container pod&lt;br&gt;
&lt;code&gt;kubectl exec -it &amp;lt;pod-name&amp;gt; -c &amp;lt;container-name&amp;gt; -- bash&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Describe pod details&lt;br&gt;
&lt;code&gt;kubectl describe pod &amp;lt;pod-name&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Get detailed node information (container runtime, etc.)&lt;br&gt;
&lt;code&gt;kubectl get nodes -o wide&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Delete a pod&lt;br&gt;
&lt;code&gt;kubectl delete pod &amp;lt;pod-name&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Create a Pod Using YAML
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;vim pod.yaml&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: v1
kind: Pod
metadata:
  name: abc
spec:
  containers:
  - name: c1
    image: nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Commands:
&lt;/h2&gt;

&lt;p&gt;Create resources from YAML&lt;br&gt;
&lt;code&gt;kubectl create -f pod.yaml&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Delete resources from YAML&lt;br&gt;
&lt;code&gt;kubectl delete -f pod.yaml&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Access Shell Inside Pod/Container
&lt;/h2&gt;

&lt;p&gt;Access the shell of a pod&lt;br&gt;
&lt;code&gt;kubectl exec -it &amp;lt;pod-name&amp;gt; -- sh&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Access a specific container in a pod&lt;br&gt;
&lt;code&gt;kubectl exec -it &amp;lt;pod-name&amp;gt; -c &amp;lt;container-name&amp;gt; -- sh&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If this helped you or you'd like to keep a quick reference around, feel free to bookmark or share this post! 🚀&lt;br&gt;
Let’s keep growing together in the world of Cloud Native, Kubernetes, and DevOps.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>container</category>
      <category>yaml</category>
    </item>
    <item>
      <title>🚀 My DevOps Learning Journey – Key Linux Commands 🚀</title>
      <dc:creator>Dechen Tshering</dc:creator>
      <pubDate>Sun, 06 Apr 2025 18:57:55 +0000</pubDate>
      <link>https://dev.to/dechen_tshering_3577/my-devops-learning-journey-key-linux-commands-19le</link>
      <guid>https://dev.to/dechen_tshering_3577/my-devops-learning-journey-key-linux-commands-19le</guid>
      <description>&lt;p&gt;As I continue my DevOps journey, I’ve been diving into Linux system administration, which is essential for managing infrastructure, automating tasks, and streamlining processes. Here’s a snapshot of some key Linux commands I’ve been mastering that are crucial for any DevOps role:&lt;/p&gt;

&lt;p&gt;🔹 File Management&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo: Print text to the screen
ls: List files and folders
cd &amp;lt;dir_name&amp;gt;: Change directory
mkdir &amp;lt;new_directory&amp;gt;: Create a new directory
rm -r &amp;lt;dir&amp;gt;: Remove a directory and its contents
cp -r &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;: Copy a directory and its contents
mv &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;: Rename or move files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;🔹 User Management&lt;br&gt;
    whoami: Show the current user&lt;br&gt;
    id: Get user and group info&lt;br&gt;
    su : Switch user&lt;br&gt;
    sudo : Execute a command with root privileges&lt;/p&gt;

&lt;p&gt;🔹 Download Files&lt;br&gt;
    curl  -O: Download files using curl&lt;br&gt;
    wget  -O : Download files using wget&lt;/p&gt;

&lt;p&gt;🔹 OS Version Check&lt;br&gt;
    cat /etc/&lt;em&gt;release&lt;/em&gt;: Check the OS version&lt;/p&gt;

&lt;p&gt;🔹 Package Management (RPM/YUM)&lt;br&gt;
    rpm -i : Install a package&lt;br&gt;
    yum install : Install a package using YUM&lt;br&gt;
    yum remove : Uninstall a package&lt;/p&gt;

&lt;p&gt;🔹 Service Management&lt;br&gt;
    systemctl start : Start a service&lt;br&gt;
    systemctl stop : Stop a service&lt;br&gt;
    systemctl enable : Enable a service at startup&lt;br&gt;
    systemctl status : Check service status&lt;/p&gt;

&lt;p&gt;These are just a few of the core Linux commands I’ve been mastering to effectively manage systems in a DevOps environment. I’m excited to continue this journey, explore more tools, and learn new technologies along the way!&lt;/p&gt;

&lt;p&gt;Special thanks to @savinderpuri for sharing valuable insights and inspiring me throughout this process! 🙏&lt;/p&gt;

</description>
      <category>devops</category>
      <category>linux</category>
      <category>techgrowth</category>
      <category>learningjourney</category>
    </item>
    <item>
      <title>🚀 Kicking Off My DevOps BootCamp – First Stop: Linux Basics! 🐧</title>
      <dc:creator>Dechen Tshering</dc:creator>
      <pubDate>Sun, 06 Apr 2025 18:52:19 +0000</pubDate>
      <link>https://dev.to/dechen_tshering_3577/kicking-off-my-devops-bootcamp-first-stop-linux-basics-4go0</link>
      <guid>https://dev.to/dechen_tshering_3577/kicking-off-my-devops-bootcamp-first-stop-linux-basics-4go0</guid>
      <description>&lt;p&gt;Last week marked the start of my DevOps BootCamp, and I’m super excited to dive into the essential skills needed to thrive in this fast-paced field.&lt;/p&gt;

&lt;p&gt;First up: Linux Basics! Since Linux is the backbone of DevOps, I’m focusing on sharpening my command-line skills, mastering file systems, permissions, scripting, and much more. Whether it’s automating tasks or managing servers, a solid foundation in Linux is crucial for any DevOps professional.&lt;/p&gt;

&lt;p&gt;I can’t wait to share my progress and key insights along the way. If you’ve been through a similar journey or have any tips to share, I’d love to hear from you in the comments!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>linux</category>
      <category>techskills</category>
      <category>bootcamp</category>
    </item>
  </channel>
</rss>
