<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Priyanshu's Blog]]></title><description><![CDATA[Priyanshu's Blog]]></description><link>https://priyanshu2k3.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 18 Jun 2026 00:33:12 GMT</lastBuildDate><atom:link href="https://priyanshu2k3.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Important Command in kubectl]]></title><description><![CDATA[The create command in Kubernetes is used to create a resource from a file or stdin. For example, kubectl create -f pod.yaml will create a pod using the configuration specified in pod.yaml. The expose command takes a replication controller, service, d...]]></description><link>https://priyanshu2k3.hashnode.dev/important-command-in-kubectl</link><guid isPermaLink="true">https://priyanshu2k3.hashnode.dev/important-command-in-kubectl</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[kubectl]]></category><category><![CDATA[Cloud]]></category><category><![CDATA[Cloud Computing]]></category><dc:creator><![CDATA[PRIYANSHU PRASAD GUPTA]]></dc:creator><pubDate>Sun, 26 May 2024 18:00:17 GMT</pubDate><content:encoded><![CDATA[<p>The <code>create</code> command in Kubernetes is used to create a resource from a file or stdin. For example, <code>kubectl create -f pod.yaml</code> will create a pod using the configuration specified in <code>pod.yaml</code>. The <code>expose</code> command takes a replication controller, service, deployment, or pod and exposes it as a new Kubernetes service. For instance, <code>kubectl expose deployment my-deployment --type=LoadBalancer --name=my-service</code> will expose a deployment as a LoadBalancer service.</p>
<p>The <code>run</code> command lets you run a specific image on the cluster. By executing <code>kubectl run nginx --image=nginx</code>, you create a deployment running the NGINX image. The <code>set</code> command is used to set specific features on objects. For example, <code>kubectl set image deployment/my-deployment my-container=my-image:1.5.0</code> updates the image of a container in a deployment.</p>
<p>For intermediate commands, <code>explain</code> provides documentation for a resource. For instance, <code>kubectl explain pods</code> details the pods resource. The <code>get</code> command displays one or many resources. For example, <code>kubectl get pods</code> lists all pods in the current namespace. The <code>edit</code> command allows you to edit a resource on the server. For example, <code>kubectl edit deployment/my-deployment</code> opens the deployment configuration in an editor. The <code>delete</code> command removes resources. For example, <code>kubectl delete pod my-pod</code> deletes a specific pod.</p>
<p>Deployment-related commands include <code>rollout</code>, which manages the rollout of a resource. Using <code>kubectl rollout status deployment/my-deployment</code> shows the status of a deployment rollout. The <code>scale</code> command sets a new size for a deployment, replica set, or replication controller. For example, <code>kubectl scale deployment/my-deployment --replicas=3</code> scales a deployment to three replicas. The <code>autoscale</code> command automatically scales a deployment. For example, <code>kubectl autoscale deployment/my-deployment --min=2 --max=5 --cpu-percent=80</code> sets autoscaling parameters based on CPU usage.</p>
<p>Cluster management commands help manage and retrieve cluster information. The <code>certificate</code> command modifies certificate resources, such as with <code>kubectl certificate approve my-cert</code>. The <code>cluster-info</code> command displays cluster information, simply using <code>kubectl cluster-info</code>. To display resource usage, <code>kubectl top nodes</code> shows CPU and memory usage for nodes. The <code>cordon</code> command marks a node as unschedulable with <code>kubectl cordon my-node</code>, while <code>kubectl uncordon my-node</code> makes it schedulable again. The <code>drain</code> command prepares a node for maintenance, like <code>kubectl drain my-node --ignore-daemonsets</code>. The <code>taint</code> command updates the taints on nodes, as in <code>kubectl taint nodes my-node key=value:NoSchedule</code>.</p>
<p>For troubleshooting and debugging, <code>describe</code> shows details of specific resources, such as <code>kubectl describe pod my-pod</code>. The <code>logs</code> command prints the logs for a container in a pod; for example, <code>kubectl logs my-pod</code> retrieves logs from a pod. The <code>attach</code> command attaches to a running container, with <code>kubectl attach my-pod -c my-container</code> for a specific container. The <code>exec</code> command executes a command in a container, like <code>kubectl exec my-pod -- ls /app</code> to list directory contents. The <code>port-forward</code> command forwards local ports to a pod, such as <code>kubectl port-forward my-pod 8080:80</code>. The <code>proxy</code> command runs a proxy to the Kubernetes API server, simply using <code>kubectl proxy</code>. The <code>cp</code> command copies files and directories to and from containers, for example, <code>kubectl cp /local/path my-pod:/container/path</code>. The <code>auth</code> command inspects authorization, like <code>kubectl auth can-i create pods</code>. The <code>debug</code> command creates debugging sessions for troubleshooting workloads and nodes, for instance, <code>kubectl debug node/mynode -it --image=busybox</code>. The <code>events</code> command lists events, using <code>kubectl get events</code> to show recent events in the cluster.</p>
<p>Advanced commands include <code>diff</code>, which compares the live version against a would-be applied version, such as <code>kubectl diff -f my-deployment.yaml</code>. The <code>apply</code> command applies a configuration to a resource, with <code>kubectl apply -f my-deployment.yaml</code>. The <code>patch</code> command updates specific fields of a resource, like <code>kubectl patch deployment my-deployment -p '{"spec":{"replicas":2}}'</code>. The <code>replace</code> command replaces a resource, for example, <code>kubectl replace -f my-deployment.yaml</code>. The <code>wait</code> command waits for a specific condition, such as <code>kubectl wait --for=condition=available --timeout=60s deployment/my-deployment</code>. The <code>kustomize</code> command builds a kustomization target, using <code>kubectl kustomize ./my-directory</code>.</p>
<p>Settings commands include <code>label</code>, which updates the labels on a resource, like <code>kubectl label pods my-pod new-label=label-value</code>. The <code>annotate</code> command updates annotations, with <code>kubectl annotate pods my-pod description="my description"</code>. The <code>completion</code> command outputs shell completion code for the specified shell, for example, <code>kubectl completion bash</code>.</p>
<p>Other commands include <code>api-resources</code>, which prints supported API resources on the server with <code>kubectl api-resources</code>, and <code>api-versions</code>, which prints supported API versions using <code>kubectl api-versions</code>. The <code>config</code> command modifies kubeconfig files, such as with <code>kubectl config view</code>. The <code>plugin</code> command interacts with plugins, using <code>kubectl plugin list</code> to list available plugins. Lastly, the <code>version</code> command prints the client and server version information, like <code>kubectl version --short</code>.</p>
]]></content:encoded></item><item><title><![CDATA[Why persistent volumes are necessary?]]></title><description><![CDATA[The key points on why persistent volumes are necessary in containerized environments, presented as bullet points:

Data Persistence:

Containers are temporary by nature, meaning data is lost when containers stop or are deleted.

Persistent volumes en...]]></description><link>https://priyanshu2k3.hashnode.dev/why-persistent-volumes-are-necessary</link><guid isPermaLink="true">https://priyanshu2k3.hashnode.dev/why-persistent-volumes-are-necessary</guid><dc:creator><![CDATA[PRIYANSHU PRASAD GUPTA]]></dc:creator><pubDate>Sat, 25 May 2024 15:43:01 GMT</pubDate><content:encoded><![CDATA[<p>The key points on why persistent volumes are necessary in containerized environments, presented as bullet points:</p>
<ul>
<li><p><strong>Data Persistence</strong>:</p>
<ul>
<li><p>Containers are temporary by nature, meaning data is lost when containers stop or are deleted.</p>
</li>
<li><p>Persistent volumes ensure data persists beyond the lifecycle of individual containers.</p>
</li>
</ul>
</li>
<li><p><strong>Stateful Applications</strong>:</p>
<ul>
<li>Essential for applications that require maintaining state, such as databases, content management systems, and stateful applications.</li>
</ul>
</li>
<li><p><strong>Decoupling Storage and Compute</strong>:</p>
<ul>
<li><p>Allows storage to be managed independently of the container lifecycle.</p>
</li>
<li><p>Ensures data durability across container restarts and rescheduling.</p>
</li>
</ul>
</li>
<li><p><strong>Kubernetes Integration</strong>:</p>
<ul>
<li><p>Uses persistent volumes (PVs) and persistent volume claims (PVCs) to manage storage.</p>
</li>
<li><p>PVCs request storage, which is then bound to PVs, making storage available to containers as needed.</p>
</li>
</ul>
</li>
<li><p><strong>Data Availability and Consistency</strong>:</p>
<ul>
<li><p>Ensures data remains available and consistent across container restarts and rescheduling.</p>
</li>
<li><p>Prevents data loss and maintains data integrity.</p>
</li>
</ul>
</li>
<li><p><strong>Flexibility and Scalability</strong>:</p>
<ul>
<li><p>Enables data sharing among multiple containers, facilitating load balancing and distributed processing.</p>
</li>
<li><p>Supports various storage backends, including local storage, networked storage (NFS, iSCSI), and cloud storage services (AWS EBS, Google Persistent Disk).</p>
</li>
</ul>
</li>
<li><p><strong>Existing Infrastructure Integration</strong>:</p>
<ul>
<li><p>Leverages existing storage infrastructure.</p>
</li>
<li><p>Seamlessly integrates with cloud-native storage solutions.</p>
</li>
</ul>
</li>
</ul>
<ul>
<li><p><strong>Reliability for Complex Applications</strong>:</p>
<ul>
<li>Provides a stable and reliable storage solution for running complex, stateful applications in a distributed environment.</li>
</ul>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[How to attach 🔗docker volume🐋🐋🐋]]></title><description><![CDATA[Attaching a volume to docker. how you can attach a volume to a Docker container:

Create a Volume: Before attaching a volume, you need to create the volume. You can create a volume using the following command

docker volume create name //name can be ...]]></description><link>https://priyanshu2k3.hashnode.dev/how-to-attach-docker-volume</link><guid isPermaLink="true">https://priyanshu2k3.hashnode.dev/how-to-attach-docker-volume</guid><category><![CDATA[Docker]]></category><category><![CDATA[volume]]></category><dc:creator><![CDATA[PRIYANSHU PRASAD GUPTA]]></dc:creator><pubDate>Tue, 29 Aug 2023 16:15:54 GMT</pubDate><content:encoded><![CDATA[<p>Attaching a volume to docker. how you can attach a volume to a Docker container:</p>
<ol>
<li>Create a Volume: Before attaching a volume, you need to create the volume. You can create a volume using the following command</li>
</ol>
<p><mark>docker volume create name</mark> //name can be anythin of the file where we want to write just like the folder name</p>
<p><a target="_blank" href="http://2.To">2.To</a> attach a volume to a Docker container, we can use the <code>-v</code> or <code>--volume</code> option when running the container.</p>
<p><mark>docker run -d -v VOLUME_NAME:/path/in/container</mark> //here -d is detached mode, -v volume ,VOLUME_NAME is the name of the data that we created in previous command,: for attaching with,next is path inside the container</p>
]]></content:encoded></item></channel></rss>