<?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 Mourad KHAIRANE on Medium]]></title>
        <description><![CDATA[Stories by Mourad KHAIRANE on Medium]]></description>
        <link>https://medium.com/@mourad-khairane?source=rss-18e6a9aefe71------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*q8u8PN_4wUTiHOEO2nZ_fQ.jpeg</url>
            <title>Stories by Mourad KHAIRANE on Medium</title>
            <link>https://medium.com/@mourad-khairane?source=rss-18e6a9aefe71------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 00:08:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mourad-khairane/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[The journey to the CKAD and CKA certifications]]></title>
            <link>https://mourad-khairane.medium.com/from-a-side-hustle-to-a-certified-kubernetes-developer-8ded50ff316f?source=rss-18e6a9aefe71------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ded50ff316f</guid>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[certification]]></category>
            <dc:creator><![CDATA[Mourad KHAIRANE]]></dc:creator>
            <pubDate>Wed, 05 Oct 2022 16:23:20 GMT</pubDate>
            <atom:updated>2023-05-31T09:02:10.570Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hHJ_UBSA3_I5V9df1c4w7w.png" /><figcaption><a href="https://www.elastic.co/blog/implementing-kubernetes-observability-security-opentelemetry">Image source</a></figcaption></figure><p>Hello everyone, I’m back with this new writing to explain how I achieved my <strong><em>CKAD</em></strong> and <strong><em>CKA</em></strong> certifications in the first attempt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44SvhBajHJCbP4noqDmMNQ.png" /><figcaption>CKA and CKAD badges</figcaption></figure><p>Kubernetes (K8S) got my attention since it’s early stages, it’s a powerful software that handles a lot of patterns in the cloud-native world.</p><h3>Get confortable with CKAD and CKA:</h3><p>My first contact with K8S was the <a href="https://www.oreilly.com/library/view/certified-kubernetes-application/9780136677628/">course</a> of Sander van Vugt, it’s a step by step course that explains the building blocks of K8S (PODs, Deployments, Jobs, Services to name a few). After taking this courses I kept practicing the learnt knowledge to solve some online exercices and I’ve worked with a client that uses K8S as an orchestration engine to host workloads, it was a good opportunity to apply what I’ve learnt previously in a real world project. I’ve ended up working as a DevOps for 6 months on a proof of trading application running in K8S.</p><p>When I finished this experience I’ve decided to take a <a href="https://kodekloud.com/blog/certified-kubernetes-application-developer-course/">Second CKAD Course</a> and <a href="https://kodekloud.com/courses/certified-kubernetes-administrator-cka/">CKA course</a> which I highly recommend to anyone planning to take the <strong><em>CKAD</em></strong> and <strong><em>CKA</em></strong> certifications. A well conceived courses with great animations and analogies with real world scenarios which helps in comprehending some complexe concepts in K8S such as networking between workloads, traffic routing, deployment strategies, Network policies, Node affinity …etc</p><p>Also these courses contains hands on labs which is a pre-requisite when it comes to passing the exam, since the exam is a 2 hours hands-on, you should be very comfortable with <strong><em>Kubectl</em></strong> utility, so practice is your only way to be fast. Be sure to do as many repetitions as needed before jumping to the next step. I’ve pushed my solutions to the <strong><em>CKAD</em></strong> mock and lightning tests to my github under this <a href="https://github.com/khairaneMurad/ckad">repository</a>.</p><h3>Hands-on resources for more practice:</h3><p>2 or 3 weeks before taking the exam, I would recommend to block at lease 1hour/day and try to solve some challenges from the following list of resources:</p><ul><li><strong><em>kodecloud </em></strong><a href="https://kodekloud.com/courses/kubernetes-challenges/">kubernetes challenges</a> which simulates a real world architecture and problems . If you struggle in the solution to these challenges, I’ve got your back (check this <a href="https://github.com/khairaneMurad/K8SChallenges">repository</a>). please note that the first 2 problems are more <strong><em>CKA</em></strong> than <strong><em>CKAD. </em></strong>(free)</li><li><strong><em>kodecloud</em></strong> new <a href="https://kodekloud.com/courses/ultimate-certified-kubernetes-administrator-cka-mock-exam/">CKA mock exams series</a></li><li><strong><em>Killrcoda</em></strong> <a href="https://killercoda.com/killer-shell-ckad">CKAD scenarios</a>. (free)</li><li><strong><em>Killrcoda</em></strong><a href="https://killercoda.com/killer-shell-cka"> CKA scenarios</a>. (free)</li></ul><p>Once you’ve completed the previous steps you can proceed to Killer.sh. When you buy the exams voucher you have also 2 sessions of <strong><em>killer.sh</em></strong> which is a simulation test that you passe under 2 hours on the same environnement as the real test. so make sure you’re ready enough before taking these mock sessions. Also, when you finish the killer.sh sessions go through the solutions because sometimes you may spend a lot of time thinking about a solution in declarative way while the imperative one is much faster and safer than making changes in YAML.</p><p>I’ve covered all the steps that took me to achieve the <strong><em>CKAD</em></strong> and the <strong><em>CKA</em></strong> with a score of 81% and 85% respectively.</p><h3>Conclusion:</h3><p>Honestly taking the exams for these certifications is very interesting and challenging, but what I’ve enjoyed the most is the journey that took me to this achievement. I’ve learnt a lot of interesting concepts and patterns in the cloud native world and I believe that there’s more to learn out there.</p><p>So that’s it for me, I hope you’ve enjoyed this lecture, now it’s your turn to shine and start enjoying the journey.</p><h4>Links to the CKA and CKAD badges:</h4><ul><li><a href="https://www.credly.com/badges/c2e65b79-641c-43d5-94b0-0bb9fad814f6/public_url">CKA: Certified Kubernetes Administrator was issued by The Linux Foundation to Mourad KHAIRANE.</a></li><li><a href="https://www.credly.com/badges/51e865fc-e08d-41bd-9e53-826ee4c2df11/public_url">CKAD: Certified Kubernetes Application Developer was issued by The Linux Foundation to Mourad KHAIRANE.</a></li></ul><h4>More articles about Kubernetes:</h4><p><a href="https://medium.com/@mourad-khairane/deploy-a-spring-boot-application-into-kubernetes-661cb07c2c88">https://medium.com/@mourad-khairane/deploy-a-spring-boot-application-into-kubernetes-661cb07c2c88</a></p><p><a href="https://medium.com/@mourad-khairane/consuming-kubernetes-deployed-microservice-using-services-dba32a2d88b8">https://medium.com/@mourad-khairane/consuming-kubernetes-deployed-microservice-using-services-dba32a2d88b8</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ded50ff316f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Consuming Kubernetes deployed Microservice using Services]]></title>
            <link>https://medium.com/swlh/consuming-kubernetes-deployed-microservice-using-services-dba32a2d88b8?source=rss-18e6a9aefe71------2</link>
            <guid isPermaLink="false">https://medium.com/p/dba32a2d88b8</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[publishing-services]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[services]]></category>
            <dc:creator><![CDATA[Mourad KHAIRANE]]></dc:creator>
            <pubDate>Mon, 16 Nov 2020 11:07:56 GMT</pubDate>
            <atom:updated>2022-10-04T11:09:53.083Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dJizxglinrWmVbwh" /><figcaption>Photo by <a href="https://unsplash.com/@pericakalimerica?utm_source=medium&amp;utm_medium=referral">Pero Kalimero</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hello Folks,</p><p>In the previous <a href="https://mourad-khairane.medium.com/deploy-a-spring-boot-application-into-kubernetes-661cb07c2c88">article</a>, we discussed how to deploy our simple application into a K8S cluster. Feel free to have a quick look at it, because it would help in this article in which we will explain how to consume the deployed application from the previous article.</p><p>We left the last article with this challenge in mind:</p><blockquote>How we can consume our hello endpoint from two running instances of the same application with different IP addresses ?</blockquote><p>Obviously, the automatic answer was to place a load balancer and it’s the right answer. but it’s not the only way to access a deployed application in K8S. In fact, a Load balancer is just one of the four types of services that are available for use in K8S, these four types are :</p><p><strong><em>NodePort</em></strong><em>:</em> here we expose our application to the node in which our PODs are running.</p><p><strong><em>ClusterIP</em></strong>: here our application is only accessible in the K8S private network and can’t be accessed from the outside world.</p><p><strong><em>LoadBalancer</em></strong>: the type that’s most used in production because we can have multiple instances running in different nodes inside the K8S cluster. to use this type we should route the traffic from the external IP address to the cluster network in order to deliver packets.</p><p><strong><em>No service type</em></strong>: used to statically expose a service. An example of that would be a database or a third-party service provider.</p><p>One important information to keep in mind here is that the first three types of K8S service play the rôle of a load balancer. In fact, the first two types are using an internal load balancer mechanism contrary to the third type which uses an external load balancer.</p><p>For more in-depth details about these service types, I strongly recommend you to read the section about <a href="https://kubernetes.io/fr/docs/concepts/services-networking/service/">publishing services</a> in the official documentation.</p><p>So enough theory, let’s expose our application.</p><h4>Creating a service for the simple-app-deployment</h4><p>First we will expose our simple app using the below ad-hoc command:</p><blockquote>kubectl expose deployment simple-app-deployment — port 8090</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P1WAillFXEg2YdifJh5C8g.png" /><figcaption>ad-hoc service exposition</figcaption></figure><p>After exposing our deployment simple-app-deployment under the port 8090 a service object has been created and therefore exposed. To check the creation of the service, we listed the available service in the current namespace and it shows that indeed our deployed application has been exposed using a <strong><em>ClusterIP</em></strong> service type which is the default type. We can access it inside the K8S private network using the IP address 10.98.75.253 and port 8090.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e-KkWFkz3DiXtfFQqSr_eg.png" /><figcaption>Consume the /hello endpoint</figcaption></figure><p>First, we got inside the K8S cluster because we can’t reach the service network from the outside world using the <strong><em>ClusterIP</em></strong> service type. Next, we consumed the newly created service which works perfectly.</p><h4>Edit the running service type to NodePort</h4><p>Now let’s change the type of our exposed service to NodePort. One way we can do that is to edit the previously created service using the command:</p><blockquote>Kubectl edit service simple-app-deployment</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZZ0bKsHhzy1LvJLaJjI9-A.png" /><figcaption>Edit the service type</figcaption></figure><p>Here we changed the service type to NodePort and we set the node access port to 32000. Let’s check the new service type by listing the available service.</p><blockquote>kubectl get svc</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_9hCTxuIXTONUWKt8uk80w.png" /><figcaption>listing available services</figcaption></figure><p>As you can see the type of service is NodePort and the exposed port is 32000. Now let’s consume the <em>/hello</em> endpoint using the updated service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*t_RmdvMD1SY4X3B5k-7R5w.png" /><figcaption>consume the /hello endpoint</figcaption></figure><p>Since we’re using Minikube we can use <em>minikube ip</em> to extract the IP address of the node hosting the PODs. As you can see we successfully consumed the endpoint <em>/hello</em> directly using the node IP address.</p><p>Remember that you can always SSH into the node and consume the endpoint using the cluster IP address.</p><h4>Edit the running service type to LoadBalancer</h4><p>Now let’s change the running service type to LoadBalancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*icZgYGsYQCfPkDxcSQVdrQ.png" /><figcaption>Update the service type and list services</figcaption></figure><p>The same as the NodePort update, we changed the type of the service to LoadBalancer and we deleted the nodePort entry on purpose to see if K8S will assign a port to the node automatically and as you can see it does.</p><blockquote>Now what are the possibilities to access our application using this type of service ?</blockquote><p>The answer is that we can still consume the application from the node directly and SSH to the node and consume it using the cluster IP address. However, it’s not the purpose of the Load balancer type of service. The later type of services uses an external load balancer generally from a cloud provider. the traffic coming to the <em>LB</em> is directed to the PODs directly which is the ultimate purpose of this kind of service.</p><p>Up to this point, we created the 3 types of simple app service either by using the ad-hoc <em>expose</em> command or by editing the service in the <strong><em>ETCD</em></strong> database which is a key-value database that stores all the objects created in K8S.</p><p>Let’s see how we can do what we did previously using the recommended way, which is a YAML file specification that describes the desired state for our service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*-Bkvrbn1OyRWFJ1BWZwFnQ.png" /><figcaption>K8S service specification</figcaption></figure><p>Let’s break it down to see what’s happening in this YAML file.</p><p><strong><em>apiVersion</em></strong>: the version of the API that we can use to create the service object</p><p><strong><em>Kind</em></strong>: indicate the kind of service</p><p><strong><em>metadata.name</em></strong>: obviously indicate the name of the service</p><p><strong><em>metadata.namespace</em></strong>: indicate that the service will be created in the namespace development</p><p><strong><em>spec.selector</em></strong>: you remember when I mentioned the label attribute in the previous article? the label is used by the service selector. In fact, any POD with the label app=simple-app will be selected and therefore provisioned by the my-simple-app-service.</p><p><strong><em>spec.ports.protocol</em></strong>: the network protocol used for transporting packets</p><p><strong><em>spec.ports.port</em></strong>: the port that a client can use to consume the service</p><p><strong><em>spec.ports.targetPort</em></strong>: the target port in PODs, the default value is the same as the spec.ports.port.</p><p><strong><em>spec.type</em></strong>: the type of the service which is either ClusterIP (default), NodePort, or Loadbalancer.</p><p>That’s it for this article, you can find the examples listed in this article in the Github repository: <a href="https://github.com/khairaneMurad/demo-simple-api">https://github.com/khairaneMurad/demo-simple-api</a></p><p>I hope you enjoyed it and see you for the next one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dba32a2d88b8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/consuming-kubernetes-deployed-microservice-using-services-dba32a2d88b8">Consuming Kubernetes deployed Microservice using Services</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy a Spring Boot Application Into Kubernetes]]></title>
            <link>https://medium.com/swlh/deploy-a-spring-boot-application-into-kubernetes-661cb07c2c88?source=rss-18e6a9aefe71------2</link>
            <guid isPermaLink="false">https://medium.com/p/661cb07c2c88</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[orchestration]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Mourad KHAIRANE]]></dc:creator>
            <pubDate>Sat, 24 Oct 2020 11:18:25 GMT</pubDate>
            <atom:updated>2020-11-18T12:02:19.535Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vewUG4dKWeo3mumq" /><figcaption>Photo by <a href="https://unsplash.com/@pericakalimerica?utm_source=medium&amp;utm_medium=referral">Pero Kalimero</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hello folks,</p><p>In this article, we will deploy a simple Spring Boot based application inside a K8S cluster.</p><p>To take the best of this article you should have a basic understanding of these subjects :</p><ul><li>Docker because we will be using it as the runtime to containerize the app.</li><li>A K8S cluster (standalone or MiniKube) running in your local machine or use some of the cloud providers like <a href="https://www.linode.com/">https://www.linode.com/</a>.</li><li>A basic understanding of Java and Spring boot</li></ul><h3>Prepare the simple app :</h3><p>First things first let’s prepare the application. We will expose a greeting endpoint that we can later consume by calling the path /hello</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fsp7A-AXdDnLxl4yk1T0jw.png" /><figcaption>/hello endpoint</figcaption></figure><p>To make it simple i implemented the endpoint directly in the entry point of the application which it’s not a good practice, you know SOC or SOR ( yes you’re right, one of the SOLID principales).</p><p>so let’s move to the next step</p><h3>Prepare the image specification :</h3><p>To make it easy i didn’t make a multi stage docker build as the aim of this article isn’t focused on Docker but on <strong>Kubernetes</strong>. bellow the image specification (aka the Dockerfile ).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*Ln5dh924cJNmC7nlsIgtTg.png" /><figcaption>Docker image specification</figcaption></figure><p>Since i’m using <strong><em>Java 11</em></strong> i based my app on the <strong><em>liberica-openjdk-debian</em></strong> image that has more than 500K+ downloads on Docker hub.</p><p>I’m exposing my application on the port <em>8090</em>, copying the jar file that we got after the build to the <em>app.jar</em> in my container and running the jar file with the <em>java -jar</em> command.</p><h3>Build and tag the image :</h3><p>At the same level of the docker file, use the bellow command to build and tag the image</p><blockquote>docker build -t simple-app:1</blockquote><p>make sure that your image has been built successfully as follows :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eaVw2jsQoSh-FB_reIsrVA.png" /></figure><p>A good practice is to run the container and check if the application is running successfully inside the container before taking a step further and deploying it to a K8s cluster ( yes the fail-safe approach ), so let’s do it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cnq-Wje9NJd9rrSkVKJ3Sw.png" /><figcaption>app running</figcaption></figure><p>Here we go the application is running correctly inside to the container. now let’s consume our greeting endpoint:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zrYUzpqcs0PjnKmm2Yo-0g.png" /></figure><p>At this point we are sure that our image is ready to be deployed by an orchestrator in our case it’s K8s.</p><h3>Prepare the deployment specification :</h3><p>the best way to make a deployment in K8s is by preparing a YAML file that describes the desired state in which our application will be running without any problem</p><p>let’s have a look on it :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*uTI2B7A0kuRsERZi_A-7dw.png" /></figure><p><em>apiVersion</em> : describes the version of the <strong><em>API</em></strong> <strong><em>server</em></strong> of K8S that we will be consuming to create our deployment</p><p><em>kind</em>: the kind of K8s object that we will be using for this specification</p><p><em>metadata</em> : describes information about the app like name and labels (very important information the we will be exploring later on)</p><p><em>replicas</em> : describes how many pods we need to run for the same application</p><p><em>containers</em>: describes the container’s specification like the name, the image and the exposed port.</p><h3><strong><em>Run the deployment</em></strong></h3><p>To create a deployment inside a K8s cluster use the command bellow</p><blockquote>Kubectl create -f k8s-deployement.yaml</blockquote><p>This command will make a POST request to the <strong><em>API server</em></strong> to create the deployment with the desired state that we specified in the YAML file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_B3y4w33PhKTeAzvj7HOvw.png" /><figcaption>Deployment created</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LjMFurtWcplXQti9T6e75A.png" /><figcaption>Deployment list</figcaption></figure><p>Here we go our deployment is created successfully.</p><h3><strong><em>Check that the application is running correctly inside the pods</em></strong></h3><p>First we need to fetch the ids of our running PODs, we can do that using :</p><blockquote>kubectl get pods</blockquote><p>Second use the PODs identifiers to fetch the logs from it using :</p><p>kubectl logs ${POD_ID}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NUOsqaUgvQxLLV7AlXg7rQ.png" /></figure><p>Now our application is running smoothly inside the K8S cluster but we have a challenge : How we can consume our endpoint from two running instances of the same application with different IP addresses ? yes you are right, using a <strong><em>Load balancer</em></strong>.</p><p>In the next article i will talk about how K8S service plays the role of a <strong><em>LB</em></strong> and the mechanism used to explore instances of the same application running inside a K8S cluster.</p><p>Here’s the Github repository : <a href="https://github.com/khairaneMurad/demo-simple-api">https://github.com/khairaneMurad/demo-simple-api</a></p><p>I hope you enjoyed reading this article and stay tuned for the next one !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=661cb07c2c88" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/deploy-a-spring-boot-application-into-kubernetes-661cb07c2c88">Deploy a Spring Boot Application Into Kubernetes</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>