<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arani Mukherjee on Medium]]></title>
        <description><![CDATA[Stories by Arani Mukherjee on Medium]]></description>
        <link>https://medium.com/@arani?source=rss-a8cd986233ac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7C-DsPvIJjpClPhQxB1Buw@2x.jpeg</url>
            <title>Stories by Arani Mukherjee on Medium</title>
            <link>https://medium.com/@arani?source=rss-a8cd986233ac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 21:01:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arani/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kompose A tool to solve kubernetes docker deployments]]></title>
            <link>https://medium.com/data-engineering-and-linux/kompose-a-tool-to-solve-kubernetes-docker-deployments-5c299cf8cbed?source=rss-a8cd986233ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c299cf8cbed</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Arani Mukherjee]]></dc:creator>
            <pubDate>Fri, 14 Sep 2018 10:38:41 GMT</pubDate>
            <atom:updated>2018-10-08T09:54:16.000Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*m79o_u_xTlqapQBHBySy_w.png" /></figure><p>Previous Blog regarding Docker and Kubernetes : <a href="https://medium.com/data-engineering-and-linux/docker-and-kubernetes-the-beginners-introduction-e28fe38970d1">Here</a></p><p>Have you ever faced the problem on deploying a custom docker image from your local docker to Kubernetes?</p><p>Actually, there are 2 ways that can solve this problem</p><p>1. Pushing your Docker Image to any Image repository</p><p>2. Somehow tell your kubernetes (In my case minikube) to use local docker images ( Because by default minikube does not search or use pre-pulled images for deploying)</p><p>the first way comes handy for most cases because it is easy.</p><p>But for development sometimes the scenario can occur that exposing the image to any public repository may be risky.</p><p>So in that case the first method becomes invalid .</p><p>The second method comes in place which is :</p><blockquote>We have to somehow point a local docker build be automatically done in minikube space:</blockquote><blockquote>Step : 1 <br>$ eval $(minikube docker-env)</blockquote><blockquote>window 1<br>$ minikube ssh <br> $ docker images</blockquote><blockquote>window 2<br>$ docker images</blockquote><blockquote>check the o/p of window 1 and window 2 are same or not if yes then the work is done:</blockquote><blockquote>Now any docker build will automatically create docker image under minikube spaceNow the Problem is</blockquote><p>Now the problem with this method is though it is handy but, it is not kind of industry practice plus in real Kubernetes cluster, it may break the whole architecture.</p><h3>What is the solution?</h3><p>here comes the use of <strong>Kompose</strong> i.e Docker Compose + Kubernetes = Kompose.</p><h3>What’s Kompose?</h3><p>Kompose is a conversion tool for Docker Compose to container orchestrators such as Kubernetes (or OpenShift).</p><p>Why do developers love it?</p><ul><li>Simplify your development process with Docker Compose and then deploy your containers to a production cluster</li><li>Convert your docker-compose.yaml with one simple command kompose convert</li><li>Immediately bring up your cluster with kompose up</li><li>Bring it back down with kompose down</li></ul><p>Visit Their own <a href="http://kompose.io/">website</a></p><p><strong>Hands-on Kompose</strong></p><p><a href="http://kompose.io/installation/">Install Compose</a></p><p>Create a directory in your filesystem and name it kompose (for ease of identification)</p><p>$ cd kompose</p><p>For Linux :</p><p>Download Kompose: <br>$curl -L https://github.com/kubernetes/kompose/releases/download/v1.16.0/kompose-linux-amd64 -o kompose</p><p>After downloading</p><pre>$chmod +x kompose<br>$sudo mv ./kompose /usr/local/bin/kompose</pre><p>Now you are good to go.</p><blockquote>Start minikube</blockquote><p>$ minikube start<br>Starting local Kubernetes v1.10.0 cluster…<br>Starting VM…<br>Getting VM IP address…<br>Moving files into cluster…<br>Setting up certs…<br>Connecting to cluster…<br>Setting up kubeconfig…<br>Starting cluster components…<br>Kubectl is now configured to use the cluster.<br>Loading cached images from config file.</p><p>here I am working with a demo docker-compose.yaml</p><pre>$ wget <a href="https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml">https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml</a></pre><p>Contents :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*EYSa33PDQffXEb7ztJNW0g.png" /><figcaption>docker-compose.yaml</figcaption></figure><p>now converting this Kompose file we can get all required deployment and service yaml(s)from this.</p><pre>$ kompose convert                           <br>INFO Kubernetes file &quot;frontend-service.yaml&quot; created         <br>INFO Kubernetes file &quot;redis-master-service.yaml&quot; created     <br>INFO Kubernetes file &quot;redis-slave-service.yaml&quot; created      <br>INFO Kubernetes file &quot;frontend-deployment.yaml&quot; created      <br>INFO Kubernetes file &quot;redis-master-deployment.yaml&quot; created  <br>INFO Kubernetes file &quot;redis-slave-deployment.yaml&quot; created</pre><p>now do a ls to see all the yaml(s) are created or not.</p><p>$ ls -l<br>docker-compose.yaml<br>frontend-deployment.yaml<br>frontend-service.yaml<br>redis-master-deployment.yaml<br>redis-master-service.yaml<br>redis-slave-deployment.yaml<br>redis-slave-service.yaml</p><p>Now to create the deployments and services in kubernetes we can <strong>Kompose up</strong></p><pre>$ kompose up<br>We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. <br>If you need different kind of resources, use the &#39;kompose convert&#39; and &#39;kubectl create -f&#39; commands instead. <br><br>INFO Successfully created Service: redis          <br>INFO Successfully created Service: web            <br>INFO Successfully created Deployment: redis       <br>INFO Successfully created Deployment: web         <br><br>Your application has been deployed to Kubernetes. You can run &#39;kubectl get deployment,svc,pods,pvc&#39; for details.</pre><p>Now check whether your deployments are ready or not :</p><p>run :</p><p>$ kubectl get deployment,svc,pods,pvc</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JPnbwU9AQ3_cIImjh4uavg.png" /></figure><p>The output should contain the following images:</p><blockquote>Deployments:</blockquote><blockquote>redis-master, redis-slave &amp; frontend</blockquote><blockquote>Services :</blockquote><blockquote>redis-master, redis-slave &amp; frontend</blockquote><p>and redis-master and redis slave pods</p><p>check minikube dashboard</p><p>$ minikube dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bPLT5OZs_oNH1jnXdpJlgA.png" /></figure><p>After the deployments and image pull is complete check for the url to view the output</p><p>$ minikube service frontend — url<br><a href="http://192.168.99.100:31476/">http://192.168.99.100:31476</a></p><p>Visit the site and check whether it is working or not :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IU9tGGMjR7E5FvWvFLcKlQ.png" /><figcaption>Output</figcaption></figure><p>Now we can easily view how this tool Kompose makes our life easy .</p><p>For The full Blog regarding Kubernetes and Docker please visit</p><p><a href="https://medium.com/data-engineering-and-linux/docker-and-kubernetes-the-beginners-introduction-e28fe38970d1">docker and kubernetes The beginners introduction</a></p><p>Visit my medium profile for more such blogs:</p><p><a href="https://medium.com/@arani">Arani Mukherjee - Medium</a></p><p>Big Data Developer @ <a href="https://thirdeyedata.io/">ThirdEyeData</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c299cf8cbed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-engineering-and-linux/kompose-a-tool-to-solve-kubernetes-docker-deployments-5c299cf8cbed">Kompose A tool to solve kubernetes docker deployments</a> was originally published in <a href="https://medium.com/data-engineering-and-linux">Data Engineering and Linux</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[docker and Kubernetes The beginner's introduction]]></title>
            <link>https://medium.com/data-engineering-and-linux/docker-and-kubernetes-the-beginners-introduction-e28fe38970d1?source=rss-a8cd986233ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/e28fe38970d1</guid>
            <category><![CDATA[hands-on-learning]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Arani Mukherjee]]></dc:creator>
            <pubDate>Thu, 30 Aug 2018 08:44:47 GMT</pubDate>
            <atom:updated>2020-02-12T09:45:21.784Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*mRpQMJTSfbFVitTQtQtrMw.jpeg" /></figure><p>Time has come when any <a href="https://thirdeyedata.io/">big data</a> developer must be concerned with containers and management of containers. Everything is moving towards decoupled development for higher scalability and maintainability. so it is going to be a De facto standard to understand and get accustomed with these technologies.</p><h3>Docker the introduction :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*glD7bNJG3SlO0_xNmSGPcQ.png" /></figure><p>Docker revolutionized the industry standard of how visualization can be handled for lightweight and easy development.</p><p>For the basics, I personally recommend to read and understand <strong>How </strong><a href="https://searchservervirtualization.techtarget.com/definition/hypervisor"><strong>Hypervisor</strong></a><strong> Works</strong> and get to know how docker manages to deal with this and do the magic of containerizing anything and everything.</p><p>Some reads will help :</p><ol><li><a href="https://en.wikipedia.org/wiki/Linux_namespaces">Linux namespace</a>.</li><li><a href="https://en.wikipedia.org/wiki/LXC">Linux Containers (LXC)</a></li><li>Types of Hypervisors (Type 1 and 2) FYI just attaching a basic image</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*fy45l-aqYzB3jYCGToRbNA.png" /><figcaption>Type 1 and Type 2 Hypervisor</figcaption></figure><p>4. <strong>Docker architecture Vs Virtualization architecture</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WUH4iiAUvTzzx7jkKX5vsA.jpeg" /></figure><p>Here we can clearly see that docker simply removes the workload of a foreign operating system which in reality makes them light and less memory and process hungry without compromising the environment isolation.</p><p>Now the <strong>question arises</strong> :</p><p>How we can communicate in between containers?</p><p>How we can manage containers and use them when they are needed so that we can <a href="https://docs.docker.com/engine/reference/commandline/pause/"><strong>Pause</strong></a><strong> </strong>them when not in use?</p><p>The answer is either <a href="https://docs.docker.com/engine/swarm/"><strong>Docker Swarm</strong></a><strong> </strong>or <a href="https://kubernetes.io/"><strong>Kubernetes</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*bcGhuY5mBz29fnRxp__yTA.jpeg" /><figcaption>Docker Swarm VS Kubernetes</figcaption></figure><p>It’s not exactly easy to compare Kubernetes with Docker Swarm as Docker Swarm is a simple and easy solution to work with whereas Kubernetes is targeted those who require full fledge support with higher complexity. Docker Swarm is preferred in environments where simplicity and fast development is favored. Whereas Kubernetes is suitable for environments where medium to large clusters are running complex applications.</p><p>As for our study, I am going with Kubernetes.</p><h3>Kubernetes Introduction:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*P9KRHqxAz1fDJsYO105fPA.png" /><figcaption>the basic architecture of Kubernetes</figcaption></figure><p>Developed by Google, Kubernetes work as a cluster orchestration and management tool.</p><p>For learning purpose Kubernetes comes with a solution for Single Node cluster i.e.<strong> </strong><a href="https://kubernetes.io/docs/setup/minikube/"><strong>minikube</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nmLlXo7cJLGg-q4pgJprAw.jpeg" /></figure><blockquote><strong>Hands on instructions</strong></blockquote><h3>Docker</h3><blockquote><strong>Installing Docker On Ubuntu</strong></blockquote><p>Source <a href="https://docs.docker.com/v17.09/engine/installation/linux/docker-ce/ubuntu/#set-up-the-repository">Here</a></p><p>Docker release: Docker CE</p><p>First, make update and upgrade of your packages</p><p>$ sudo apt-get update</p><p>$sudo apt-get upgrade</p><p>Now,</p><p>Install packages to allow apt to use a repository over HTTPS:</p><pre>$ sudo apt-get install \<br>    apt-transport-https \<br>    ca-certificates \<br>    curl \<br>    software-properties-common</pre><p>Add Docker’s official GPG key:</p><pre>$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -</pre><p>Verify that you now have the key with the fingerprint9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.</p><pre>$ sudo apt-key fingerprint 0EBFCD88</pre><pre>pub   4096R/0EBFCD88 2017-02-22<br>      Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88<br>uid                  Docker Release (CE deb) &lt;docker@docker.com&gt;<br>sub   4096R/F273FCD8 2017-02-22</pre><p>Add the Docker repository to APT sources:</p><pre>$ sudo add-apt-repository \<br>   &quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu \<br>   $(lsb_release -cs) \<br>   stable&quot;</pre><p>Next, update the package database with the Docker packages from the newly added repo:</p><p>$ sudo apt-get update</p><p>ake sure you are about to install from the Docker repo instead of the default Ubuntu 16.04 repo:</p><p>$ apt-cache policy docker-ce</p><p>Now install Docker:</p><p>$ sudo apt-get install -y docker-ce</p><p>Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:</p><p>$ sudo service docker status</p><blockquote><strong>Configuring Environment to easily work with docker</strong></blockquote><p>Add the docker group if it doesn’t already exist:</p><p>$ sudo groupadd docker</p><p>Add the connected user “$USER” to the docker group. Change the user name to match your preferred user if you do not want to use your current user:</p><p>$ sudo gpasswd -a $USER docker</p><p>Now you can easily do docker commands from your own user</p><p>Just do a logout and login and you will not need <strong>sudo </strong>before every docker command</p><blockquote><strong>Docker Commands</strong></blockquote><p>Start Docker Service:</p><p>$ sudo service docker start</p><p>View available images:</p><p>$docker images</p><p>View Running containers</p><p>$docker ps</p><p>View all docker containers (running &amp; stopped)<br>$docker ps -a</p><p>pulling an image from <a href="https://hub.docker.com/">docker hub</a></p><p>$docker pull &lt;imagename&gt;</p><p>e.g. $docker pull nginx</p><p>Running docker via port 80 :</p><p>$docker run — name test-nginx -p 80:80 nginx</p><p>attaching a file to nginx html directory and running in nginx server:</p><p>$docker run — name test-nginx -p 80:80 -d -v /home/thirdeye/html:/usr/share/nginx/html nginx <br> <br>accessing nginx :</p><p>$docker run -it nginx /bin/sh</p><p>Stopping Docker container:<br>$ docker stop contailner_id(find it from # docker ps)</p><p>FYI: to identify not running(created) containers: <br>$docker ps -a</p><p>Deleting docker container<br>$ docker rm comtainer_id</p><p>Deleting docker image<br>$ docker rmi image_id</p><blockquote><strong>Create your Own docker Image:</strong></blockquote><p>Creating a custom docker image for docker is a necessary skill because most of the cases you have to create your own Docker image and deploy it on the cluster:</p><p>In docker, we have to create a file named <strong>Dockerfile </strong>where we have to put all the info and steps to create a new image.</p><p>basically, we first pull a base image and add our required packages and files to that and then create the custom image.</p><p>Here is an example</p><p>Here i am just deploying a python flask app in docker image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_HHXMUHKGE3jSOVmUNbuWw.png" /><figcaption>Folder Structure In docker build</figcaption></figure><blockquote><strong>Contents Of Dockerfile</strong></blockquote><p>FROM ubuntu:latest<br>MAINTAINER Arani Mukherjee <br>RUN apt-get update -y<br>RUN apt-get install -y python-pip python-dev build-essential<br>COPY . /flask-app<br>WORKDIR /flask-app<br>RUN pip install -r requirements.txt<br>EXPOSE 5000<br>ENTRYPOINT [“python”]<br>CMD [“flask_docker.py”]</p><blockquote><strong>Contents of requirements.txt file</strong></blockquote><p>Just mention python package names</p><p>flask<br>redis</p><blockquote><strong>Contents Of flask_docker.py</strong></blockquote><p>from flask import Flask<br>app = Flask(__name__)</p><p><a href="http://twitter.com/app">@app</a>.route(‘/’)<br>def hello_world():<br> return ‘Flask Dockerized’</p><p>if __name__ == ‘__main__’:<br> app.run(debug=True,host=’0.0.0.0&#39;)</p><blockquote><strong>Now We have to build the docker image from the Dockerfile</strong></blockquote><p>$ cd directory/where/the/Dockerfile/is/kept</p><p>$ docker build -t “my_flask_image:Dockerfile” .</p><p>It will eventually pull the image and also download all required packages and add to the base image and finally create the custom image</p><p>Result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aforA7SLGLtpCHdRbmiwRw.png" /></figure><blockquote><strong>To deploy this image in kubernetes there are 2 ways:</strong></blockquote><blockquote>1 . Push the image in dockerhub or any private repository</blockquote><blockquote>2. Somehow make kubernetes use the local images for deployment</blockquote><blockquote>Now the easy one is pusing the image in DockerHub or any public repository</blockquote><blockquote>But in for ease of use you can use this way:</blockquote><blockquote>We have to somehow point a local docker build be automatically done in minikube space:</blockquote><blockquote>Step : 1 <br>$ eval $(minikube docker-env)</blockquote><blockquote>window 1<br>$ minikube ssh <br> $ docker images</blockquote><blockquote>window 2<br>$ docker images</blockquote><blockquote>check the o/p of window 1 and window 2 are same or not if yes then the work is done:</blockquote><blockquote>Now any docker build will automatically create docker image under minikube space</blockquote><h3>Minikube ( Kubernetes Local single node cluster instance )</h3><blockquote><strong>Installation:(Acording to 2nd AUG, 2018)</strong></blockquote><p>STEP 1: Install and configure docker</p><p>This is my docker info:::::::</p><p>$ sudo docker version<br>[sudo] password for user: <br>Client:<br> Version: 18.06.0-ce<br> API version: 1.38<br> Go version: go1.10.3<br> Git commit: 0ffa825<br> Built: Wed Jul 18 19:11:02 2018<br> OS/Arch: linux/amd64<br> Experimental: false</p><p>Server:<br> Engine:<br> Version: 18.06.0-ce<br> API version: 1.38 (minimum version 1.12)<br> Go version: go1.10.3<br> Git commit: 0ffa825<br> Built: Wed Jul 18 19:09:05 2018<br> OS/Arch: linux/amd64<br> Experimental: false</p><p>Machine Info :</p><p>Os: ubuntu 16.04LTS , RAM:8GB, Processor: intel core i3</p><h4>Installing kubectl</h4><blockquote>URL :: <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/">https://kubernetes.io/docs/tasks/tools/install-kubectl/</a></blockquote><blockquote>First and foremost : <br>Stop swap memory location because Kubernates requires swap to be disabled</blockquote><blockquote>$ sudo swapoff -a</blockquote><blockquote>Make a restart of your machine:</blockquote><blockquote>$ sudo init 6</blockquote><blockquote>Now install kubectl:::::</blockquote><blockquote>$ sudo apt-get update &amp;&amp; sudo apt-get install -y apt-transport-https</blockquote><blockquote>$ curl -s <a href="https://packages.cloud.google.com/apt/doc/apt-key.gpg">https://packages.cloud.google.com/apt/doc/apt-key.gpg</a> | sudo apt-key add -</blockquote><blockquote>$ sudo touch /etc/apt/sources.list.d/kubernetes.list</blockquote><blockquote>$ echo “deb <a href="http://apt.kubernetes.io/">http://apt.kubernetes.io/</a> kubernetes-xenial main” | sudo tee -a /etc/apt/sources.list.d/kubernetes.list</blockquote><blockquote>$ sudo apt-get update</blockquote><blockquote>$ sudo apt-get install -y kubectl</blockquote><blockquote>Check if kubectl is installed or not:::::</blockquote><blockquote>$ kubectl cluster-info<br>Kubernetes master is running at <a href="https://192.168.99.100:8443/">https://192.168.99.100:8443</a><br>KubeDNS is running at <a href="https://192.168.99.100:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy">https://192.168.99.100:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy</a></blockquote><blockquote>To further debug and diagnose cluster problems, use ‘kubectl cluster-info dump’.</blockquote><p><strong>Install Hypervisor(KVM)</strong></p><blockquote>KVM is what i used, one can configure hypervisor using VirtualBOX(oracle)</blockquote><blockquote>$ sudo apt-get install qemu-kvm libvirt-bin virtinst bridge-utils cpu-checker</blockquote><blockquote>$ kvm-ok<br>INFO: /dev/kvm exists<br>KVM acceleration can be used</blockquote><p><strong>Installing Minikube</strong></p><blockquote>URL:: <a href="https://github.com/kubernetes/minikube/releases">https://github.com/kubernetes/minikube/releases</a></blockquote><blockquote>$ curl -Lo minikube <a href="https://storage.googleapis.com/minikube/releases/v0.28.2/minikube-linux-amd64">https://storage.googleapis.com/minikube/releases/v0.28.2/minikube-linux-amd64</a> &amp;&amp; chmod +x minikube &amp;&amp; sudo mv minikube /usr/local/bin/</blockquote><p><strong>Basic Get To know your Minikube commands:</strong></p><blockquote>Start docker ::</blockquote><blockquote>$ sudo service docker start</blockquote><blockquote>$ sudo service docker status</blockquote><blockquote>● docker.service — Docker Application Container Engine<br> Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)<br> Active: active (running) since Thu 2018–08–02 10:37:19 IST; 1h 4min ago<br> Docs: <a href="https://docs.docker.com/">https://docs.docker.com</a><br> Main PID: 1981 (dockerd)<br> Tasks: 32<br> Memory: 102.0M<br> CPU: 13.320s<br> CGroup: /system.slice/docker.service<br> ├─1981 /usr/bin/dockerd -H fd://<br> └─2045 docker-containerd — config /var/run/docker/containerd/containerd.toml</blockquote><blockquote>Start minikube ::</blockquote><blockquote>$ minikube start</blockquote><blockquote>$ minikube status</blockquote><blockquote>minikube: Running<br>cluster: Running<br>kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100</blockquote><blockquote>Get minikube dashboard::</blockquote><blockquote>$ minikube dashboard</blockquote><blockquote>get info regarding nodes present under your minikube::</blockquote><blockquote>$ kubectl get nodes</blockquote><blockquote>NAME STATUS ROLES AGE VERSION<br>minikube Ready master 1h v1.10.0</blockquote><blockquote>get info regarding pods present under your minikube::</blockquote><blockquote>$ kubectl get pods</blockquote><blockquote>NAME READY STATUS RESTARTS AGE<br>nginx-6bfb654d7c-fc9xn 1/1 Running 0 1h</blockquote><blockquote>(by default on your first run there will be no pods)</blockquote><blockquote>Check available namespaces::</blockquote><blockquote>$ kubectl get namespaces<br>NAME STATUS AGE<br>default Active 1h<br>kube-public Active 1h<br>kube-system Active 1h</blockquote><blockquote>Check pods based on namespaces ::</blockquote><blockquote>$ kubectl get pods — all-namespaces</blockquote><blockquote>NAMESPACE NAME READY STATUS RESTARTS AGE<br>default nginx-6bfb654d7c-fc9xn 1/1 Running 0 1h<br>kube-system default-http-backend-59868b7dd6-f7hms 1/1 Running 0 1h<br>kube-system etcd-minikube 1/1 Running 0 1h<br>kube-system kube-addon-manager-minikube 1/1 Running 0 1h<br>kube-system kube-apiserver-minikube 1/1 Running 0 1h<br>kube-system kube-controller-manager-minikube 1/1 Running 0 1h<br>kube-system kube-dns-86f4d74b45-rrbsn 3/3 Running 0 1h<br>kube-system kube-proxy-49wzf 1/1 Running 0 1h<br>kube-system kube-scheduler-minikube 1/1 Running 0 1h<br>kube-system kubernetes-dashboard-5498ccf677-gxd6p 1/1 Running 0 1h<br>kube-system nginx-ingress-controller-5984b97644-qr64t 1/1 Running 0 1h<br>kube-system storage-provisioner 1/1 Running 0 1h</blockquote><blockquote>Check availavle services ::</blockquote><blockquote>&lt;There are basically 2 commands to check services and last one for checking based on specific namespace&gt;</blockquote><blockquote>$ kubectl get svc<br>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE<br>kubernetes ClusterIP 10.96.0.1 &lt;none&gt; 443/TCP 1h<br>nginx NodePort 10.96.115.213 &lt;none&gt; 80:30557/TCP 1h</blockquote><blockquote>$ kubectl get services<br>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE<br>kubernetes ClusterIP 10.96.0.1 &lt;none&gt; 443/TCP 1h<br>nginx NodePort 10.96.115.213 &lt;none&gt; 80:30557/TCP 1h</blockquote><blockquote>$ kubectl get services -n default<br>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE<br>kubernetes ClusterIP 10.96.0.1 &lt;none&gt; 443/TCP 1h<br>nginx NodePort 10.96.115.213 &lt;none&gt; 80:30557/TCP 1h</blockquote><blockquote>( -n : namespace name , On first run there should not be any services except kubernates running)</blockquote><blockquote>Check availavle deployments ::</blockquote><blockquote>$ kubectl get deployments<br>NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE<br>nginx 1 1 1 1 1h</blockquote><blockquote>(For the first run there will be no deployments)</blockquote><blockquote>Delete deployment or service ::</blockquote><blockquote>$ kubectl delete deployment,service &lt;deployment_name/service_name&gt;</blockquote><blockquote>Check availave ingress::</blockquote><blockquote>$ kubectl get ingress<br>No resources found.</blockquote><blockquote>$ kubectl get ing<br>No resources found.</blockquote><blockquote>(ing/ingress does mean the same)</blockquote><blockquote>Delete ingress::</blockquote><blockquote>$ kubectl delete ingress &lt;ingress_name&gt;</blockquote><h3>Back in flask Deployment of my custom container</h3><p>Now we have to deploy the flask_app in Kubernetes:</p><p>for that, I need two yml file</p><p><strong>Deployment.yml</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*HbQ4_S7zhDadRT0zS1abXw.png" /></figure><blockquote>apiVersion: extensions/v1beta1<br>kind: Deployment<br>metadata:<br> name: flask<br>spec:<br> replicas: 1<br> template:<br> metadata:<br> labels:<br> app: flask<br> spec:<br> containers:<br> — name: flask<br> image: arani007/my-flask-image<br> ports:<br> — containerPort: 80<br> command: [“python”,”/flask-app/flask_docker.py”]<br> imagePullPolicy: Always</blockquote><p><strong>Service.yml</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*KJ69PzKfWMH75hBn0iec7Q.png" /></figure><blockquote>apiVersion: v1<br>kind: Service<br>metadata:<br> name: flask-svc<br>spec:<br> type: NodePort<br> ports:<br> — port: 5000<br> nodePort: 31080<br> selector:<br> app: flask</blockquote><p>Now we have to deploy our Deployment and service:</p><blockquote>$ kubectl create -f deployment.yml</blockquote><blockquote>$ kubectl create -f service.yml</blockquote><p>Check the deployment and service</p><blockquote>$ kubectl get pods</blockquote><blockquote>$ kubectl get svc</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*sGYSdwG7VbgRLiJ8IF7wpA.png" /></figure><p>Now as the service was node port it was automatically opened a port to host network</p><p>To get the service URL</p><blockquote>$ minikube service flask-svc — url<br><a href="http://192.168.99.100:31080/">http://192.168.99.100:31080</a></blockquote><p>open That link</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dzXnvrBj65o8cs7e6ji0xw.png" /></figure><p>Check Minikube Dashboard :</p><p>$ minikube dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qami5XlBIB4-zjcb4XmipQ.png" /></figure><p>That&#39;s a simple walkthrough of how Docker and Kubernetes Work.</p><p>Thanks for your patience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*iqF8visko9OmO6N2bWeO0w.jpeg" /></figure><p>Alternative Publication From same account in professional Profile:</p><p><a href="https://medium.com/@arani007/docker-and-kubernetes-the-beginners-introduction-7ff88328a7bb">docker and kubernetes The beginners introduction</a></p><p>My <a href="https://github.com/arani007">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e28fe38970d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-engineering-and-linux/docker-and-kubernetes-the-beginners-introduction-e28fe38970d1">docker and Kubernetes The beginner&#39;s introduction</a> was originally published in <a href="https://medium.com/data-engineering-and-linux">Data Engineering and Linux</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dev Ops]]></title>
            <link>https://medium.com/series/dev-ops-c8332bb8e51f?source=rss-a8cd986233ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8332bb8e51f</guid>
            <dc:creator><![CDATA[Arani Mukherjee]]></dc:creator>
            <pubDate>Thu, 30 Aug 2018 08:41:45 GMT</pubDate>
            <atom:updated>2018-08-30T08:41:45.974Z</atom:updated>
            <content:encoded><![CDATA[<h3>Docker and kubernetes The beginners introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*mRpQMJTSfbFVitTQtQtrMw.jpeg" /></figure><p>The Time has come when any big data developer must be concerned with containers and management of containers. Everything is moving towards decoupled development for higher scalability and maintainability. so it is going to be a De facto standard to understand and get accustomed with this technologies.</p><h3>Docker the introduction :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*glD7bNJG3SlO0_xNmSGPcQ.png" /></figure><p>Docker revolutionized the industry standard of how visualization can be handled for lightweight and easy development.</p><p>For the basics I personally recommend to read and understand <strong>How </strong><a href="https://searchservervirtualization.techtarget.com/definition/hypervisor"><strong>Hypervisor</strong></a><strong> Works</strong> and get to know how docker manages to deal with this and do the magic of containerizing anything and everything.</p><p>Some reads will help :</p><ol><li><a href="https://en.wikipedia.org/wiki/Linux_namespaces">Linux namespace</a>.</li><li><a href="https://en.wikipedia.org/wiki/LXC">Linux Containers (LXC)</a></li><li>Types of Hypervisors (Type 1 and 2) FYI just attaching a basic image</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*fy45l-aqYzB3jYCGToRbNA.png" /><figcaption>Type 1 and Type 2 Hypervisor</figcaption></figure><p>4. <strong>Docker architecture Vs Virtualization architecture</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WUH4iiAUvTzzx7jkKX5vsA.jpeg" /></figure><p>Here we can clearly see that docker simply removes the workload of a foreign operating system which in reality makes them light and less memory and process hungry without compromising the environment isolation.</p><p>Now the <strong>Question rises</strong> :</p><p>How we can communicate in between containers?</p><p>How we can manage containers and use them when they are needed so that we can <a href="https://docs.docker.com/engine/reference/commandline/pause/"><strong>Pause</strong></a><strong> </strong>them when not in use ?</p><p>Answer is either <a href="https://docs.docker.com/engine/swarm/"><strong>Docker Swarm</strong></a><strong> </strong>or <a href="https://kubernetes.io/"><strong>Kubernetes</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*bcGhuY5mBz29fnRxp__yTA.jpeg" /><figcaption>kubernetes VS Docker Swarm</figcaption></figure><p>It’s not exactly easy to compare Kubernetes with Docker Swarm as Docker Swarm is a simple and easy solution to work with whereas Kubernetes is targeted those who require full fledge support with higher complexity. Docker Swarm is preferred in environments where simplicity and fast development is favored. Whereas Kubernetes is suitable for environments where medium to large clusters are running complex applications.</p><p>As for our study I am going with Kubernentes.</p><h3>Kubernetes Introduction:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*P9KRHqxAz1fDJsYO105fPA.png" /><figcaption>basic architecture of Kubernetes</figcaption></figure><p>Developed by Google, kubernetes work as an cluster orchestration and management tool.</p><p>For learning purpose kubernetes comes with a solution for Single Node cluster i.e.<strong> </strong><a href="https://kubernetes.io/docs/setup/minikube/"><strong>minikube</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nmLlXo7cJLGg-q4pgJprAw.jpeg" /></figure><blockquote><strong>Hands on instructions</strong></blockquote><h3>Docker</h3><blockquote><strong>Installing Docker On Ubuntu</strong></blockquote><p>First, add the GPG key for the official Docker repository to the system:</p><p>$ curl -fsSL <a href="https://download.docker.com/linux/ubuntu/gpg">https://download.docker.com/linux/ubuntu/gpg</a> | sudo apt-key add -</p><p>Add the Docker repository to APT sources:</p><p>$ sudo add-apt-repository “deb [arch=amd64]<a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> $(lsb_release -cs) stable”</p><p>Next, update the package database with the Docker packages from the newly added repo:</p><p>$ sudo apt-get updat</p><p>ake sure you are about to install from the Docker repo instead of the default Ubuntu 16.04 repo:</p><p>$ apt-cache policy docker-ce</p><p>Now install Docker:</p><p>$ sudo apt-get install -y docker-ce</p><p>Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:</p><p>$ sudo systemctl status docker</p><blockquote><strong>Configuring Environment to easily work with docker</strong></blockquote><p>Add the docker group if it doesn’t already exist:</p><p>$ sudo groupadd docker</p><p>Add the connected user “$USER” to the docker group. Change the user name to match your preferred user if you do not want to use your current user:</p><p>$ sudo gpasswd -a $USER docker</p><p>Now you can easily do docker commands from your own user</p><blockquote><strong>Docker Commands</strong></blockquote><p>Start Docker Service:</p><p>$ sudo service docker start</p><p>View availavle images:</p><p>$docker images</p><p>View Running containers</p><p>$docker ps</p><p>View all docker containers (running &amp; stopped)<br>$docker ps -a</p><p>pulling an image from <a href="https://hub.docker.com/">docker hub</a></p><p>$docker pull &lt;imagename&gt;</p><p>e.g. $docker pull nginx</p><p>Running docker via port 80 :</p><p>$docker run — name test-nginx -p 80:80 nginx</p><p>attaching a file to nginx html directory and running in nginx server:</p><p>$docker run — name test-nginx -p 80:80 -d -v /home/thirdeye/html:/usr/share/nginx/html nginx <br> <br>accessing nginx :</p><p>$docker run -it nginx /bin/sh</p><p>Stopping Docker container:<br>$ docker stop contailner_id(find it from # docker ps)</p><p>FYI: to identify not running(created) containers: <br>$docker ps -a</p><p>Deleting docker container<br>$ docker rm comtainer_id</p><p>Deleting docker image<br>$ docker rmi image_id</p><blockquote><strong>Create your Own docker Image:</strong></blockquote><p>Creating a custom docker image for docker is a necessary skill because most of the cases you have to create your own Docker image and deploy it on cluster:</p><p>In docker we have to create a file named <strong>Dockerfile </strong>where we have to put all the info and steps to create a new image .</p><p>basically we first pull a base image and add our required packages and files to that and then create the custom image.</p><p>Here is an example</p><p>Here i am just deploying a python flask app in docker image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_HHXMUHKGE3jSOVmUNbuWw.png" /><figcaption>Folder Structure In docker build</figcaption></figure><blockquote><strong>Contents Of Dockerfile</strong></blockquote><p>FROM ubuntu:latest<br>MAINTAINER Arani Mukherjee <br>RUN apt-get update -y<br>RUN apt-get install -y python-pip python-dev build-essential<br>COPY . /flask-app<br>WORKDIR /flask-app<br>RUN pip install -r requirements.txt<br>EXPOSE 5000<br>ENTRYPOINT [“python”]<br>CMD [“flask_docker.py”]</p><blockquote><strong>Contents of requirements.txt file</strong></blockquote><p>Just mention python package names</p><p>flask<br>redis</p><blockquote><strong>Contents Of flask_docker.py</strong></blockquote><p>from flask import Flask<br>app = Flask(__name__)</p><p><a href="http://twitter.com/app">@app</a>.route(‘/’)<br>def hello_world():<br> return ‘Flask Dockerized by arani’</p><p>if __name__ == ‘__main__’:<br> app.run(debug=True,host=’0.0.0.0&#39;)</p><blockquote><strong>Now We have to build the docker image from the Dockerfile</strong></blockquote><p>$ cd directory/where/the/Dockerfile/is/kept</p><p>$ docker build -t “my_flask_image:Dockerfile” .</p><p>It will eventually pull the image and also download all required packages and add to the base image and finally create the custom image</p><p>Result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aforA7SLGLtpCHdRbmiwRw.png" /></figure><blockquote><strong>To deploy this image in kubernetes there are 2 ways:</strong></blockquote><blockquote>1 . Push the image in dockerhub or any private repository</blockquote><blockquote>2. Somehow make kubernetes use the local images for deployment</blockquote><blockquote>Now the easy one is pusing the image in DockerHub or any public repository</blockquote><blockquote>But in for ease of use you can use this way:</blockquote><blockquote>We have to somehow point a local docker build be automatically done in minikube space:</blockquote><blockquote>Step : 1 <br>$ eval $(minikube docker-env)</blockquote><blockquote>window 1<br>$ minikube ssh <br> $ docker images</blockquote><blockquote>window 2<br>$ docker images</blockquote><blockquote>check the o/p od window 1 and window 2 are same or not if yes then the work is done:</blockquote><blockquote>Now any docker build will automatically create docker image under minikube space</blockquote><h3>Minikube ( kubernetes Local single node cluster instance )</h3><blockquote><strong>Installation:(Acording to 2nd AUG, 2018)</strong></blockquote><p>STEP 1 : Install and configure docker</p><p>This is my docker info:::::::</p><p>$ sudo docker version<br>[sudo] password for user: <br>Client:<br> Version: 18.06.0-ce<br> API version: 1.38<br> Go version: go1.10.3<br> Git commit: 0ffa825<br> Built: Wed Jul 18 19:11:02 2018<br> OS/Arch: linux/amd64<br> Experimental: false</p><p>Server:<br> Engine:<br> Version: 18.06.0-ce<br> API version: 1.38 (minimum version 1.12)<br> Go version: go1.10.3<br> Git commit: 0ffa825<br> Built: Wed Jul 18 19:09:05 2018<br> OS/Arch: linux/amd64<br> Experimental: false</p><p>Machine Info :</p><p>Os: ubuntu 16.04LTS , RAM:8GB, Processor: intel core i3</p><h4>Installing kubectl</h4><blockquote>URL :: <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/">https://kubernetes.io/docs/tasks/tools/install-kubectl/</a></blockquote><blockquote>First and foremost : <br>Stop swap memory location because Kubernates requires swap to be disabled</blockquote><blockquote>$ sudo swapoff -a</blockquote><blockquote>Make a restart of your machine:</blockquote><blockquote>$ sudo init 6</blockquote><blockquote>Now install kubectl:::::</blockquote><blockquote>$ sudo apt-get update &amp;&amp; sudo apt-get install -y apt-transport-https</blockquote><blockquote>$ curl -s <a href="https://packages.cloud.google.com/apt/doc/apt-key.gpg">https://packages.cloud.google.com/apt/doc/apt-key.gpg</a> | sudo apt-key add -</blockquote><blockquote>$ sudo touch /etc/apt/sources.list.d/kubernetes.list</blockquote><blockquote>$ echo “deb <a href="http://apt.kubernetes.io/">http://apt.kubernetes.io/</a> kubernetes-xenial main” | sudo tee -a /etc/apt/sources.list.d/kubernetes.list</blockquote><blockquote>$ sudo apt-get update</blockquote><blockquote>$ sudo apt-get install -y kubectl</blockquote><blockquote>Check if kubectl is installed or not:::::</blockquote><blockquote>$ kubectl cluster-info<br>Kubernetes master is running at <a href="https://192.168.99.100:8443/">https://192.168.99.100:8443</a><br>KubeDNS is running at <a href="https://192.168.99.100:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy">https://192.168.99.100:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy</a></blockquote><blockquote>To further debug and diagnose cluster problems, use ‘kubectl cluster-info dump’.</blockquote><p><strong>Install Hypervisor(KVM)</strong></p><blockquote>KVM is what i used, one can configure hypervisor using VirtualBOX(oracle)</blockquote><blockquote>$ sudo apt-get install qemu-kvm libvirt-bin virtinst bridge-utils cpu-checker</blockquote><blockquote>$ kvm-ok<br>INFO: /dev/kvm exists<br>KVM acceleration can be used</blockquote><p><strong>Installing Minikube</strong></p><blockquote>URL:: <a href="https://github.com/kubernetes/minikube/releases">https://github.com/kubernetes/minikube/releases</a></blockquote><blockquote>$ curl -Lo minikube <a href="https://storage.googleapis.com/minikube/releases/v0.28.2/minikube-linux-amd64">https://storage.googleapis.com/minikube/releases/v0.28.2/minikube-linux-amd64</a> &amp;&amp; chmod +x minikube &amp;&amp; sudo mv minikube /usr/local/bin/</blockquote><p><strong>Basic Get To know your Minikube commands:</strong></p><blockquote>Start docker ::</blockquote><blockquote>$ sudo service docker start</blockquote><blockquote>$ sudo service docker status</blockquote><blockquote>● docker.service — Docker Application Container Engine<br> Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)<br> Active: active (running) since Thu 2018–08–02 10:37:19 IST; 1h 4min ago<br> Docs: <a href="https://docs.docker.com/">https://docs.docker.com</a><br> Main PID: 1981 (dockerd)<br> Tasks: 32<br> Memory: 102.0M<br> CPU: 13.320s<br> CGroup: /system.slice/docker.service<br> ├─1981 /usr/bin/dockerd -H fd://<br> └─2045 docker-containerd — config /var/run/docker/containerd/containerd.toml</blockquote><blockquote>Start minikube ::</blockquote><blockquote>$ minikube start</blockquote><blockquote>$ minikube status</blockquote><blockquote>minikube: Running<br>cluster: Running<br>kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100</blockquote><blockquote>Get minikube dashboard::</blockquote><blockquote>$ minikube dashboard</blockquote><blockquote>get info regarding nodes present under your minikube::</blockquote><blockquote>$ kubectl get nodes</blockquote><blockquote>NAME STATUS ROLES AGE VERSION<br>minikube Ready master 1h v1.10.0</blockquote><blockquote>get info regarding pods present under your minikube::</blockquote><blockquote>$ kubectl get pods</blockquote><blockquote>NAME READY STATUS RESTARTS AGE<br>nginx-6bfb654d7c-fc9xn 1/1 Running 0 1h</blockquote><blockquote>(by default on your first run there will be no pods)</blockquote><blockquote>Check available namespaces::</blockquote><blockquote>$ kubectl get namespaces<br>NAME STATUS AGE<br>default Active 1h<br>kube-public Active 1h<br>kube-system Active 1h</blockquote><blockquote>Check pods based on namespaces ::</blockquote><blockquote>$ kubectl get pods — all-namespaces</blockquote><blockquote>NAMESPACE NAME READY STATUS RESTARTS AGE<br>default nginx-6bfb654d7c-fc9xn 1/1 Running 0 1h<br>kube-system default-http-backend-59868b7dd6-f7hms 1/1 Running 0 1h<br>kube-system etcd-minikube 1/1 Running 0 1h<br>kube-system kube-addon-manager-minikube 1/1 Running 0 1h<br>kube-system kube-apiserver-minikube 1/1 Running 0 1h<br>kube-system kube-controller-manager-minikube 1/1 Running 0 1h<br>kube-system kube-dns-86f4d74b45-rrbsn 3/3 Running 0 1h<br>kube-system kube-proxy-49wzf 1/1 Running 0 1h<br>kube-system kube-scheduler-minikube 1/1 Running 0 1h<br>kube-system kubernetes-dashboard-5498ccf677-gxd6p 1/1 Running 0 1h<br>kube-system nginx-ingress-controller-5984b97644-qr64t 1/1 Running 0 1h<br>kube-system storage-provisioner 1/1 Running 0 1h</blockquote><blockquote>Check availavle services ::</blockquote><blockquote>&lt;There are basically 2 commands to check services and last one for checking based on specific namespace&gt;</blockquote><blockquote>$ kubectl get svc<br>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE<br>kubernetes ClusterIP 10.96.0.1 &lt;none&gt; 443/TCP 1h<br>nginx NodePort 10.96.115.213 &lt;none&gt; 80:30557/TCP 1h</blockquote><blockquote>$ kubectl get services<br>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE<br>kubernetes ClusterIP 10.96.0.1 &lt;none&gt; 443/TCP 1h<br>nginx NodePort 10.96.115.213 &lt;none&gt; 80:30557/TCP 1h</blockquote><blockquote>$ kubectl get services -n default<br>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE<br>kubernetes ClusterIP 10.96.0.1 &lt;none&gt; 443/TCP 1h<br>nginx NodePort 10.96.115.213 &lt;none&gt; 80:30557/TCP 1h</blockquote><blockquote>( -n : namespace name , On first run there should not be any services except kubernates running)</blockquote><blockquote>Check availavle deployments ::</blockquote><blockquote>$ kubectl get deployments<br>NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE<br>nginx 1 1 1 1 1h</blockquote><blockquote>(For the first run there will be no deployments)</blockquote><blockquote>Delete deployment or service ::</blockquote><blockquote>$ kubectl delete deployment,service &lt;deployment_name/service_name&gt;</blockquote><blockquote>Check availave ingress::</blockquote><blockquote>$ kubectl get ingress<br>No resources found.</blockquote><blockquote>$ kubectl get ing<br>No resources found.</blockquote><blockquote>(ing/ingress does mean the same)</blockquote><blockquote>Delete ingress::</blockquote><blockquote>$ kubectl delete ingress &lt;ingress_name&gt;</blockquote><h3>Back in flask Deployment of my custom container</h3><p>Now we have to deploy the flask_app in kubernetes:</p><p>for that I need two yml</p><p><strong>Deployment.yml</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*HbQ4_S7zhDadRT0zS1abXw.png" /></figure><blockquote>apiVersion: extensions/v1beta1<br>kind: Deployment<br>metadata:<br> name: flask<br>spec:<br> replicas: 1<br> template:<br> metadata:<br> labels:<br> app: flask<br> spec:<br> containers:<br> — name: flask<br> image: arani007/my-flask-image<br> ports:<br> — containerPort: 80<br> command: [“python”,”/flask-app/flask_docker.py”]<br> imagePullPolicy: Always</blockquote><p><strong>Service.yml</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*KJ69PzKfWMH75hBn0iec7Q.png" /></figure><blockquote>apiVersion: v1<br>kind: Service<br>metadata:<br> name: flask-svc<br>spec:<br> type: NodePort<br> ports:<br> — port: 5000<br> nodePort: 31080<br> selector:<br> app: flask</blockquote><p>Now we have to deploy our Deployment and service:</p><blockquote>$ kubectl create -f deployment.yml</blockquote><blockquote>$ kubectl create -f service.yml</blockquote><p>Check the deployment and service</p><blockquote>$ kubectl get pods</blockquote><blockquote>$ kubectl get svc</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*sGYSdwG7VbgRLiJ8IF7wpA.png" /></figure><p>Now as the service was nodeport it was automatically opened a pord to host network</p><p>To get the service url</p><blockquote>$ minikube service flask-svc — url<br><a href="http://192.168.99.100:31080/">http://192.168.99.100:31080</a></blockquote><p>open That link</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dzXnvrBj65o8cs7e6ji0xw.png" /></figure><p>Check Minikube Dashboard :</p><p>$ minikube dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qami5XlBIB4-zjcb4XmipQ.png" /></figure><p>Thats a simple walkthrow of how Docker and Kubernetes Work .</p><p>Thanks For your patience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*iqF8visko9OmO6N2bWeO0w.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8332bb8e51f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android vs iPhone the truth]]></title>
            <link>https://medium.com/@arani/android-vs-iphone-the-truth-c7f9fcf7b39b?source=rss-a8cd986233ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7f9fcf7b39b</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[iphone]]></category>
            <category><![CDATA[economy]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[marketing]]></category>
            <dc:creator><![CDATA[Arani Mukherjee]]></dc:creator>
            <pubDate>Mon, 25 Jun 2018 05:30:27 GMT</pubDate>
            <atom:updated>2018-06-25T05:37:59.215Z</atom:updated>
            <content:encoded><![CDATA[<p>the total population of earth is divided between 2 Operating System War for their smartphones Android and iOS(Apple). Though there is a huge fallacy in this war context. Lets try to break it down a little bit.</p><p>Android Phones are cheap , flexible , easy to use and easy to share (Mostly because if your friends and family also belongs to that user base).</p><p>On the other hand iPhone users are limited to usability and more of them are mostly costly and if you belong to mostly Asian third world country its expensive as hell.</p><p>But, yes we all can’t deny the performance and durability(except iPhone 6) for guaranteed from an iPhone.</p><p>Now stop being a fanboy and think clearly: How long do you use and android smartphone?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_oslaTEmZn9Tg6UfGmSvBA.jpeg" /></figure><p>Flagship: 2–3 years (probably), Mid range: 1–2 years and Low budget : hardly 1 year .</p><p>This time span actually plays the game for android smartphone markets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*KrHgyVHbU-ukTTxAkA8QVQ.png" /></figure><p>for even a flagship phone say Pixel or galaxy S8/s8+, it only lasts in the users hand for hardly 2 years though they costs nearly equal to iPhones of the same time span. Now for iPhone the story is different , keeping apart of battery problem even the iPhone 5s is getting latest iOS 12 Upgrade. So the users always get updated with the latest and greatest Operating System environment (Which is the main cause behind people buying new Android Phones).</p><p>Have you kept watch on how many devices are running latest Android Oreo ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/199/1*DArvI1E2J28kG9TIqg-xow.png" /></figure><p>its 5.7% according to wikipedia. Now for the record the next Android version Android P is 1–2 months away from launch.</p><p>For and iPhone You pay merely same as buying 2–3 Smartphones(Mid range). in return you get the stability, performance and support more than the Android counterpart.</p><p>Now the problem in Third World countries is : We cant afford to spent that huge amount of money in single time to buy an iPhone. Plus the modern scenario of most of people having Android smartphones will abandon you as for being a different species.</p><p>Now this is the deal-breaker for us (Android Users )and we are more than happy enough sacrificing our security and keeping our budgets end the meet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7f9fcf7b39b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why People are still afraid of using LINUX]]></title>
            <link>https://medium.com/data-engineering-and-linux/why-people-are-still-afraid-of-using-linux-95d21f849c1f?source=rss-a8cd986233ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/95d21f849c1f</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[open-source-software]]></category>
            <dc:creator><![CDATA[Arani Mukherjee]]></dc:creator>
            <pubDate>Fri, 22 Jun 2018 05:46:38 GMT</pubDate>
            <atom:updated>2018-06-22T05:58:42.151Z</atom:updated>
            <content:encoded><![CDATA[<p>LINUX the single project still moving the whole technology world is kind of out of touch from basic home users. It has more than enough capabilities. For the sake of future the way LINUX works is the only gateway to move forward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ztUK3qHSL9LosiwRJboeww.png" /></figure><p>Now the question is why most of the home / casual users don’t use LINUX ?</p><p>This following scenarios are common as for me :</p><p>1.It is hard to install LINUX</p><p>2. We can’t game on LINUX</p><p>3. The softwares are hard to get installed on my machine.</p><p>4.How do i get my old software(s) i am familiar with, in this new environment?</p><p>Actually I have observed the most impact goes to a user for the 4th clause.</p><p>As for Linus Torvalds the opinion behind this scenario is that most of the computer manufacturers do not tend or even think of bundling LINUX with their machines while they are made. Some of the companies like DELL has a service for bundling LINUX with their machines is some organisation explicitly order them to do so for their own purposes.</p><p>Now a days in some of laptops in India is bundled with Ubuntu (Again a canonical product Mehh..) to cut the cost of the product.</p><p>Now being a nontechnical person do you want to install a OS to your machine because you fear it as a risk of bricking that. The percentage of people who tend to change the OS of their devices (Even Smartphones) is very less even among technical peoples. Because of one reason: RISK.</p><p>As for the software installation process WINDOWS OS is the most backdated because they still use the method to download a software from Third Party Websites and install them which is a technology of the 90’s. LINUX package managers yum, apt are much more advanced and for the record YaST(SUSE LINUS) is heck of a package manager.</p><p>For gaming ::</p><p>yeah most of LINUX distros are not familier with games and you probably can’t play most Triple A games or evn older ones for two reasons:</p><p>1 from the old days companies generally do not port or produce games for LINUX</p><p>2 Games cant directly be sold for LINUX because the distro providing the 3rd Party games will have a general conflict with the GNU/GPL.</p><p>but GOOD NEWS!!!! go check out SteamOS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*saD-IxkTHyQeQDiyK4EiKA.jpeg" /></figure><p>For the visualisation part or the UX , LINUX is much more ahed of any competition. GNOME, KDE, BUDGIE, LXDE are just above the old and more or less same UI of WINDOWS OS or MAC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F_TUYJ-PKBjDRoJodeImJg.jpeg" /><figcaption>ZORIN OS</figcaption></figure><p>and more of all this LINUX is free to download , modify , source and distribute.</p><p>Hopefully the future will hold the promise .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95d21f849c1f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-engineering-and-linux/why-people-are-still-afraid-of-using-linux-95d21f849c1f">Why People are still afraid of using LINUX</a> was originally published in <a href="https://medium.com/data-engineering-and-linux">Data Engineering and Linux</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>