<?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>Swetha &#8211; Best DevOps</title>
	<atom:link href="https://www.bestdevops.com/author/swetha/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>Thu, 30 Dec 2021 06:45:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>
	<item>
		<title>Artifactory Assignment</title>
		<link>https://www.bestdevops.com/artifactory-assignment/</link>
		
		<dc:creator><![CDATA[Swetha]]></dc:creator>
		<pubDate>Tue, 10 Aug 2021 03:31:49 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=18963</guid>

					<description><![CDATA[What are the Top maven goals we have? compiler:compile&#160;– the&#160;compile&#160;goal from the&#160;compiler&#160;plugin is bound to the&#160;compile&#160;phase compiler:testCompile&#160;is bound to&#160;the&#160;test-compile&#160;phase surefire:test&#160;is [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">What are the Top maven goals we have?</p>



<ul class="wp-block-list"><li><em>compiler:compile</em>&nbsp;– the&nbsp;<em>compile</em>&nbsp;goal from the&nbsp;<em>compiler</em>&nbsp;plugin is bound to the&nbsp;<em>compile</em>&nbsp;phase</li><li><em>compiler:testCompile</em>&nbsp;is bound to&nbsp;the&nbsp;<em>test-compile</em>&nbsp;phase</li><li><em>surefire:test</em>&nbsp;is bound to&nbsp;<em>test</em>&nbsp;phase</li><li><em>install:install</em>&nbsp;is bound to&nbsp;<em>install</em>&nbsp;phase</li><li><em>jar:jar</em>&nbsp;and&nbsp;<em>war:war</em>&nbsp;is bound to&nbsp;<em>package</em>&nbsp;phase</li></ul>



<p class="wp-block-paragraph">What are the Ports being used in Artifactory and why? Create a table and describe it.</p>



<figure class="wp-block-table"><table><tbody><tr><td><strong>External Network Port</strong></td><td>8081<br>8082 ( for Web Access )</td></tr><tr><td><strong>Internal Network Ports (default)</strong></td><td>8081 for Artifactory<br>8040 and 8045 for Access<br>8048 and 9092 for the Replicator<br>8070 for Web<br>8086 for Metadata<br>8082, 8046, 8047, 8049, and 8091 for the Router<br>8061, and 8062 for Events</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">Find out which maven goal help you to upload a artifact?</p>



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



<p class="wp-block-paragraph">Find out which gradle tasks help you to upload a artifact?</p>



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



<p class="wp-block-paragraph">gradle : Task :artifactoryPublish</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe  id="_ytid_35144"  width="675" height="379"  data-origwidth="675" data-origheight="379" src="https://www.youtube.com/embed/?enablejsapi=1&#038;list=PLTCuRW0ikUdNbCbppA72VxnZ3MU-oDiVH&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>
</div></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Swetha- Kubernetes Assignment</title>
		<link>https://www.bestdevops.com/swetha-kubernetes-assignment/</link>
		
		<dc:creator><![CDATA[Swetha]]></dc:creator>
		<pubDate>Tue, 27 Jul 2021 13:55:53 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=18442</guid>

					<description><![CDATA[What is ReplicaSets ? A ReplicaSets is a bug fixed version of replica controller and it&#8217;s purpose is to maintain [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>What is ReplicaSets ?</strong></p>



<p class="wp-block-paragraph">A ReplicaSets is a bug fixed version of replica controller and it&#8217;s purpose is to maintain a stable set of replica Pods running at any given time. </p>



<p class="wp-block-paragraph"><strong>Working with ReplicaSets with example :</strong></p>



<p class="wp-block-paragraph">A ReplicaSet is defined with fields, including a selector that specifies how to identify Pods it can acquire, a number of replicas indicating how many Pods it should be maintaining, and a pod template specifying the data of new Pods it should create to meet the number of replicas criteria. A ReplicaSet then fulfills its purpose by creating and deleting Pods as needed to reach the desired number. When a ReplicaSet needs to create new Pods, it uses its Pod template.</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript">vi rs.yaml
kubectl create -f rs.yaml
kubectl <span class="hljs-keyword">get</span> rs
&#91;root@swetha swetha]# kubectl <span class="hljs-keyword">get</span> rs
NAME                 DESIRED   CURRENT   READY   AGE
replicaset-example   2         2         2       5s
kubectl <span class="hljs-keyword">get</span> pods
kubectl edit rs replicaset-example
kubectl <span class="hljs-keyword">get</span> pods
vi rs.yaml
kubectl apply -f rs.yaml
kubectl <span class="hljs-keyword">get</span> pods
kubectl scale --replicas=2 -f rs.yaml
kubectl <span class="hljs-keyword">get</span> pods
kubectl scale --replicas=3 rs/replicaset-example
kubectl <span class="hljs-keyword">get</span> pods
kubectl delete rs replicaset-example
kubectl <span class="hljs-keyword">get</span> pods</code></span></pre>

<pre class="wp-block-code"><span><code class="hljs language-php">apiVersion: apps/v1
kind: ReplicaSet
metadata:
  <span class="hljs-comment"># Unique key of the ReplicaSet instance</span>
  name: replicaset-example
spec:
  <span class="hljs-comment"># 3 Pods should exist at all times.</span>
  replicas: <span class="hljs-number">2</span>
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      <span class="hljs-comment"># Run the nginx image</span>
      - name: nginx
        image: scmgalaxy/nginx-devopsschoolv1
</code></span></pre>


<p class="wp-block-paragraph"><strong>What is DaemonSets ?</strong></p>



<p class="wp-block-paragraph">A&nbsp;<em>DaemonSet</em>&nbsp;ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created.</p>



<p class="wp-block-paragraph"><strong>Working with DaemonSets with example :</strong></p>



<p class="wp-block-paragraph">A DaemonSet ensures that all eligible nodes run a copy of a Pod. Normally, the node that a Pod runs on is selected by the Kubernetes scheduler. However, DaemonSet pods are created and scheduled by the DaemonSet controller instead. Depending on the requirement, you can set up multiple DaemonSets for a single type of daemon, with different flags, memory, CPU, etc. that supports multiple configurations and hardware types.</p>



<p class="wp-block-paragraph">The&nbsp;<strong>apiVersion</strong>,&nbsp;<strong>kind,&nbsp;</strong>and&nbsp;<strong>metadata&nbsp;</strong>are required fields in every Kubernetes manifest. The DaemonSet specific fields come under the spec section.</p>


<pre class="wp-block-code"><span><code class="hljs language-xml">vi ds.yml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  # Unique key of the DaemonSet instance
  name: daemonset-example
  namespace: test-daemonset
spec:
  # 3 Pods should exist at all times.
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      # Run the nginx image
      - name: nginx
        image: scmgalaxy/nginx-devopsschoolv1
&#91;root@swetha swetha]# kubectl get daemonsets
NAME                DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset-example   1         1         1       1            1           <span class="hljs-tag">&lt;<span class="hljs-name">none</span>&gt;</span>          5m15s
&#91;root@swetha swetha]# kubectl get pods
NAME                      READY   STATUS    RESTARTS   AGE
daemonset-example-b9jkl   1/1     Running   0          86s
kubectl edit daemonsets daemonset-example
vi ds.yaml
kubectl apply -f ds.yaml
kubectl get pods
kubectl delete daemonsets daemonset-example</code></span></pre>


<p class="wp-block-paragraph"><strong>What is Statefulsets ?</strong></p>



<p class="wp-block-paragraph">StatefulSet is the workload API object used to manage stateful applications. Manages the deployment and scaling of a set of&nbsp;pods&nbsp;<em>and provides guarantees about the ordering and uniqueness</em>&nbsp;of these Pods.</p>



<p class="wp-block-paragraph"><strong>Working with Statefulsets with example :</strong></p>



<p class="wp-block-paragraph">StatefulSets are valuable for applications that require one or more of the following.</p>



<ul class="wp-block-list"><li>Stable, unique network identifiers.</li><li>Stable, persistent storage.</li><li>Ordered, graceful deployment and scaling.</li><li>Ordered, automated rolling updates.</li></ul>



<p class="wp-block-paragraph">In the below example:</p>



<ul class="wp-block-list"><li>A Headless Service, named nginx, is used to control the network domain.</li><li>The StatefulSet, named web, has a Spec that indicates that 3 replicas of the nginx container will be launched in unique Pods.</li><li>The volumeClaimTemplates will provide stable storage using PersistentVolumes provisioned by a PersistentVolume Provisioner.</li></ul>



<p class="wp-block-paragraph">The name of a StatefulSet object must be a valid&nbsp;<a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/names#dns-subdomain-names">DNS subdomain name</a></p>


<pre class="wp-block-code"><span><code class="hljs language-php">apiVersion: v1
kind: Service
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  ports:
  - port: <span class="hljs-number">80</span>
    name: web
  clusterIP: None
  selector:
    app: nginx
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: web
spec:
  selector:
    matchLabels:
      app: nginx <span class="hljs-comment"># has to match .spec.template.metadata.labels</span>
  serviceName: <span class="hljs-string">"nginx"</span>
  replicas: <span class="hljs-number">3</span> <span class="hljs-comment"># by default is 1</span>
  template:
    metadata:
      labels:
        app: nginx <span class="hljs-comment"># has to match .spec.selector.matchLabels</span>
    spec:
      terminationGracePeriodSeconds: <span class="hljs-number">10</span>
      containers:
      - name: nginx
        image: k8s.gcr.io/nginx-slim:<span class="hljs-number">0.8</span>
        ports:
        - containerPort: <span class="hljs-number">80</span>
          name: web
        volumeMounts:
        - name: www
          mountPath: /usr/share/nginx/html
  volumeClaimTemplates:
  - metadata:
      name: www
    spec:
      accessModes: &#91; <span class="hljs-string">"ReadWriteOnce"</span> ]
      storageClassName: <span class="hljs-string">"my-storage-class"</span>
      resources:
        requests:
          storage: <span class="hljs-number">1</span>Gi</code></span></pre>


<p class="wp-block-paragraph"><strong>What is Service ?</strong></p>



<p class="wp-block-paragraph">A Service in Kubernetes is an abstraction which defines a logical set of Pods (which performs same function) and a policy by which to access them. A service is responsible for enabling network access to a set of pods.</p>



<p class="wp-block-paragraph"><strong>Working of Services with example :</strong></p>



<p class="wp-block-paragraph">Services match a set of pods using labels and selectors</p>



<p class="wp-block-paragraph">Although each Pod has a unique IP address, those IPs are not exposed outside the cluster without a Service. Services allow your applications to receive traffic. Services can be exposed in different ways by specifying a type in the ServiceSpec:</p>



<ul class="wp-block-list"><li>ClusterIP (default) &#8211; Exposes the Service on an internal IP in the cluster. This service is only reachable from within the cluster.</li><li>NodePort &#8211; Exposes the Service on the same port of each selected Node in the cluster which makes a Service accessible from outside the cluster.</li><li>LoadBalancer &#8211; Exposes the service via the cloud provider’s load balancer and assigns a fixed, external IP to the Service.</li><li>ExternalName &#8211; Maps the Service to the contents of the externalName field, by returning a CNAME record with its value. </li></ul>


<pre class="wp-block-code"><span><code class="hljs">apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  selector:
    app: MyApp
  ports:
    - protocol: TCP
      port: 80
      targetPort: 9376</code></span></pre>


<p class="wp-block-paragraph">This specification creates a new Service object named &#8220;my-service&#8221;, which targets TCP port 9376 on any Pod with the app=MyApp label. Kubernetes assigns this Service an IP address (sometimes called the &#8220;cluster IP&#8221;), which is used by the Service proxies. The controller for the Service selector continuously scans for Pods that match its selector, and then POSTs any updates to an Endpoint object also named &#8220;my-service&#8221;.</p>



<p class="wp-block-paragraph"><strong>What is Load balancers and how do they work ?</strong></p>



<p class="wp-block-paragraph">Load balancing is defined as the methodical and efficient distribution of network or application traffic across multiple servers in a server farm. Each load balancer sits between client devices and backend servers, receiving and then distributing incoming requests to any available server capable of fulfilling them. Load balancers detect the health of back end resources and do not send traffic to servers that are not able to fulfill request.</p>



<p class="wp-block-paragraph">A load balancer disburses traffic to different web servers in the resource pool to ensure that no single server becomes overworked and subsequently unreliable. Load balancers effectively minimize server response time and maximize throughput.</p>



<p class="wp-block-paragraph"><strong>Types of Load balancers &#8211;</strong></p>



<p class="wp-block-paragraph">a.) Hardware Load Balancers: physical, on-premise, hardware equipment to distribute the traffic on various servers. Though they are capable of handling a huge volume of traffic but are limited in terms of flexibility, and are also fairly high in prices.</p>



<p class="wp-block-paragraph">b.) Software Load Balancers: computer applications that need to be installed in the system and function similarly to the hardware load balancers. They are of two kinds- Commercial and Open Source and are a cost-effective alternative to the hardware counterparts.</p>



<p class="wp-block-paragraph">c.) Virtual Load Balancers:  combination of the program of a hardware load balancer working on a virtual machine.</p>



<p class="wp-block-paragraph"><strong>What is Discovery Services and how it works?</strong></p>



<p class="wp-block-paragraph">Service discovery takes advantage of the labels and selectors to associate a service with a set of pods. A single pod or a ReplicaSet may be exposed to internal or external clients via services, which associate a set of pods with a specific criterion. Any pod whose labels match the selector defined in the service manifest will automatically be discovered by the service. This architecture provides a flexible, loosely-coupled mechanism for service discovery.</p>



<p class="wp-block-paragraph"><strong>What is coreDNS ?</strong></p>



<p class="wp-block-paragraph">CoreDNS is a flexible, extensible DNS server that can serve as the Kubernetes cluster DNS. Like Kubernetes, the CoreDNS project is hosted by the CNCF.</p>



<p class="wp-block-paragraph"><strong>Use of coreDNS &#8211;</strong></p>



<p class="wp-block-paragraph">We can use CoreDNS instead of kube-dns in our cluster by replacing kube-dns in an existing deployment, or by using tools like kubeadm that will deploy and upgrade the cluster for you.</p>



<p class="wp-block-paragraph"><strong>How certificate based Authentication works? Explain in kubernetes context.</strong></p>



<p class="wp-block-paragraph">– Kubernetes uses client certificates, bearer tokens, an authenticating proxy, or HTTP basic auth to authenticate API requests through authentication plugins<br>– Client certificates generated by kubeadm expire after 1 year.<br>– By default, kubeadm generates all the certificates needed for a cluster to run. You can override this behavior by providing your own certificates.<br>– you must place them in whatever directory is specified by the –cert-dir flag or the certificatesDir field of kubeadm’s ClusterConfiguration. By default this is /etc/kubernetes/pki.<br>If a given certificate and private key pair exists before running kubeadm init, kubeadm does not overwrite them. This means for example, copy an existing CA into /etc/kubernetes/pki/ca.crt and /etc/kubernetes/pki/ca.key, and kubeadm will use this CA for signing the rest of the certificates.<br>command : kubeadm certs check-expiration</p>



<p class="wp-block-paragraph"> User/administrator generates a <strong>private key (PK) and certificate signing request (CSR)</strong>. Administrator approves the request and signs it with their CA. Administrator provides the resulting certificate (CRT) back to the user. User uses private key and certificate to login to API Server.</p>



<p class="wp-block-paragraph">Admin creates private key –&gt; which is later converts into csr &#8211;&gt; Admin take this csr file and CA and create .crt file.</p>



<p class="wp-block-paragraph"><strong>What is Block Storage?</strong></p>



<p class="wp-block-paragraph">Block storage, sometimes referred to as block-level storage, is a technology that is used to store data files on Storage Area Networks (SANs) or cloud-based storage environments. Developers favor block storage for computing situations where they require fast, efficient, and reliable data transportation.</p>



<p class="wp-block-paragraph">Block storage breaks up data into blocks and then stores those blocks as separate pieces, each with a unique identifier. The SAN places those blocks of data wherever it is most efficient. That means it can store those blocks across different systems and each block can be configured (or partitioned) to work with different operating systems. Block storage also decouples data from user environments, allowing that data to be spread across multiple environments. This creates multiple paths to the data and allows the user to retrieve it quickly.</p>



<p class="wp-block-paragraph"><strong>How volume plugins in kubernetes works?</strong></p>



<p class="wp-block-paragraph">Volumes offer storage shared between all containers in a Pod. This allows you to reliably use the same mounted file system with multiple services running in the same Pod. This is, however, not automatic. Containers that want to use a volume have to specify which volume they want to use, and where to mount it in the container’s file system</p>



<p class="wp-block-paragraph">https://v1-17.docs.kubernetes.io/docs/concepts/storage/volumes/<br>https://kubernetes.io/docs/concepts/storage/volumes/.</p>



<p class="wp-block-paragraph">Admin will be creating persistent volume (pv) and users/developers claims that ( persistent volume claim).</p>



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



<p class="wp-block-paragraph"><strong>What is StorageClass? and How to work with it with sample StorageClass, PV, PVC, POD.yaml ?</strong></p>



<p class="wp-block-paragraph">A <strong>StorageClass</strong> provides a way for administrators to describe the “classes” of storage they offer. Different classes might map to quality-of-service levels, or to backup policies, or to arbitrary policies determined by the cluster administrators.<br>Kubernetes itself is unopinionated about what classes represent.<br>This concept is sometimes called “profiles” in other storage systems.<br>A <strong>PersistentVolume (PV)</strong> is a piece of storage in the cluster that has been provisioned by an administrator or dynamically provisioned using Storage Classes.<br>It is a resource in the cluster just like a node is a cluster resource. PVs are volume plugins like Volumes, but have a lifecycle independent of any individual Pod that uses the PV.<br>This API object captures the details of the implementation of the storage, be that NFS, iSCSI, or a cloud-provider-specific storage system.<br>A <strong>PersistentVolumeClaim (PVC)</strong> is a request for storage by a user. It is similar to a Pod. Pods consume node resources and PVCs consume PV resources.<br>Pods can request specific levels of resources (CPU and Memory). Claims can request specific size and access modes.</p>



<p class="wp-block-paragraph">Each StorageClass contains the fields provisioner, parameters, and reclaimPolicy, which are used when a PersistentVolume belonging to the class needs to be dynamically provisioned.</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript">apiVersion: storage.k8s.io/v1
<span class="hljs-attr">kind</span>: StorageClass
<span class="hljs-attr">metadata</span>:
  name: standard
<span class="hljs-attr">provisioner</span>: kubernetes.io/aws-ebs
<span class="hljs-attr">parameters</span>:
  type: gp2
<span class="hljs-attr">reclaimPolicy</span>: Retain
<span class="hljs-attr">allowVolumeExpansion</span>: <span class="hljs-literal">true</span>
<span class="hljs-attr">mountOptions</span>:
  - debug
<span class="hljs-attr">volumeBindingMode</span>: Immediate</code></span></pre>


<figure class="wp-block-embed is-type-wp-embed is-provider-devopsschool-com wp-block-embed-devopsschool-com"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="qvlLIpQ0GP"><a href="https://www.devopsschool.com/blog/persistentvolume-persistentvolumeclaim-volumes-using-hostpath/">Kubernetes PersistentVolume, PersistentVolumeClaim, volume using hostPath</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Kubernetes PersistentVolume, PersistentVolumeClaim, volume using hostPath&#8221; &#8212; DevOpsSchool.com" src="https://www.devopsschool.com/blog/persistentvolume-persistentvolumeclaim-volumes-using-hostpath/embed/#?secret=1ODue4oly3#?secret=qvlLIpQ0GP" data-secret="qvlLIpQ0GP" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



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



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Swetha &#8211; Kubernetes Architecture</title>
		<link>https://www.bestdevops.com/swetha-kubernetes/</link>
		
		<dc:creator><![CDATA[Swetha]]></dc:creator>
		<pubDate>Thu, 22 Jul 2021 07:11:07 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=18058</guid>

					<description><![CDATA[What are the 10 features of kubernetes ? container orchestrator Workload placement Maintains desired state Self-healing Automated rollbacks Auto scaling [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h5 class="wp-block-heading">What are the 10 features of kubernetes ?</h5>



<ol class="wp-block-list"><li>container orchestrator</li><li>Workload placement </li><li>Maintains desired state</li><li>Self-healing</li><li>Automated rollbacks</li><li>Auto scaling</li><li>Load balancing</li><li>Speed of deployment</li><li>Ability to absorb change quickly</li><li>Hide complexity in the cluster</li></ol>



<h5 class="wp-block-heading">How Kubernetes works ?</h5>



<p class="wp-block-paragraph">Kubernetes are comprised of  master and multiple nodes where Master is In-charge of cluster which manages nodes and nodes manages one or multiple pods and pod manages one or multiple containers.</p>



<figure class="wp-block-image is-resized"><img fetchpriority="high" decoding="async" src="https://images.ctfassets.net/w1bd7cq683kz/5Ex6830HzBPU5h8Ou8xQAB/2c948105fc10094348203bec6c1eab04/Kubernetes_20architecture_20diagram.png" alt="Kubernetes architecture diagram" width="814" height="555" /></figure>



<h5 class="wp-block-heading">What are the components of Master ?</h5>



<ol class="wp-block-list" type="1"><li>Kube-API server – front end thru which any communication is passed and consumes JSON via manifest files.</li><li>Kube-Cluster store – requests gets stored in cluster store in key value format powered by etcd.</li><li>Kube-Controller manager – controller of controllers which watches for changes and helps in maintaining desired state.</li><li>Kube-Scheduler – watches API server for new pods, assigns work to nodes and interacts with kubelet in node.</li></ol>



<h5 class="wp-block-heading">What are the components of Worker ?</h5>



<ol class="wp-block-list" type="1"><li>Kubelet – main kubernetes agent which registers node with cluster and instantiates pods, exposes endpoint on: 10255.</li><li>Container Engine (Docker) – does container management: pulling images and running containers.</li><li>Kube –proxy – manages kubernetes networking (pod IP addresses), all containers in a pod share a single IP.</li></ol>



<h5 class="wp-block-heading">What are the components of Workstation ?</h5>



<p class="wp-block-paragraph">Kubectl &#8211; CLI to interact with APIserver</p>



<p class="wp-block-paragraph"><strong>What is POD ?</strong></p>



<p class="wp-block-paragraph">A pod is the smallest execution unit that you can create and manage in Kubernetes. A&nbsp;<em>Pod</em>&nbsp; is a group of one or more&nbsp;containers, with shared storage and network resources, and a specification for how to run the containers.  </p>



<ul class="wp-block-list"><li>A pod encapsulates one or more applications. </li><li>When a pod is created it is assigned its own unique IP address.</li><li>Pods have a single IP address that is applied to every container within the pod. </li><li>Containers in a pod share the same resources such as memory and storage (All containers in pod share the pod environment).</li><li>If there are multiple containers within the pod, they can communicate between each other simply by using localhost. Communications outside of the pod is achieved by exposing a port.</li><li>If a pod (or the node it executes on) fails, Kubernetes can automatically create a new replica of that pod to continue operations.</li><li>Communications between pods in a cluster takes advantage of the fact that Kubernetes assigns a cluster-private IP address to every pod in a cluster, eliminating the need to either explicitly create links between pods or to map container ports to host ports.</li><li>Pods utilize an agent on each node called a kubelet to communicate with the Kubernetes API and the rest of the cluster.</li><li>As the load on a pod increases, Kubernetes can automatically replicate the pod to achieve desired scalability.</li><li>multi-container pods ease deployment configuration compared to setting up shared resources between containers on your own.</li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Swetha &#8211; Docker Lab Assignment</title>
		<link>https://www.bestdevops.com/swetha-docker-lab-assignment/</link>
		
		<dc:creator><![CDATA[Swetha]]></dc:creator>
		<pubDate>Wed, 21 Jul 2021 07:06:31 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=17825</guid>

					<description><![CDATA[Install Docker Engine in Centos#1 Vm. Verify docker installation Assignment#1 Create Ubuntu Container Attaching to the container and Install Update, [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Install Docker Engine in Centos#1 Vm.</h2>


<pre class="wp-block-code"><span><code class="hljs language-php">&#91;centos@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> ~]$ sudo systemctl start docker
&#91;centos@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> ~]$ history
    <span class="hljs-number">1</span>  sudo -s
    <span class="hljs-number">2</span>  <span class="hljs-keyword">exit</span>
    <span class="hljs-number">3</span>  clear
    <span class="hljs-number">4</span>  ls
    <span class="hljs-number">5</span>  sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    <span class="hljs-number">6</span>   sudo yum-config-manager --add-repo https:<span class="hljs-comment">//download.docker.com/linux/centos/docker-ce.repo</span>
    <span class="hljs-number">7</span>   sudo yum install –y https:<span class="hljs-comment">//dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm</span>
    <span class="hljs-number">8</span>   sudo yum-config-manager --enable rhui-REGION-rhel-server-extras
    <span class="hljs-number">9</span>   sudo yum install -y docker-ce
   <span class="hljs-number">10</span>  docker -v
   <span class="hljs-number">11</span>  sudo systemctl enable docker
   <span class="hljs-number">12</span>  sudo systemctl start docker
   <span class="hljs-number">13</span>  history
</code></span></pre>


<h2 class="wp-block-heading">Verify docker installation</h2>


<pre class="wp-block-code"><span><code class="hljs language-javascript">&#91;centos@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> ~]$ which docker
/usr/bin/docker
&#91;centos@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> ~]$ which dockerd
/usr/bin/dockerd
&#91;centos@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> ~]$ which containerd
/usr/bin/containerd
&#91;centos@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> ~]$ ps -eaf|grep dockerd
root     <span class="hljs-number">10764</span>     <span class="hljs-number">1</span>  <span class="hljs-number">0</span> <span class="hljs-number">05</span>:<span class="hljs-number">16</span> ?        <span class="hljs-number">00</span>:<span class="hljs-number">00</span>:<span class="hljs-number">00</span> /usr/bin/dockerd -H fd:<span class="hljs-comment">// --containerd=/run/containerd/containerd.sock</span>
centos   <span class="hljs-number">10920</span>  <span class="hljs-number">1458</span>  <span class="hljs-number">0</span> <span class="hljs-number">05</span>:<span class="hljs-number">26</span> pts/<span class="hljs-number">0</span>    <span class="hljs-number">00</span>:<span class="hljs-number">00</span>:<span class="hljs-number">00</span> grep --color=auto dockerd
&#91;centos@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> ~]$ ps -eaf|grep containerd
root     <span class="hljs-number">10753</span>     <span class="hljs-number">1</span>  <span class="hljs-number">0</span> <span class="hljs-number">05</span>:<span class="hljs-number">16</span> ?        <span class="hljs-number">00</span>:<span class="hljs-number">00</span>:<span class="hljs-number">00</span> /usr/bin/containerd
root     <span class="hljs-number">10764</span>     <span class="hljs-number">1</span>  <span class="hljs-number">0</span> <span class="hljs-number">05</span>:<span class="hljs-number">16</span> ?        <span class="hljs-number">00</span>:<span class="hljs-number">00</span>:<span class="hljs-number">00</span> /usr/bin/dockerd -H fd:<span class="hljs-comment">// --containerd=/run/containerd/containerd.sock</span>
centos   <span class="hljs-number">10922</span>  <span class="hljs-number">1458</span>  <span class="hljs-number">0</span> <span class="hljs-number">05</span>:<span class="hljs-number">26</span> pts/<span class="hljs-number">0</span>    <span class="hljs-number">00</span>:<span class="hljs-number">00</span>:<span class="hljs-number">00</span> grep --color=auto containerd
&#91;centos@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> ~]$ docker -v
Docker version <span class="hljs-number">20.10</span><span class="hljs-number">.7</span>, build f0df350
&#91;centos@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> ~]$
</code></span></pre>


<h2 class="wp-block-heading">Assignment#1</h2>



<p class="wp-block-paragraph"><strong>Create Ubuntu Container</strong></p>


<pre class="wp-block-code"><span><code class="hljs language-php">&#91;centos@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> ~]$ sudo -s
&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># docker pull ubuntu</span>
Using <span class="hljs-keyword">default</span> tag: latest
latest: Pulling from library/ubuntu
a31c7b29f4ad: Pull complete
Digest: sha256:b3e2e47d016c08b3396b5ebe06ab0b711c34e7f37b98c9d37abe794b71cea0a2
Status: Downloaded newer image <span class="hljs-keyword">for</span> ubuntu:latest
docker.io/library/ubuntu:latest

&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># docker run -itd ubuntu</span>
<span class="hljs-number">49</span>a0ac7cce4a06ca475f26e8e8c27a4b564346cff412e22c394308d7a5397d74
&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># docker ps -a</span>
CONTAINER ID   IMAGE     COMMAND   CREATED         STATUS         PORTS     NAMES
<span class="hljs-number">49</span>a0ac7cce4a   ubuntu    <span class="hljs-string">"bash"</span>    <span class="hljs-number">6</span> seconds ago   Up <span class="hljs-number">5</span> seconds             loving_goldwasser

</code></span></pre>


<p class="wp-block-paragraph"><strong>Attaching to the container</strong> <strong>and Install Update, git &amp; apache2 in ubuntu container</strong></p>


<pre class="wp-block-code"><span><code class="hljs language-php">&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># docker attach 49a0ac7cce4a</span>
root@<span class="hljs-number">49</span>a0ac7cce4a:/<span class="hljs-comment"># yum install git</span>
bash: yum: command not found
root@<span class="hljs-number">49</span>a0ac7cce4a:/<span class="hljs-comment"># apt-get update</span>
root@<span class="hljs-number">49</span>a0ac7cce4a:/<span class="hljs-comment"># apt-get install apache2</span>
root@<span class="hljs-number">49</span>a0ac7cce4a:/<span class="hljs-comment"># git --version</span>
git version <span class="hljs-number">2.25</span><span class="hljs-number">.1</span>

</code></span></pre>


<p class="wp-block-paragraph"><strong>Run git command in container from outside</strong></p>


<pre class="wp-block-code"><span><code class="hljs language-css"><span class="hljs-selector-tag">ctrl</span>+<span class="hljs-selector-tag">p</span>+<span class="hljs-selector-tag">q</span> <span class="hljs-selector-tag">-</span> <span class="hljs-selector-tag">to</span> <span class="hljs-selector-tag">come</span> <span class="hljs-selector-tag">out</span> <span class="hljs-selector-tag">from</span> <span class="hljs-selector-tag">container</span>
<span class="hljs-selector-attr">&#91;root@ip-172-31-7-48 centos]</span># <span class="hljs-selector-tag">docker</span> <span class="hljs-selector-tag">exec</span> 49<span class="hljs-selector-tag">a0ac7cce4a</span> <span class="hljs-selector-tag">git</span> <span class="hljs-selector-tag">--version</span>
<span class="hljs-selector-tag">git</span> <span class="hljs-selector-tag">version</span> 2<span class="hljs-selector-class">.25</span><span class="hljs-selector-class">.1</span></code></span></pre>


<h2 class="wp-block-heading">Assignment#2</h2>



<p class="wp-block-paragraph"><strong>Create a httpd container exposed at 8080 port</strong></p>


<pre class="wp-block-code"><span><code class="hljs language-php">&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># docker pull httpd</span>
Using <span class="hljs-keyword">default</span> tag: latest
latest: Pulling from library/httpd
Status: Downloaded newer image <span class="hljs-keyword">for</span> httpd:latest
docker.io/library/httpd:latest
&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># docker container run --name web -d -p 8080:80 httpd</span>
<span class="hljs-number">3</span>ec7d0b852ee41f4f1fe30ee075b79bdfadf9c4090adcd6945d2411ac5b771c2
&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># docker ps -a</span>
CONTAINER ID   IMAGE     COMMAND              CREATED         STATUS         PORTS                                   NAMES
<span class="hljs-number">3</span>ec7d0b852ee   httpd     <span class="hljs-string">"httpd-foreground"</span>   <span class="hljs-number">6</span> seconds ago   Up <span class="hljs-number">5</span> seconds   <span class="hljs-number">0.0</span><span class="hljs-number">.0</span><span class="hljs-number">.0</span>:<span class="hljs-number">8080</span>-&gt;<span class="hljs-number">80</span>/tcp, :::<span class="hljs-number">8080</span>-&gt;<span class="hljs-number">80</span>/tcp   web
</code></span></pre>


<p class="wp-block-paragraph"><strong>Access(curl) container from node</strong></p>


<pre class="wp-block-code"><span><code class="hljs language-xml">&#91;root@ip-172-31-7-48 centos]# curl localhost:8080
<span class="hljs-tag">&lt;<span class="hljs-name">html</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>It works!<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
&#91;root@ip-172-31-7-48 centos]# curl localhost:8081
curl: (7) Failed connect to localhost:8081; Connection refused
&#91;root@ip-172-31-7-48 centos]# curl localhost:8080
<span class="hljs-tag">&lt;<span class="hljs-name">html</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>It works!<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>

</code></span></pre>


<h2 class="wp-block-heading">Assignment#3</h2>



<p class="wp-block-paragraph"><strong>Create an image with base &#8211; centos and git must be installed in it</strong></p>


<pre class="wp-block-code"><span><code class="hljs language-php">&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># touch dockerfile</span>
&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># vi dockerfile</span>
&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># cat dockerfile</span>
FROM ubuntu
MAINTAINER Swetha
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get -y install tzdata
RUN apt-get update &amp;&amp; apt-get install git -y &amp;&amp; apt-get install -yq apache2
CMD /usr/sbin/apache2ctl -D FOREGROUND

&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># docker build -t ub-up-git .</span>
&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># docker images</span>
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
ub-up-git    latest    c226f4a2cae2   <span class="hljs-number">7</span> minutes ago   <span class="hljs-number">259</span>MB
ubuntu       latest    c29284518f49   <span class="hljs-number">7</span> days ago      <span class="hljs-number">72.8</span>MB</code></span></pre>


<p class="wp-block-paragraph"><strong>Push a docker image to hub.docker.com</strong></p>


<pre class="wp-block-code"><span><code class="hljs language-php">&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># docker tag ub-up-git swetha97/test21</span>
&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># docker images</span>
REPOSITORY                TAG       IMAGE ID       CREATED          SIZE
swetha97/test21           latest    c226f4a2cae2   <span class="hljs-number">16</span> minutes ago   <span class="hljs-number">259</span>MB
ub-up-git-by-dockerfile   latest    c226f4a2cae2   <span class="hljs-number">16</span> minutes ago   <span class="hljs-number">259</span>MB
ub-up-git                 latest    c226f4a2cae2   <span class="hljs-number">16</span> minutes ago   <span class="hljs-number">259</span>MB
ubuntu                    latest    c29284518f49   <span class="hljs-number">7</span> days ago       <span class="hljs-number">72.8</span>MB

&#91;root@ip<span class="hljs-number">-172</span><span class="hljs-number">-31</span><span class="hljs-number">-7</span><span class="hljs-number">-48</span> centos]<span class="hljs-comment"># docker login</span>
Login with your Docker ID to push <span class="hljs-keyword">and</span> pull images from Docker Hub. <span class="hljs-keyword">If</span> you don<span class="hljs-string">'t have a Docker ID, head over to https://hub.docker.com to create one.
Username: swetha97
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https:&#47;&#47;docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
&#91;root@ip-172-31-7-48 centos]# docker push swetha97/test21
</span></code></span></pre>


<p class="wp-block-paragraph">https://hub.docker.com/r/swetha97/test21/tags?page=1&#038;ordering=last_updated</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
