<?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 Bishoy Labib on Medium]]></title>
        <description><![CDATA[Stories by Bishoy Labib on Medium]]></description>
        <link>https://medium.com/@bishoylabib?source=rss-987a1149fd66------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9mzzroVH-qHD7CDk9vTXPQ.jpeg</url>
            <title>Stories by Bishoy Labib on Medium</title>
            <link>https://medium.com/@bishoylabib?source=rss-987a1149fd66------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 19:51:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bishoylabib/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[When NoSQL is better than a relational database]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/microservices-for-net-developers/when-nosql-is-better-than-a-relational-database-2e2e19e2723a?source=rss-987a1149fd66------2"><img src="https://cdn-images-1.medium.com/max/940/1*xNARt5LifAea1fqY77qQDQ.png" width="940"></a></p><p class="medium-feed-link"><a href="https://medium.com/microservices-for-net-developers/when-nosql-is-better-than-a-relational-database-2e2e19e2723a?source=rss-987a1149fd66------2">Continue reading on Microservices for .NET Developers »</a></p></div>]]></description>
            <link>https://medium.com/microservices-for-net-developers/when-nosql-is-better-than-a-relational-database-2e2e19e2723a?source=rss-987a1149fd66------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e2e19e2723a</guid>
            <category><![CDATA[entity-framework-core]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[database-design]]></category>
            <category><![CDATA[nosql]]></category>
            <dc:creator><![CDATA[Bishoy Labib]]></dc:creator>
            <pubDate>Mon, 10 Jul 2023 01:09:30 GMT</pubDate>
            <atom:updated>2023-08-27T07:26:39.069Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Choosing to be a Monolith, Cloud-Native or Cloud-Agnostic]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/microservices-for-net-developers/choosing-to-be-a-monolith-cloud-native-or-cloud-agnostic-707685ff1e3e?source=rss-987a1149fd66------2"><img src="https://cdn-images-1.medium.com/max/871/1*SiT_wbwBx_i_FunF3eL5Sg.png" width="871"></a></p><p class="medium-feed-snippet">Today&#x2019;s expectations of modern applications are growing and if you think of creating a new application you will have to make lots of&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/microservices-for-net-developers/choosing-to-be-a-monolith-cloud-native-or-cloud-agnostic-707685ff1e3e?source=rss-987a1149fd66------2">Continue reading on Microservices for .NET Developers »</a></p></div>]]></description>
            <link>https://medium.com/microservices-for-net-developers/choosing-to-be-a-monolith-cloud-native-or-cloud-agnostic-707685ff1e3e?source=rss-987a1149fd66------2</link>
            <guid isPermaLink="false">https://medium.com/p/707685ff1e3e</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Bishoy Labib]]></dc:creator>
            <pubDate>Sun, 04 Apr 2021 19:54:17 GMT</pubDate>
            <atom:updated>2023-07-09T21:43:29.630Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[.NET Logging in the microservices world]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/microservices-for-net-developers/net-logging-in-the-microservices-world-d08b5f6425f6?source=rss-987a1149fd66------2"><img src="https://cdn-images-1.medium.com/max/1236/0*JoMeJ-2QEvQRCF69.png" width="1236"></a></p><p class="medium-feed-snippet">In this article I&#x2019;ll take a deep dive into logging in the world of Microservices. Logging is one of the central aspects in a Microservices&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/microservices-for-net-developers/net-logging-in-the-microservices-world-d08b5f6425f6?source=rss-987a1149fd66------2">Continue reading on Microservices for .NET Developers »</a></p></div>]]></description>
            <link>https://medium.com/microservices-for-net-developers/net-logging-in-the-microservices-world-d08b5f6425f6?source=rss-987a1149fd66------2</link>
            <guid isPermaLink="false">https://medium.com/p/d08b5f6425f6</guid>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Bishoy Labib]]></dc:creator>
            <pubDate>Wed, 28 Aug 2019 05:42:59 GMT</pubDate>
            <atom:updated>2023-04-15T12:46:13.458Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Making Http easier with .NET Core]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/microservices-for-net-developers/making-http-easier-with-net-core-5d46dd805850?source=rss-987a1149fd66------2"><img src="https://cdn-images-1.medium.com/max/1097/1*m_G3S0KCIbbNmwxtrNruPw.png" width="1097"></a></p><p class="medium-feed-snippet">In this article, I&#x2019;m going to focus a bit about a few Http related behaviors in&#xA0;.NET that are needed in every microservice or API, but not&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/microservices-for-net-developers/making-http-easier-with-net-core-5d46dd805850?source=rss-987a1149fd66------2">Continue reading on Microservices for .NET Developers »</a></p></div>]]></description>
            <link>https://medium.com/microservices-for-net-developers/making-http-easier-with-net-core-5d46dd805850?source=rss-987a1149fd66------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d46dd805850</guid>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[dotnet-core]]></category>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[http-client]]></category>
            <dc:creator><![CDATA[Bishoy Labib]]></dc:creator>
            <pubDate>Thu, 22 Aug 2019 07:30:55 GMT</pubDate>
            <atom:updated>2019-08-28T05:44:49.647Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Making .NET Core more friendly to Microservices]]></title>
            <link>https://medium.com/microservices-for-net-developers/making-net-core-more-friendly-to-microservices-c0b68074e862?source=rss-987a1149fd66------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0b68074e862</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[aspnetcore]]></category>
            <category><![CDATA[dotnet]]></category>
            <dc:creator><![CDATA[Bishoy Labib]]></dc:creator>
            <pubDate>Fri, 16 Aug 2019 01:15:01 GMT</pubDate>
            <atom:updated>2019-08-28T05:44:09.850Z</atom:updated>
            <content:encoded><![CDATA[<h3>Making .NET Core more friendly to Microservices</h3><p>I’ve been working on Microservices for quiet some time now, using the dotnet core (mostly 2.2) to build APIs that call each others and would be consumed by front end. Facing a lot of challenges made me look for alternative solutions and ways to enhance the developer experience when building APIs with dotnet.</p><p>Example challenges comes in how to do logging from multiple application in a way that accessible, maintainable, searchable. Challenges in finding the root cause of a down time very quickly. Challenges in tracking and analyzing performance bottlenecks. Challenges in configuration management.</p><p>Some of the challenges can be solved using existing workarounds, that you just need to be aware that they exist. Some in my opinion should have been the default behavior but strangely are not. Others need some work to be dealt with and may be the opportunity to start a new open source project to solve.</p><p>So I decided I will start this series of articles that tackles these challenges one by one. Try to find existing solutions and workarounds. Then try to provide extensions for new solutions. And eventually will try to build a project template that will have all the best practices turned on by default. To give you a kick start in creating your dotnet core microservice.</p><h3>Reading list</h3><ol><li><a href="https://medium.com/microservices-for-net-developers/making-http-easier-with-net-core-5d46dd805850">Making Http easier with .NET Core</a></li><li><a href="https://medium.com/microservices-for-net-developers/net-logging-in-the-microservices-world-d08b5f6425f6">.NET Logging in the microservices world</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0b68074e862" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-for-net-developers/making-net-core-more-friendly-to-microservices-c0b68074e862">Making .NET Core more friendly to Microservices</a> was originally published in <a href="https://medium.com/microservices-for-net-developers">Microservices for .NET Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to run your DevOps using Kubernetes]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/microservices-for-net-developers/how-to-run-your-devops-using-kubernetes-e640a461d726?source=rss-987a1149fd66------2"><img src="https://cdn-images-1.medium.com/max/750/1*-8d8UuNpr0J82Bs8OVSYjg.png" width="750"></a></p><p class="medium-feed-snippet">This post is part of a series: Introduction to Microservices for&#xA0;.NET Developers</p><p class="medium-feed-link"><a href="https://medium.com/microservices-for-net-developers/how-to-run-your-devops-using-kubernetes-e640a461d726?source=rss-987a1149fd66------2">Continue reading on Microservices for .NET Developers »</a></p></div>]]></description>
            <link>https://medium.com/microservices-for-net-developers/how-to-run-your-devops-using-kubernetes-e640a461d726?source=rss-987a1149fd66------2</link>
            <guid isPermaLink="false">https://medium.com/p/e640a461d726</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Bishoy Labib]]></dc:creator>
            <pubDate>Fri, 09 Nov 2018 11:19:05 GMT</pubDate>
            <atom:updated>2023-07-09T21:43:55.338Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Exposing your application to the public (Ingress)]]></title>
            <link>https://medium.com/microservices-for-net-developers/exposing-your-application-to-the-public-ingress-c628c922e78b?source=rss-987a1149fd66------2</link>
            <guid isPermaLink="false">https://medium.com/p/c628c922e78b</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[ingress]]></category>
            <dc:creator><![CDATA[Bishoy Labib]]></dc:creator>
            <pubDate>Mon, 29 Oct 2018 15:41:38 GMT</pubDate>
            <atom:updated>2018-11-09T11:28:05.356Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Ingress?</h3><p>Ingress in IT terms are traffic coming from outside the network (or in our case the cluster) that wants to reach one of our internal services.</p><p>Previously we deployed an application hosted in Pod and have a Service pointing to it. But the Service was only internally accessible, like APIs that are going to be accessed from front-ends. But what about front-ends themselves that needs to be accessed by users from outside the cluster? The solution would be to forward all communication from port 80 on the host machine, to port 80 in the container/Pod.</p><p>But typically you want to run multiple applications inside a Kubernetes cluster. May be as simple as multiple websites, or as complex as a microservices solution. And typically these applications are hosted in different Pods/containers. The problem will arise when nodes in a cluster can only use one port 80 (or 443) to handle http, and that port can be assigned to one application. So the solution here is to have another application that handles all requests coming on port 80 and then route them internally to different applications using rules that checks for host name or path. That is the Ingress controller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9dIr28RAWUXXKAmUHxGP7Q.png" /><figcaption>Thanks to <a href="https://medium.com/u/2cac56571879">Ahmet Alp Balkan</a> for the diagram</figcaption></figure><p>So routing requests is the main function of the Ingress controller, though it usually can also provide these features:</p><ul><li>SSL termination</li><li>Authentication</li><li>IP whitelisting</li><li>Client rate limiting (throttling)</li><li>Logging and monitoring</li><li>Response caching</li><li>Web application firewall</li><li>GZIP compression</li><li>Servicing static content</li></ul><p>Also one thing to note, Ingress deployment, varies by where your cluster is deployed. For example:</p><ul><li>In your <strong>localhost </strong>cluster, you will need just one Pod for ingress that serves traffic of one port of your machine to the cluster (which is the sample below).</li><li>In your <strong>bare metal - multiple nodes</strong> cluster: you may want to deploy the Ingress controller as a <strong>DaemonSet </strong>(will describe it shortly below)<strong> </strong>in order to make sure that any traffic reaches port 80 of any node will be picked up by the Ingress.</li><li>In <strong>cloud providers</strong>: it’s handled differently, cause each cloud provider have the capability to use it’s own external IPs/load balancers and services. Some providers comes with NGINX Ingress controller like Google Kubernetes Engine. And here is <a href="https://docs.microsoft.com/en-us/azure/aks/ingress-basic">how to do it on Azure</a>.</li></ul><p>The below are Kubernetes terms that needs to be described first before trying to understand how to deploy Ingress:</p><h3>DaemonSets</h3><p>In Kubernetes, DaemonSets is similar to ReplicaSets but instead of defining number of replicas, it will always create a Pod per cluster node. So for a cluster with 4 nodes, it will guarantee that a Pod exists in every node even when new nodes are added later.</p><h3>NodePort</h3><p>When we define a Service in Kubernetes, one of the available <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types">service types</a> is <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport">NodePort</a> which allow the service to be exposed on a specific port of the host machine. For example if this service has 2 Pods in 2 different nodes, having NodePort: 80 makes the service exposed on port 80 of both physical nodes. So accessing one node with it’s external IP:80 will get to that port. Of course this comes with the limitation that port 80 of the host must not be used by multiple Pods.</p><p>Using DaemonSets and NodePort together is useful when we want to make sure that in all cluster nodes, port 80 is always handled by an ingress controller. So using them together will work in both localhost (1 node) scenario, and in multiple nodes bare metal (on premise), and <em>may be</em> on cloud, provided there is something that allows traffic to reach nodes.</p><h3>Using NGINX</h3><p>One of the most popular ingress servers is NGINX. In the following step, we are going to deploy nginx ingress as a DaemonSet and NodePort service (it opens 1 random port on your host machine) that direct traffic to inside your cluster.</p><p>Run the following commands sequentially to setup the NGINX ingress controller as a DaemonSet: (<a href="https://github.com/nginxinc/kubernetes-ingress/blob/master/docs/installation.md">Source</a>)</p><pre>kubectl apply -f <a href="https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/master/deployments/common/ns-and-sa.yaml">https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/master/deployments/common/ns-and-sa.yaml</a></pre><pre>kubectl apply -f <a href="https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/master/deployments/common/default-server-secret.yaml">https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/master/deployments/common/default-server-secret.yaml</a></pre><pre>kubectl apply -f <a href="https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/master/deployments/common/nginx-config.yaml">https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/master/deployments/common/nginx-config.yaml</a></pre><pre>kubectl apply -f <a href="https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/master/deployments/rbac/rbac.yaml">https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/master/deployments/rbac/rbac.yaml</a></pre><pre>kubectl apply -f <a href="https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/master/deployments/daemon-set/nginx-ingress.yaml">https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/master/deployments/daemon-set/nginx-ingress.yaml</a></pre><p>Run the following command to make sure the pod is running:</p><pre>kubectl get pods --namespace=nginx-ingress</pre><p>And open your dashboard and make sure you have this service under the namespace ingress-nginx</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v7AxdhMiEHx4Py05XiS2pg.png" /></figure><p>Note the random port assigned to the service after port 80. This is the nodePort.</p><p>You can open in your browser <a href="http://localhost:{port}/">http://localhost:{port}/</a> to see the following nginx 404 page to make sure we are able to reach the nginx ingress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*UXJ-aTn0hAy5RZkDn2Rn8Q.png" /></figure><p>Ideally you want the random port we used above to be port 80, but the default range allowed in Kubernetes is 30000–32767. To change this port range and allow 80, you will need to alter kubeadm config file on the master node. Which is too advanced for the purpose of this article. But if you want to do it, you can check (<a href="https://github.com/kubernetes/kubernetes/issues/11690">this issue</a>).</p><h3>Add Ingress rule</h3><p>Now let’s add a rule in the ingress to direct the traffic to the service we created in <a href="https://medium.com/microservices-for-net-developers/deploying-your-first-app-to-kubernetes-108d2c31ac3b">the previous article</a>.</p><pre>apiVersion: extensions/v1beta1<br>kind: Ingress<br>metadata:<br>  name: mysample-ingress<br>  annotations:<br>    kubernetes.io/ingress.class: &quot;nginx&quot;<br>spec:<br>  rules:<br>  - host: localhost<br>    http:<br>      paths:<br>      - path: /<br>        backend:<br>          serviceName: mysample-service<br>          servicePort: 80</pre><p>Now if you refresh the browser it will serve our sample service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QkJxhFHVCWR3VYkGBMiOqA.png" /></figure><p><strong>Important Note</strong></p><p>Please note there are multiple types of NGINX controllers, we used one that is managed by NGINX Inc., while there is another one NGINX managed by Kubernetes. Note the annotation that we used in the previous resource is unique to one of them.</p><p>For more information on how to write rules, check:</p><ul><li><a href="https://kubernetes.io/docs/concepts/services-networking/ingress/">Ingress</a></li><li><a href="https://github.com/nginxinc/kubernetes-ingress">NGINX Inc. Ingress</a></li></ul><h3>Istio Ingress</h3><p>Another alternative to NGINX ingress, is to use a service mesh. Istio and Linkerd are popular service meshes that takes control of all the cluster network traffic including ingress. It will need more future articles to cover the use of Istio.</p><h3>Read next</h3><p><a href="https://medium.com/microservices-for-net-developers/how-to-run-your-devops-using-kubernetes-e640a461d726">How to run your DevOps using Kubernetes</a> which includes versioning your containers, multiple environments and modifying container configurations per environment..</p><p>This article is part of the series <a href="https://medium.com/microservices-for-net-developers/introduction-91dfdaea465a">Introducting Microservices</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c628c922e78b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-for-net-developers/exposing-your-application-to-the-public-ingress-c628c922e78b">Exposing your application to the public (Ingress)</a> was originally published in <a href="https://medium.com/microservices-for-net-developers">Microservices for .NET Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying your first app to Kubernetes]]></title>
            <link>https://medium.com/microservices-for-net-developers/deploying-your-first-app-to-kubernetes-108d2c31ac3b?source=rss-987a1149fd66------2</link>
            <guid isPermaLink="false">https://medium.com/p/108d2c31ac3b</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[dashboard]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Bishoy Labib]]></dc:creator>
            <pubDate>Tue, 16 Oct 2018 00:57:56 GMT</pubDate>
            <atom:updated>2018-10-29T15:45:06.653Z</atom:updated>
            <content:encoded><![CDATA[<p>For introduction about Kubernetes first read: <a href="https://medium.com/microservices-for-net-developers/what-is-kubernetes-69281e4bc4b4">What is Kubernetes?</a></p><p>Lets admit that installing Kubernetes for the first time is not an easy task. Because it has multiple components, there are multiple paths (options) and the documentation varies between Windows/Linux/macOS.</p><p>Let’s start by saying that Kubernetes mainly runs on Linux, so production clusters will be hosted on Linux machines or VMs. While there are ways to install a one node cluster to your development PC that relies on a virtual machine if you are running Windows or macOS.</p><p>Luckily when we install Docker on Windows, it creates a virtual machine to run Linux containers (either using Hyper-V or Virtual Box). And also luckily that <a href="https://blog.docker.com/2018/07/kubernetes-is-now-available-in-docker-desktop-stable-channel/">Docker now supports Kubernetes out of the box</a>. So that’s the easiest way to run Kubernetes on Windows, using Docker..</p><h3>Installing Kubernetes on Windows (using Docker)</h3><p>Go to Docker: Settings &gt; Kubernetes &gt; Enable Kubernetes</p><p>That’s it! it just takes a few minutes to download many containers and start them, then it will say Kubernetes is running in the status circle below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*gh-6wxJGvQlCoQiyUwj-gA.png" /></figure><h3>Alternative way (using Minikube)</h3><p>The other way is <a href="https://kubernetes.io/docs/tasks/tools/install-minikube/">Minikube</a> but if you take a look at the <a href="https://kubernetes.io/docs/setup/minikube/">instructions document</a>, you would understand why it’s better to go for the Docker option!</p><h3>Real Production Clusters</h3><p>For real production clusters you go with one of these options:</p><ul><li><a href="https://cloud.google.com/kubernetes-engine/">Google Kubernetes Engine</a></li><li><a href="https://azure.microsoft.com/en-us/services/kubernetes-service/">Azure Kubernetes Service</a></li><li><a href="https://aws.amazon.com/eks/">Amazon Kubernetes Service</a></li><li><a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/">Install your own cluster (bumpy road ahead)</a></li><li><a href="https://kubernetes.io/docs/setup/pick-right-solution/">All the other options</a></li></ul><h3>Confirm your installation is working</h3><p>Whatever was the installation method you went for, most probably you already got Kubectl (the client command line tool to connect to Kubernetes) installed on your machine. You can confirm that by running:</p><pre>kubectl version</pre><p>If everything is working fine, it should give you 2 versions, one is the client version, and the server version or error connecting to cluster.</p><p>If the command is not installed on your machine, you can download it from <a href="https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/windows/amd64/kubectl.exe">this link</a>. It’s just an exe that you download and then you should add its location to your PATH environment variable. Here are the <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/">full instructions</a>.</p><p>If you get client version, but can’t connect to server, then you need to take a look at the configuration file that tells kubectl where is the cluster and how to authenticate to it.</p><p>Look for the file: C:\Users\&lt;username&gt;\.kube\config</p><p>It should contain the connection to your cluster, if you installed using docker or minikube it should be already populated, otherwise you should get it from the cloud provider, from inside you cluster’s master node config at same location, or retry the whole installation.</p><h3>First things to do in your cluster</h3><ol><li><strong>Dashboard</strong></li></ol><p>First thing to do is to run the Kubernetes Dashboard. The Dashboard allow you to see what’s happening in your cluster, whats running, check logs, get console access inside pods, delete things…etc.</p><p>Run the below command to install it. This downloads the dashboard container and runs it inside the cluster:</p><pre>kubectl create -f <a href="https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml">https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml</a></pre><p>Usually anything inside the cluster is not accessible from outside, so we run a proxy on our local machine to allow us access to inside:</p><pre>kubectl proxy</pre><p>Then you open this url into a browser: <a href="http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview">http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LePAbK_kk-H428HYEc5VCw.png" /><figcaption>Kubernetes Dashboard UI</figcaption></figure><p>In the dashboard you will notice that there multiple namespaces, default is an empty namespace that you can use to install your apps. Another notable namespace is kube-system, this one has the Kubernetes system containers and services (including the dashboard that we just installed).</p><p><strong>2. NGINX Ingress Controller (skip if on cloud)</strong></p><p>I know this is getting more complicated, but you need one more thing to save you the trouble of not knowing what to look for later. You may not need this step if you are using a cloud based cluster since it may already be handled. But if you are creating your own cluster or want to try Ingress locally on your PC, then it’s better to use this basic step to setup Ingress controller to allow later tutorials to work.</p><p>When you deploy your app as a “Pod” it gets a random local IP each time, that is only accessible from inside your cluster. Then you create a “Service” to allow other Containers/Pods to access your service by name (not knowing it’s IP). This only works for services that needs to be internally accessible, like APIs that are going to be accessed from front-ends. But what about front-ends themselves that needs to be accessed by users from outside the cluster?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9dIr28RAWUXXKAmUHxGP7Q.png" /><figcaption>Thanks to <a href="https://medium.com/u/2cac56571879">Ahmet Alp Balkan</a> for the diagram</figcaption></figure><p>Here comes the name Ingress (allowing external traffic to go inside the cluster, routing it to the correct service internally). So you can deploy as many apps as you want inside the cluster (but say only one process can gain access to the port 80 on the physical machine/cluster node). So you deploy an ingress Pod in this basic example, it’s an NGINX web server, that listen to the actual physical port 80 on the cluster nodes, and then configure it to route traffic the rest of apps. Sometimes routing work using different host names (for example foo.com goes to foo service, and bar.com goes to bar service). Or it can work using Urls (like http://cluster/foo/… goes to foo service and http://cluster/bar/… goes to bar service).</p><p><strong>Updated</strong>: for more details on deploying NGINX Ingress, check the <a href="https://medium.com/microservices-for-net-developers/exposing-your-application-to-the-public-ingress-c628c922e78b">ingress article</a>.</p><h3>Deploy your first app</h3><p>Now it’s finally time to deploy our first app. For simplicity, I’ll use the sample asp.net core website that doesn’t need a database. Create a file named <strong>mysample.yaml</strong> with the following content:</p><pre>kind: Service<br>apiVersion: v1<br>metadata:<br>  name: mysample-service<br>spec:<br>  selector:<br>    app: mysample<br>  ports:<br>  - protocol: TCP<br>    port: 80<br>    targetPort: 80<br>---<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: mysample-deployment<br>  labels:<br>    app: mysample<br>spec:<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>      app: mysample<br>  template:<br>    metadata:<br>      labels:<br>        app: mysample<br>    spec:<br>      containers:<br>      - name: mysample<br>        image: <strong>microsoft/dotnet-samples:aspnetapp</strong><br>        ports:<br>        - containerPort: 80</pre><p>This file describes 2 Kubernetes objects:</p><ol><li>Service: with the name mysample-service that direct traffic to this service to any Pod with label mysample. It’s recommended that you define services before Pods.</li><li>Deployment: with a name and label (it’s good to use a lot of labels for your objects to be able to select them later). And it defines that we need a replica set with 2 instances of this Pod template, and define that we need to match Pods with our label. Then define the template which has a spec saying the required container image (here is an image from Docker Hub), and we define that we expose port 80.</li></ol><p>To deploy this you need to execute the following command:</p><pre>kubectl apply -f mysample.yaml</pre><p>Since we are not specifying a namespace (not in yaml nor in the kubectl command) the default namespace will be used. Here is what it looks like in the dashboard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*CnTIeR7rtxbY_6NHLdwBpg.png" /><figcaption>Sample deployment on the Dashboard</figcaption></figure><p>Note that the service is currently only available from inside the cluster network, which means we will not be able to browse it directly and will have to use the proxy to test it. Here is the url to open it using the proxy (assuming “kubectl proxy” command is running). Note the namespace and service name in the url:</p><p><a href="http://localhost:8001/api/v1/namespaces/default/services/http:mysample-service:/proxy/#!/">http://localhost:8001/api/v1/namespaces/default/services/http:mysample-service:/proxy/#!/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lZHVo3rkx4_bno5YPGfwGQ.png" /></figure><p>You have deployed your first app to Kubernetes!</p><p>Read more</p><p>To understand more details about these objects, checkout these docs:</p><ul><li><a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/">Pods</a></li><li><a href="https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/">ReplicaSet</a></li><li><a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">Deployments</a></li><li><a href="https://kubernetes.io/docs/concepts/services-networking/service/">Services</a></li></ul><h3>Read next</h3><p><a href="https://medium.com/microservices-for-net-developers/exposing-your-application-to-the-public-ingress-c628c922e78b">How to expose your application through ingress</a></p><p>This article is part of a <a href="https://medium.com/microservices-for-net-developers/introduction-91dfdaea465a">series about Microservices</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=108d2c31ac3b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-for-net-developers/deploying-your-first-app-to-kubernetes-108d2c31ac3b">Deploying your first app to Kubernetes</a> was originally published in <a href="https://medium.com/microservices-for-net-developers">Microservices for .NET Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Kubernetes?]]></title>
            <link>https://medium.com/microservices-for-net-developers/what-is-kubernetes-69281e4bc4b4?source=rss-987a1149fd66------2</link>
            <guid isPermaLink="false">https://medium.com/p/69281e4bc4b4</guid>
            <category><![CDATA[concept]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Bishoy Labib]]></dc:creator>
            <pubDate>Sat, 06 Oct 2018 11:47:35 GMT</pubDate>
            <atom:updated>2018-10-16T00:59:55.387Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*ozVZiFEAXJw8VY0jnr_Ehg.png" /></figure><p>After deciding on implementing your cloud service using microservices architecture. The next step is Kubernetes. Think of it as the operating system of the cloud. Your application will no longer run on a single machine, so instead of a single machine operating system like Windows or Linux. You now need an operating system that runs your apps across multiple nodes in cluster.</p><h3>Why do I need Kubernetes?</h3><p>When you compose your application from multiple small services that needs to be deployed into multiple nodes (say hundreds). You will need to find a way to deploy your services automatically. You want to specify requirements of your service and decide which nodes to select to deploy.</p><p>When one node goes down (which will happen) you need something to monitor that and automatically provision all services that were running on this node, into other nodes.</p><p>When you need to scale one service (because of high traffic) you need something to automatically scale it into multiple other nodes, and distribute traffic coming from other services or from outside the cluster, into multiple instances of each service that is running in different locations.</p><p>You want to be able to deploy newer versions of your service using a rolling update without down time. And be able to roll back your deployment in case of any trouble.</p><p>You need to be able to discover what services/versions are deployed in your cluster and be able to communicate with them regardless of them being scaled, upgraded, moved around from node to others.</p><p>And since your applications are packaged as containers (whether it’s yours, or dependencies your application needs like nginx, redis, rabbitmq…) you need your cluster operating system to be designed mainly to run containers.</p><h3>Why choose Kubernetes?</h3><p>Because it’s the industry standard. Invented by Google, run by the open source community and adopted by Microsoft and Amazon. You don’t find this happening too much.</p><p>So you design your application to run inside Kubernetes, and you get to run it on-premise and on any public cloud without changing anything. That’s because it abstract a lot of cloud functionality in a standard format.</p><h3>Tell me more..</h3><p>Kubernetes is a bit complex, it has a few concepts to understand. Lets start by explaining some Kubernetes concepts here, then in the next post we will go through installation and trying a few demos.</p><h3>Cluster concepts</h3><p>First let’s agree that a Kubernetes cluster consists of of nodes (real machines or VMs). One or more of these nodes are master(s) which control the others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*djM3-pzA_FgaAccAjfBiVg.png" /><figcaption>Kubernetes cluster</figcaption></figure><p>Each node has an app called <strong>kubelet</strong> that communicates to the cluster master node, take commands and controls the containers running inside the node. Each node also uses <strong>docker</strong> to run the containers.</p><p>The master node, has a kubelet plus an API server which provides REST APIs to control objects in Kubernetes. Then as a user who wants to run something, you use an app called <strong>kubectl </strong>which is a client command line tool that runs on your PC and allows you to submit commands to the Kubernetes APIs. We will go into more details about kubectl in the next post.</p><p>One more thing to note before moving from here, is that each node in the cluster obviously has an IP address, MAC address and can communicate together and with external network/internet. This is the external network of cluster. On the other hand, inside the cluster there is an internal virtual network. That will assign a different space of network IPs to the containers inside. The internal cluster network, allows different containers to communicate with each other using internal IPs. And if they want to expose services to the outside world, we must use something to expose that, coming shortly.</p><h3>Pods</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*98KmDvC1pnqdGJnvWuRqlQ.png" /><figcaption>Pods inside a Node</figcaption></figure><p>First unit of deployment in Kubernetes is a Pod. A pod is an abstraction of a machine. It has an IP address. It can host one or more containers. It can have one or more volumes attached as the disk of this Pod. All containers inside a Pod, share the network address and the disk.</p><p>Usually a Pod will host a single application as a container, but in some scenarios it can have multiple other containers that provide added benefits like a container that collect logs from the main container, or a container that acts as a proxy for the main container.</p><p>A Pod (or most of Kubernetes objects) are tagged with labels. Labels are key value pairs that identify the Pods. Like app=website, version=v1. So that later when we want to refer to multiple Pods we can select them where app=website, this will select all Pods in this app with any version.</p><p>Pods are mortal, which means they can die, and usually no one deploys a Pod, or communicate to a Pod directly using its IP. There are 2 more things that are needed to make use of a Pod. <strong>ReplicaSets </strong>to manage deployments/scaling and <strong>Services to expose </strong>.</p><h3>ReplicaSets</h3><p>A ReplicaSet is a Kubernetes controller, which runs in the background and makes sure that there are specific number of Pods running from a specific application. For example we need a web application to have 2 instances running at the same time. This means we will create a ReplicaSet with a Pod template that runs our web application container, and tells the ReplicaSet that we need 2 instances. Once we defined this in Kubernetes as the <strong>desired state</strong> (you will hear this word a lot), the ReplicaSet will now create 2 Pods using this template, and it will keep monitoring if one of them goes down for any reason, it will kill it and will create a new Pod instead. Whenever you need to scale this web application to 3 instances, you will modify the ReplicaSet number of replicas property which indicates the desired state and the ReplicaSet will always try to achieve this state by provisioning new Pods or removing Pods.</p><p>Note that ReplicaSets are only concerned about deploying, monitoring and scaling Pods.</p><h3>Services</h3><p>Although you can access a Pod using its IP, for example 10.0.0.4:80 you shouldn’t do that because a Pod is not permanent and its IP as well. Also what will you use to access a group of Pods? You need a service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*u_-dHjAyW45Uy4HuA4Hg7g.png" /><figcaption>Services in Kubernetes</figcaption></figure><p>A service provides a permanent IP and DNS name for a group of Pods. So if your web application exposes port 80 on 2 Pods. You should create a service named “WebServer” for example with port 80, this service will have its own IP inside the cluster that will not change by changing the Pods inside, and will have a DNS name that will be accessible inside the cluster network and will forward traffic (TCP, http or any protocol) to the underlying Pods.</p><p>A service refers to the backend Pods by using labels, as per the earlier example a service with label app=website will route traffic to all Pods having this label. This will allow other services inside the cluster to access <a href="http://webserver/">http://WebServer:80/</a> to reach any Pod inside that group without caring about where they are hosted, their IPs and how many are they.</p><p>Services simplify network communications for a microservices architected solution.</p><h3>Deployments</h3><p>Last thing to care about for now is deployments. A deployment in Kubernetes consists of a ReplicaSet with its Pod template. Consider that we have a ReplicaSet “A” with V1 of our app. And we want to deploy V2. We can update the ReplicaSet to use the new version of our container, but this will cause all V1 Pods to be killed immediately at the time we are provisioning the new V2 Pods. If we don’t want to disrupt our service like that, we create a deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*c8D_xBb70Z0JUdB075RZug.png" /></figure><p>The deployment will create a new ReplicaSet B of the V2 template with only 1 instance. And once this instance got created, it will scale down ReplicaSet A by 1 instance, and will keep doing that scaling up B and scaling down A, until B is fully populated and healthy and A reaches 0 instances. This is called rolling update deployment and helps keeping the old version of the service running while the new version is being provisioned.</p><h3>Wrapping up..</h3><p>We went through most of the basic concepts of Kubernetes and now we understand to deploy our application we will need a Deployment with a ReplicaSet, Pod template with a container image exposing ports and a Service that expose the Pods as a unique load balanced IP:port.</p><h3>Read next</h3><p>I guess you are all eager to try it out in person. Next post, we will go through <a href="https://medium.com/microservices-for-net-developers/deploying-your-first-app-to-kubernetes-108d2c31ac3b">installing Kubernetes and trying out a few demos</a>.</p><p>This article is part of a series: <a href="https://medium.com/microservices-for-net-developers/introduction-91dfdaea465a">Introduction to Microservices for .NET developers</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69281e4bc4b4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-for-net-developers/what-is-kubernetes-69281e4bc4b4">What is Kubernetes?</a> was originally published in <a href="https://medium.com/microservices-for-net-developers">Microservices for .NET Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is microservices and why is it different?]]></title>
            <link>https://medium.com/microservices-for-net-developers/what-is-microservices-and-why-is-it-different-fac017cb8cf4?source=rss-987a1149fd66------2</link>
            <guid isPermaLink="false">https://medium.com/p/fac017cb8cf4</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[netflix]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Bishoy Labib]]></dc:creator>
            <pubDate>Tue, 25 Sep 2018 15:03:57 GMT</pubDate>
            <atom:updated>2018-10-06T11:51:12.813Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*xYzqtvimb_ifdHDCSrbCmw.png" /></figure><h3><strong>Definition</strong></h3><p>Microservices architecture is a flavor of service oriented architecture, where you decompose a big application into multiple small services. It’s opposite to Monolithic architecture, where you have a single repository/team working on the same application.</p><p>What differentiates it is that it gives more emphasis on:</p><ul><li>Hard boundaries between services</li><li>Different teams maintain each service, with different deployment timelines that are not coordinated</li><li>They don’t share the same choice of technology or database</li></ul><h3>Pros</h3><ul><li>Suitable for large teams and large projects</li><li>The team working on a single service is a small agile team that should be 5–10 including all roles (can be fed with 2 pizzas :)</li><li>Each team is autonomous, can provide new features and deploy them on their own without coordinating multiple services deployment at a time</li><li>When a new technology or database needs to be adopted it can be done on the scale of one service, without having to re-engineer the whole application</li><li>Gives much control over scalability where each service can be scaled separately</li></ul><h3>Cons</h3><ul><li>Not suitable for a small project or a small team</li><li>Hard to define boundaries between services where they shouldn’t be too dependent or chatty</li><li>Introduces more complexity in the design, implementations, monitoring so a team should be ready to tackle a lot of new challenges as they progress</li></ul><h3>Why is it trending now?</h3><p>Being used and promoted by big names like Amazon, Netflix, Uber… It allowed them to reach the right balance between agility and high service level objectives which puts every other competitor behind. So it’s embrace it or disappear. Also advances in Docker containers and orchestrators, allowed the number of services to increase reaching thousands to hundred thousands instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*tf0ZfDAcMxibL1mbZVP_XA.gif" /><figcaption>Netflix traffic flowing through microservices</figcaption></figure><h3>Let’s get started</h3><p>To get started from here, we need to go step by step. Here is a high level overview of how to build microservices architecture for your product.</p><ul><li><strong>Build a single microservice:</strong> for me I use .NET Core as the run-time, <a href="https://aspnetboilerplate.com/">ASP.NET Boilerplate</a> to provide a framework for domain driven design and <a href="https://swagger.io/">swagger </a>to expose API documentations.</li><li><strong>Docker containers:</strong> to ship each service, I push it to a container registry.</li><li><a href="https://kubernetes.io/"><strong>Kubernetes</strong></a>: to host these individual services, making sure they scale according to needs and maintain their provisioning when a server goes down. Kubernetes takes care of service discover-ability, network and rolling updates. It provides the operating system that gives me flexibility to run my product on any cloud or on any data center.</li><li><strong>Use managed databases</strong>: like SQL Azure or Cosmos DB in case of hosting on Azure.</li><li><a href="https://istio.io/"><strong>Istio </strong></a><strong>or </strong><a href="https://linkerd.io/"><strong>Linkerd</strong></a>: as a service mesh, which handles ingress, routing, resiliency, circuit breaker and monitoring capabilities to the traffic going through the whole setup.</li><li><a href="https://grpc.io/"><strong>gRPC</strong></a>: for high performance inter-service communication.</li></ul><p>I bet this is too much to take at once. So I’ll start by explaining Kubernetes the most important piece of it all, from installation to deploying your first app and then running DevOps.</p><h3>A good read</h3><p>This is a very good online read from Microsoft that talks about <a href="https://docs.microsoft.com/en-us/azure/architecture/microservices/">designing, building and operating microservices on Azure with Kubernetes</a>. If you read it before continuing this series, as it highlights the challenges facing a microservices architecture and gives recommendation on how to handle them.</p><h3>Read next..</h3><p>Our next subject would be <a href="https://medium.com/microservices-for-net-developers/what-is-kubernetes-69281e4bc4b4">Kubernetes</a>..</p><p>And here is the list of articles in this series <a href="https://medium.com/microservices-for-net-developers/introduction-91dfdaea465a">Introduction to Microservices for .NET developers</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fac017cb8cf4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microservices-for-net-developers/what-is-microservices-and-why-is-it-different-fac017cb8cf4">What is microservices and why is it different?</a> was originally published in <a href="https://medium.com/microservices-for-net-developers">Microservices for .NET Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>