<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Subhash &#8211; Best DevOps</title>
	<atom:link href="https://www.bestdevops.com/author/subhash/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.bestdevops.com</link>
	<description>Lets Learn, Do it &#38; Share! Thats a Best DevOps!!!</description>
	<lastBuildDate>Wed, 18 Aug 2021 11:36:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>
	<item>
		<title>Assignment Day 3</title>
		<link>https://www.bestdevops.com/assignment-day-3/</link>
		
		<dc:creator><![CDATA[Subhash]]></dc:creator>
		<pubDate>Wed, 18 Aug 2021 11:36:20 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=19397</guid>

					<description><![CDATA[What is the architecture and components of Kubernetes? Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>What is the architecture and components of Kubernetes?</strong></p>



<p class="wp-block-paragraph">Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available.</p>



<p class="wp-block-paragraph">When you deploy Kubernetes, you get a cluster.</p>



<p class="wp-block-paragraph">A Kubernetes cluster consists of a set of worker machines, called&nbsp;nodes, that run containerized applications. Every cluster has at least one worker node.</p>



<p class="wp-block-paragraph">The worker node(s) host the&nbsp;Pods&nbsp;that are the components of the application workload. The control plane&nbsp;manages the worker nodes and the Pods in the cluster. In production environments, the control plane usually runs across multiple computers and a cluster usually runs multiple nodes, providing fault-tolerance and high availability.</p>



<p class="wp-block-paragraph">This document outlines the various components you need to have a complete and working Kubernetes cluster.</p>



<p class="wp-block-paragraph">Here&#8217;s the diagram of a Kubernetes cluster with all the components tied together.</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="943" height="436" src="http://www.bestdevops.com/wp-content/uploads/2021/08/K8-arch.png" alt="" class="wp-image-19399" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/K8-arch.png 943w, https://www.bestdevops.com/wp-content/uploads/2021/08/K8-arch-300x139.png 300w, https://www.bestdevops.com/wp-content/uploads/2021/08/K8-arch-768x355.png 768w" sizes="(max-width: 943px) 100vw, 943px" /></figure>



<h3 class="wp-block-heading"><strong>kube-apiserver</strong></h3>



<p class="wp-block-paragraph">The API server is a component of the Kubernetes&nbsp;<a href="https://kubernetes.io/docs/reference/glossary/?all=true#term-control-plane" target="_blank" rel="noreferrer noopener">control plane</a>&nbsp;that exposes the Kubernetes API. The API server is the front end for the Kubernetes control plane.</p>



<p class="wp-block-paragraph">The main implementation of a Kubernetes API server is&nbsp;<a href="https://kubernetes.io/docs/reference/generated/kube-apiserver/">kube-apiserver</a>. kube-apiserver is designed to scale horizontally—that is, it scales by deploying more instances. You can run several instances of kube-apiserver and balance traffic between those instances.</p>



<h3 class="wp-block-heading" id="etcd"><strong>etcd</strong></h3>



<p class="wp-block-paragraph">Consistent and highly-available key value store used as Kubernetes&#8217; backing store for all cluster data.</p>



<p class="wp-block-paragraph">If your Kubernetes cluster uses etcd as its backing store, make sure you have a&nbsp;<a href="https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/#backing-up-an-etcd-cluster">back up</a>&nbsp;plan for those data.</p>



<p class="wp-block-paragraph">You can find in-depth information about etcd in the official&nbsp;<a href="https://etcd.io/docs/">documentation</a>.</p>



<h3 class="wp-block-heading" id="kube-scheduler"><strong>kube-scheduler</strong></h3>



<p class="wp-block-paragraph">Control plane component that watches for newly created&nbsp;<a href="https://kubernetes.io/docs/concepts/workloads/pods/" target="_blank" rel="noreferrer noopener">Pods</a>&nbsp;with no assigned&nbsp;<a href="https://kubernetes.io/docs/concepts/architecture/nodes/" target="_blank" rel="noreferrer noopener">node</a>, and selects a node for them to run on.</p>



<p class="wp-block-paragraph">Factors taken into account for scheduling decisions include: individual and collective resource requirements, hardware/software/policy constraints, affinity and anti-affinity specifications, data locality, inter-workload interference, and deadlines.</p>



<h3 class="wp-block-heading" id="kube-controller-manager"><strong>kube-controller-manager</strong></h3>



<p class="wp-block-paragraph">Control plane component that runs&nbsp;<a href="https://kubernetes.io/docs/concepts/architecture/controller/" target="_blank" rel="noreferrer noopener">controller</a>&nbsp;processes.</p>



<p class="wp-block-paragraph">Logically, each&nbsp;<a href="https://kubernetes.io/docs/concepts/architecture/controller/" target="_blank" rel="noreferrer noopener">controller</a>&nbsp;is a separate process, but to reduce complexity, they are all compiled into a single binary and run in a single process.</p>



<p class="wp-block-paragraph">Some types of these controllers are:</p>



<ul class="wp-block-list"><li>Node controller: Responsible for noticing and responding when nodes go down.</li><li>Job controller: Watches for Job objects that represent one-off tasks, then creates Pods to run those tasks to completion.</li><li>Endpoints controller: Populates the Endpoints object (that is, joins Services &amp; Pods).</li><li>Service Account &amp; Token controllers: Create default accounts and API access tokens for new namespaces.</li></ul>



<h3 class="wp-block-heading" id="cloud-controller-manager"><strong>cloud-controller-manager</strong></h3>



<p class="wp-block-paragraph">A Kubernetes&nbsp;<a href="https://kubernetes.io/docs/reference/glossary/?all=true#term-control-plane" target="_blank" rel="noreferrer noopener">control plane</a>&nbsp;component that embeds cloud-specific control logic. The cloud controller manager lets you link your cluster into your cloud provider&#8217;s API, and separates out the components that interact with that cloud platform from components that only interact with your cluster.</p>



<p class="wp-block-paragraph">The cloud-controller-manager only runs controllers that are specific to your cloud provider. If you are running Kubernetes on your own premises, or in a learning environment inside your own PC, the cluster does not have a cloud controller manager.</p>



<p class="wp-block-paragraph">As with the kube-controller-manager, the cloud-controller-manager combines several logically independent control loops into a single binary that you run as a single process. You can scale horizontally (run more than one copy) to improve performance or to help tolerate failures.</p>



<p class="wp-block-paragraph">The following controllers can have cloud provider dependencies:</p>



<ul class="wp-block-list"><li>Node controller: For checking the cloud provider to determine if a node has been deleted in the cloud after it stops responding</li><li>Route controller: For setting up routes in the underlying cloud infrastructure</li><li>Service controller: For creating, updating and deleting cloud provider load balancers</li></ul>



<h2 class="wp-block-heading" id="node-components">Node Components</h2>



<p class="wp-block-paragraph">Node components run on every node, maintaining running pods and providing the Kubernetes runtime environment.</p>



<h3 class="wp-block-heading" id="kubelet"><strong>kubelet</strong></h3>



<p class="wp-block-paragraph">An agent that runs on each&nbsp;<a href="https://kubernetes.io/docs/concepts/architecture/nodes/" target="_blank" rel="noreferrer noopener">node</a>&nbsp;in the cluster. It makes sure that&nbsp;<a href="https://kubernetes.io/docs/concepts/containers/" target="_blank" rel="noreferrer noopener">containers</a>&nbsp;are running in a&nbsp;<a href="https://kubernetes.io/docs/concepts/workloads/pods/" target="_blank" rel="noreferrer noopener">Pod</a>.</p>



<p class="wp-block-paragraph">The kubelet takes a set of PodSpecs that are provided through various mechanisms and ensures that the containers described in those PodSpecs are running and healthy. The kubelet doesn&#8217;t manage containers which were not created by Kubernetes.</p>



<h3 class="wp-block-heading" id="kube-proxy"><strong>kube-proxy</strong></h3>



<p class="wp-block-paragraph">kube-proxy is a network proxy that runs on each&nbsp;<a href="https://kubernetes.io/docs/concepts/architecture/nodes/" target="_blank" rel="noreferrer noopener">node</a>&nbsp;in your cluster, implementing part of the Kubernetes&nbsp;<a href="https://kubernetes.io/docs/concepts/services-networking/service/" target="_blank" rel="noreferrer noopener">Service</a>&nbsp;concept.</p>



<p class="wp-block-paragraph"><a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/">kube-proxy</a>&nbsp;maintains network rules on nodes. These network rules allow network communication to your Pods from network sessions inside or outside of your cluster.</p>



<p class="wp-block-paragraph">kube-proxy uses the operating system packet filtering layer if there is one and it&#8217;s available. Otherwise, kube-proxy forwards the traffic itself.</p>



<h3 class="wp-block-heading" id="container-runtime"><strong>Container runtime</strong></h3>



<p class="wp-block-paragraph">The container runtime is the software that is responsible for running containers.</p>



<p class="wp-block-paragraph">Kubernetes supports several container runtimes:&nbsp;<a href="https://docs.docker.com/engine/" target="_blank" rel="noreferrer noopener">Docker</a>,&nbsp;<a href="https://containerd.io/docs/" target="_blank" rel="noreferrer noopener">containerd</a>,&nbsp;<a href="https://cri-o.io/#what-is-cri-o" target="_blank" rel="noreferrer noopener">CRI-O</a>, and any implementation of the&nbsp;<a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/container-runtime-interface.md">Kubernetes CRI (Container Runtime Interface)</a>.</p>



<h2 class="wp-block-heading" id="addons">Addons</h2>



<p class="wp-block-paragraph">Addons use Kubernetes resources (<a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset" target="_blank" rel="noreferrer noopener">DaemonSet</a>,&nbsp;<a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" target="_blank" rel="noreferrer noopener">Deployment</a>, etc) to implement cluster features. Because these are providing cluster-level features, namespaced resources for addons belong within the&nbsp;<code>kube-system</code>&nbsp;namespace.</p>



<p class="wp-block-paragraph">Selected addons are described below; for an extended list of available addons, please see&nbsp;<a href="https://kubernetes.io/docs/concepts/cluster-administration/addons/">Addons</a>.</p>



<h3 class="wp-block-heading" id="dns"><strong>DNS</strong></h3>



<p class="wp-block-paragraph">While the other addons are not strictly required, all Kubernetes clusters should have&nbsp;<a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/">cluster DNS</a>, as many examples rely on it.</p>



<p class="wp-block-paragraph">Cluster DNS is a DNS server, in addition to the other DNS server(s) in your environment, which serves DNS records for Kubernetes services.</p>



<p class="wp-block-paragraph">Containers started by Kubernetes automatically include this DNS server in their DNS searches.</p>



<h3 class="wp-block-heading" id="web-ui-dashboard"><strong>Web UI (Dashboard)</strong></h3>



<p class="wp-block-paragraph"><a href="https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/">Dashboard</a>&nbsp;is a general purpose, web-based UI for Kubernetes clusters. It allows users to manage and troubleshoot applications running in the cluster, as well as the cluster itself.</p>



<h3 class="wp-block-heading" id="container-resource-monitoring"><strong>Container Resource Monitoring</strong></h3>



<p class="wp-block-paragraph"><a href="https://kubernetes.io/docs/tasks/debug-application-cluster/resource-usage-monitoring/">Container Resource Monitoring</a>&nbsp;records generic time-series metrics about containers in a central database, and provides a UI for browsing that data.</p>



<h3 class="wp-block-heading" id="cluster-level-logging"><strong>Cluster-level Logging</strong></h3>



<p class="wp-block-paragraph">A&nbsp;<a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/">cluster-level logging</a>&nbsp;mechanism is responsible for saving container logs to a central log store with search/browsing interface.</p>



<p class="wp-block-paragraph"><strong>What is POD? define in 15 bullets points.</strong></p>



<p class="wp-block-paragraph"><strong>Pods</strong>&nbsp;are the smallest, most basic deployable objects in Kubernetes. A Pod represents a single instance of a running process in your cluster.</p>



<p class="wp-block-paragraph">Pods contain one or more&nbsp;<em>containers</em>, such as Docker containers. When a Pod runs multiple containers, the containers are managed as a single entity and share the Pod&#8217;s resources. Generally, running multiple containers in a single Pod is an advanced use case.</p>



<p class="wp-block-paragraph">Pods also contain shared networking and storage resources for their containers:</p>



<ul class="wp-block-list"><li><strong>Network:</strong>&nbsp;Pods are automatically assigned unique IP addresses. Pod containers share the same network namespace, including IP address and network ports. Containers in a Pod communicate with each other inside the Pod on&nbsp;<code>localhost</code>.</li><li><strong>Storage:</strong>&nbsp;Pods can specify a set of shared storage volumes that can be shared among the containers.</li></ul>



<p class="wp-block-paragraph">You can consider a Pod to be a self-contained, isolated &#8220;logical host&#8221; that contains the systemic needs of the application it serves.</p>



<p class="wp-block-paragraph">A Pod is meant to run a single instance of your application on your cluster. However, it is not recommended to create individual Pods directly. Instead, you generally create a set of identical Pods, called&nbsp;<em>replicas</em>, to run your application. Such a set of replicated Pods are created and managed by a&nbsp;<em>controller</em>, such as a Deployment. Controllers manage the lifecycle of their constituent Pods and can also perform&nbsp;<em>horizontal scaling</em>, changing the number of Pods as necessary.</p>



<p class="wp-block-paragraph">Although you might occasionally interact with Pods directly to debug, troubleshoot, or inspect them, it is highly recommended that you use a controller to manage your Pods.</p>



<p class="wp-block-paragraph">Pods run on&nbsp;<strong>nodes</strong>&nbsp;in your cluster. Once created, a Pod remains on its node until its process is complete, the Pod is deleted, the Pod is&nbsp;<strong>evicted</strong>&nbsp;from the node due to lack of resources, or the node fails. If a node fails, Pods on the node are automatically scheduled for deletion.</p>



<h2 class="wp-block-heading" id="pod_lifecycle">Pod lifecycle</h2>



<p class="wp-block-paragraph">Pods are ephemeral. They are not designed to run forever, and when a Pod is terminated it cannot be brought back. In general, Pods do not disappear until they are deleted by a user or by a controller.</p>



<p class="wp-block-paragraph">Pods do not &#8220;heal&#8221; or repair themselves. For example, if a Pod is scheduled on a node which later fails, the Pod is deleted. Similarly, if a Pod is evicted from a node for any reason, the Pod does not replace itself.</p>



<p class="wp-block-paragraph">Each Pod has a&nbsp;<code>PodStatus</code>&nbsp;API object, which is represented by a Pod&#8217;s&nbsp;<code>status</code>&nbsp;field. Pods publish their&nbsp;<em>phase</em>&nbsp;to the&nbsp;<code>status: phase</code>&nbsp;field. The phase of a Pod is a high-level summary of the Pod in its current state.</p>



<p class="wp-block-paragraph">When you run&nbsp;<a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get"><code>kubectl get pod</code></a>&nbsp;to inspect a Pod running on your cluster, a Pod can be in one of the following possible phases:</p>



<ul class="wp-block-list"><li><strong>Pending:</strong>&nbsp;Pod has been created and accepted by the cluster, but one or more of its containers are not yet running. This phase includes time spent being scheduled on a node and downloading images.</li><li><strong>Running:</strong>&nbsp;Pod has been bound to a node, and all of the containers have been created. At least one container is running, is in the process of starting, or is restarting.</li><li><strong>Succeeded:</strong>&nbsp;All containers in the Pod have terminated successfully. Terminated Pods do not restart.</li><li><strong>Failed:</strong>&nbsp;All containers in the Pod have terminated, and at least one container has terminated in failure. A container &#8220;fails&#8221; if it exits with a non-zero status.</li><li><strong>Unknown:</strong>&nbsp;The state of the Pod cannot be determined.</li></ul>



<p class="wp-block-paragraph">Additionally,&nbsp;<code>PodStatus</code>&nbsp;contains an array called&nbsp;<code>PodConditions</code>, which is represented in the Pod manifest as&nbsp;<code>conditions</code>. The field has a&nbsp;<code>type</code>&nbsp;and&nbsp;<code>status</code>&nbsp;field.&nbsp;<code>conditions</code>&nbsp;indicates more specifically the conditions within the Pod that are causing its current status.</p>



<p class="wp-block-paragraph">The&nbsp;<code>type</code>&nbsp;field can contain&nbsp;<code>PodScheduled</code>,&nbsp;<code>Ready</code>,&nbsp;<code>Initialized</code>, and&nbsp;<code>Unschedulable</code>. The&nbsp;<code>status</code>&nbsp;field corresponds with the&nbsp;<code>type</code>&nbsp;field, and can contain&nbsp;<code>True</code>,&nbsp;<code>False</code>, or&nbsp;<code>Unknown</code>.</p>



<p class="wp-block-paragraph"><strong>Note:</strong>&nbsp;You can run&nbsp;<code><strong>kubectl get pod [POD_NAME] -o yaml</strong></code>&nbsp;to view the Pod&#8217;s entire manifest, including the&nbsp;<code><strong>phase</strong></code>&nbsp;and&nbsp;<code><strong>conditions</strong></code>&nbsp;fields.</p>



<h2 class="wp-block-heading">Creating Pods</h2>



<p class="wp-block-paragraph">Because Pods are ephemeral, it is not necessary to create Pods directly. Similarly, because Pods cannot repair or replace themselves, it is not&nbsp;<em>recommended</em>&nbsp;to create Pods directly.</p>



<p class="wp-block-paragraph">Instead, you can use a&nbsp;<em>controller</em>, such as a Deployment, which creates and manages Pods for you. Controllers are also useful for rolling out updates, such as changing the version of an application running in a container, because the controller manages the whole update process for you.</p>



<h2 class="wp-block-heading" id="requests">Pod requests</h2>



<p class="wp-block-paragraph">When a Pod starts running, it&nbsp;<a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/">requests</a>&nbsp;an amount of CPU and memory. This helps Kubernetes schedule the Pod onto an appropriate node to run the workload. A Pod will not be scheduled onto a node that doesn&#8217;t have the resources to honor the Pod&#8217;s request. A request is the&nbsp;<em>minimum</em>&nbsp;amount of CPU or memory that Kubernetes guarantees to a Pod.</p>



<p class="wp-block-paragraph"><strong>Note:</strong>&nbsp;Pod requests differ from and work in conjunction with Pod&nbsp;<a href="https://cloud.google.com/kubernetes-engine/docs/concepts/pod#limits">limits</a>.</p>



<p class="wp-block-paragraph">You can configure the CPU and memory requests for a Pod, based on the resources your applications need. You can also specify requests for individual containers running in the Pod. Keep the following in mind:</p>



<ul class="wp-block-list"><li>The default request for CPU is 100m. This is too small for many applications, and is probably much smaller than the amount of CPU available on the node.</li><li>There is no default request for memory. A Pod with no default memory request could be scheduled onto a node without enough memory to run the Pod&#8217;s workloads.</li><li>Setting too small a value for CPU or memory requests could cause too many Pods or a suboptimal combination of Pods to be scheduled onto a given node and reduce performance.</li><li>Setting too large a value for CPU or memory requests could cause the Pod to be unschedulable and increase the cost of the cluster&#8217;s resources.</li><li>In addition to, or instead of, setting a Pod&#8217;s resources, you can specify resources for individual containers running in the Pod. If you only specify resources for the containers, the Pod&#8217;s requests are the sum of the requests specified for the containers. If you specify both, the sum of requests for all containers must not exceed the Pod requests.</li></ul>



<p class="wp-block-paragraph"><strong>It is strongly recommended that you configure requests for your Pods</strong>, based on the requirements of the actual workloads. For more information, see&nbsp;<a href="https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-resource-requests-and-limits">Kubernetes best practices: Resource requests and limits</a>&nbsp;on the Google Cloud blog.</p>



<h2 class="wp-block-heading" id="limits">Pod limits</h2>



<p class="wp-block-paragraph">By default, a Pod has no upper bound on the maximum amount of CPU or memory it can use on a node. You can set&nbsp;<a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/">limits</a>&nbsp;to control the amount of CPU or memory your Pod can use on a node. A limit is the&nbsp;<em>maximum</em>&nbsp;amount of CPU or memory that Kubernetes guarantees to a Pod.</p>



<p class="wp-block-paragraph">In addition to, or instead of, setting a Pod&#8217;s limits, you can specify limits for individual containers running in the Pod. If you only specify limits for the containers, the Pod&#8217;s limits are the sum of the limits specified for the containers. However, each container can only access resources up to its limit, so if you choose to specify the limits on containers only, you must specify limits for each container. If you specify both, the sum of limits for all containers must not exceed the Pod limit.</p>



<p class="wp-block-paragraph"><strong>Note:</strong>&nbsp;A limit must always be greater than or equal to a request for the same type of resource. If you attempt to set the limit below the request, the Pod&#8217;s container cannot run and an error is logged.</p>



<p class="wp-block-paragraph">Limits are not taken into consideration when scheduling Pods, but can prevent resource contention among Pods on the same node, and can prevent a Pod from causing system instability on the node by starving the underlying operating system of resources.</p>



<p class="wp-block-paragraph"><strong>Note:</strong>&nbsp;Pod limits differ from and work in conjunction with Pod&nbsp;<a href="https://cloud.google.com/kubernetes-engine/docs/concepts/pod#requests">requests</a>.</p>



<p class="wp-block-paragraph"><strong>It is strongly recommended that you configure limits for your Pods</strong>, based on the requirements of the actual workloads. For more information, refer to&nbsp;<a href="https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-resource-requests-and-limits">Kubernetes best practices: Resource requests and limits</a>&nbsp;on the Google Cloud blog.</p>



<h3 class="wp-block-heading" id="pod-templates">Pod templates</h3>



<p class="wp-block-paragraph">Controller objects, such as Deployments and StatefulSets, contain a&nbsp;<a href="https://v1-19.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#podtemplatespec-v1-core"><em>Pod template</em></a>&nbsp;field. Pod templates contain a&nbsp;<a href="https://v1-19.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#podspec-v1-core">Pod specification</a>&nbsp;which determines how each Pod should run, including which containers should be run within the Pods and which volumes the Pods should mount.</p>



<p class="wp-block-paragraph">Controller objects use Pod templates to create Pods and to manage their &#8220;desired state&#8221; within your cluster. When a Pod template is changed, all future Pods reflect the new template, but all existing Pods do not.</p>



<p class="wp-block-paragraph">For more information on how Pod Templates work, refer to&nbsp;<a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment">Creating a Deployment</a>&nbsp;in the Kubernetes documentation.</p>



<h2 class="wp-block-heading" id="controlling_which_nodes_a_pod_runs_on">Controlling which nodes a Pod runs on</h2>



<p class="wp-block-paragraph">By default, Pods run on nodes in the default&nbsp;<a href="https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools">node pool</a>&nbsp;for the cluster. You can configure the node pool a Pod selects explicitly or implicitly:</p>



<ul class="wp-block-list"><li>You can explicitly force a Pod to deploy to a specific node pool by&nbsp;<a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/">setting a nodeSelector</a>&nbsp;in the Pod manifest. This forces a Pod to run only on Nodes in that node pool.</li><li>You can&nbsp;<a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/">specify resource requests for the containers</a>&nbsp;you run. The Pod will only run on nodes that satisfy the resource requests. For instance, if the Pod definition includes a container that requires four CPUs, the Service will not select Pods running on Nodes with two CPUs.</li></ul>



<h2 class="wp-block-heading" id="pod_usage_patterns">Pod usage patterns</h2>



<p class="wp-block-paragraph">Pods can be used in two main ways:</p>



<ul class="wp-block-list"><li><strong>Pods that run a single container.</strong>&nbsp;The simplest and most common Pod pattern is a single container per pod, where the single container represents an entire application. In this case, you can think of a Pod as a wrapper.</li><li><strong>Pods that run multiple containers that need to work together.</strong>&nbsp;Pods with multiple containers are primarily used to support colocated, co-managed programs that need to share resources. These colocated containers might form a single cohesive unit of service—one container serving files from a shared volume while another container refreshes or updates those files. The Pod wraps these containers and storage resources together as a single manageable entity.</li></ul>



<p class="wp-block-paragraph">Each Pod is meant to run a single instance of a given application. If you want to run multiple instances, you should use one Pod for each instance of the application. This is generally referred to as&nbsp;<em>replication</em>. Replicated Pods are created and managed as a group by a controller, such as a Deployment.</p>



<h2 class="wp-block-heading" id="pod_termination">Pod termination</h2>



<p class="wp-block-paragraph">Pods terminate gracefully when their processes are complete. Kubernetes imposes a default graceful termination period of 30 seconds. When&nbsp;<a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#delete">deleting a Pod</a>&nbsp;you can override this grace period by setting the&nbsp;<code>--grace-period</code>&nbsp;flag to the number of seconds to wait for the Pod to terminate before forcibly terminating it.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to get a logs written of the docker server in some file?</title>
		<link>https://www.bestdevops.com/how-to-get-a-logs-written-of-the-docker-server-in-some-file/</link>
		
		<dc:creator><![CDATA[Subhash]]></dc:creator>
		<pubDate>Tue, 17 Aug 2021 06:45:08 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=19317</guid>

					<description><![CDATA[docker logs 219444e11a87 &#62; output.log]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>docker logs 219444e11a87 &gt; output.log</strong></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Assignment Day 2  &#8211; Explain docker update &#038; docker wait commands with example</title>
		<link>https://www.bestdevops.com/assignment-day-2-explain-docker-update-docker-wait-commands-with-example-2/</link>
		
		<dc:creator><![CDATA[Subhash]]></dc:creator>
		<pubDate>Tue, 17 Aug 2021 05:27:17 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=19281</guid>

					<description><![CDATA[The docker update command dynamically updates container configuration. We can use this command to prevent containers from consuming too many resources from [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">The docker update command dynamically updates container configuration. We can use this command to prevent containers from consuming too many resources from their Docker host</p>



<p class="wp-block-paragraph"><strong>eg : docker update &#8211;cpu-shares 512 219444e11a87</strong></p>



<p class="wp-block-paragraph"><strong>docker inspect 219444e11a87</strong></p>



<p class="wp-block-paragraph">We can check the value for CPU share to be 512</p>



<p class="wp-block-paragraph"><strong>docker wait</strong></p>



<p class="wp-block-paragraph">Start a container in the background.</p>



<p class="wp-block-paragraph"><strong>$ docker run -dit &#8211;name=my_container ubuntu bash</strong></p>



<p class="wp-block-paragraph">Run&nbsp;docker wait, which should block until the container exits.</p>



<p class="wp-block-paragraph"><strong>$ docker wait my_container</strong></p>



<p class="wp-block-paragraph">In another terminal, stop the first container. The docker wait command above returns the exit code.</p>



<p class="wp-block-paragraph"><strong>$ sudo -s</strong></p>



<p class="wp-block-paragraph"><strong>$ docker stop my_container</strong></p>



<p class="wp-block-paragraph">This is the same&nbsp;docker wait&nbsp;command from above, but it now exits, returning&nbsp;0.</p>



<p class="wp-block-paragraph"><strong>$ docker wait my_container</strong></p>



<p class="wp-block-paragraph">0</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Assignment 1</title>
		<link>https://www.bestdevops.com/assignment-1-2/</link>
		
		<dc:creator><![CDATA[Subhash]]></dc:creator>
		<pubDate>Mon, 16 Aug 2021 10:24:07 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=19200</guid>

					<description><![CDATA[What is the diff between docker pause and docker unpause? The command “docker pause” suspends all processes in the specified [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>What is the diff between docker pause and docker unpause?</strong></p>



<p class="wp-block-paragraph">The command “docker pause” suspends all processes in the specified containers. Usually the SIGSTOP signal is sent to the process, which is observable by the process being suspended.</p>



<p class="wp-block-paragraph">EG :</p>



<p class="wp-block-paragraph">docker pause 9b1247ebff59</p>



<p class="wp-block-paragraph">docker ps -a</p>



<p class="wp-block-paragraph">9b1247ebff59&nbsp;&nbsp; jenkins/jenkins&nbsp;&nbsp; &#8220;/sbin/tini &#8212; /usr/…&#8221;&nbsp;&nbsp; 20 minutes ago&nbsp;&nbsp; Up 17 seconds (Paused)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8080/tcp, 50000/tcp&nbsp;&nbsp; Demo1</p>



<p class="wp-block-paragraph">EG :</p>



<p class="wp-block-paragraph">The command “docker unpause” automatically un-suspends the processes in the specified containers. Usually this is accomplished via the SIGCONT signal.</p>



<p class="wp-block-paragraph">docker unpause 9b1247ebff59</p>



<p class="wp-block-paragraph">docker ps -a</p>



<p class="wp-block-paragraph">9b1247ebff59   jenkins/jenkins   &#8220;/sbin/tini &#8212; /usr/…&#8221;   20 minutes ago   Up 32 seconds              8080/tcp, 50000/tcp   Demo1</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>What is the diff between docker stop and docker kill?</strong></p>



<p class="wp-block-paragraph">The command “docker stop” sends a SIGTERM signal to the main process inside the specified container and after a grace period will send a SIGKILL signal to the main process. The SIGTERM signal being sent first allows for a graceful cleanup of the process.</p>



<p class="wp-block-paragraph">EG :</p>



<p class="wp-block-paragraph">docker stop 9b1247ebff59</p>



<p class="wp-block-paragraph">docker ps -a</p>



<p class="wp-block-paragraph">9b1247ebff59&nbsp;&nbsp; jenkins/jenkins&nbsp;&nbsp; &#8220;/sbin/tini &#8212; /usr/…&#8221;&nbsp;&nbsp; 32 minutes ago&nbsp;&nbsp; Exited (143) 5 seconds ago&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Demo1</p>



<p class="wp-block-paragraph">The command “docker kill” sends a SIGKILL signal to the main process inside the specified container. This will automatically kill the main process without no timeout period.</p>



<p class="wp-block-paragraph">EG :</p>



<p class="wp-block-paragraph">docker kill 9b1247ebff59</p>



<p class="wp-block-paragraph">docker ps -a 9b1247ebff59&nbsp;&nbsp; jenkin</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
