Skip to main content

Microservice Applications in Kubernetes


Intro Video

Photo of Matthew Pearson

Matthew Pearson

Linux Training Architect II in Content

Matthew currently resides in Lynchburg, Virginia where his favorite things are spending time with family and friends, gaming, and campfires in the fall. During his senior year of high school and early college, Matthew performed in a sketch comedy show on public access television that was called Tomato Time. He brings this creativity and fun to the content he creates.







Hands-on Labs


Course Details

Welcome to the Microservice Applications in Kubernetes course! This course is designed to give you hands on experience with installing and administering a complex microservice application in a Kubernetes cluster. The course will begin with an overview of Kubernetes conceptually and then move on to installing a functioning Kubernetes cluster. Once the cluster has been bootstrapped, we will learn how to install a simple microservice and then install a more complex microservice application that we will be working with throughout the remainder of the course. Using this microservice application, we will work through the various components and features of Kubernetes like service discovery and autoscaling. Working through this course will give you hands on experience with the microservice architecture and show you why this method has become one of the most sought after in the IT industry.

Download the Interactvie Diagram here:



Course Introduction


Lesson Description:

Welcome to the Learn Microservices by Doing course. This video is a brief overview of the course content and the topics that we will cover.

About the Author


Lesson Description:

Learn a little more about the training architect, Matthew Pearson.

Course Tools and Resources


Lesson Description:

In addition to the video lessons, several other tools and resources are provided to aid you in your studies. In this video, we will discuss the tools and resources that are available.

Kubernetes Overview


Lesson Description:

Kubernetes has several components that work together to make installing and managing applications incredibly straightforward. In this lesson, we will go over a high-level view of Kubernetes and the various components that drive this incredible technology. Interactive Diagram:

Configuring a Kubernetes Cluster

Configure Cloud Servers


Lesson Description:

The new Cloud Playground at Linux Academy is a fantastic tool for spinning up cloud servers and practicing all the things you are learning in your courses. In this lesson, we will go over some of the new features provided by Cloud Playground and configure our cloud servers for this course. **UPDATE - Now that cloud playground is out of beta some of the options have changed.

Docker Installation and Overview


Lesson Description:

Docker is a containerization technology that allows you to package and run applications in loosely isolated environments called containers. For our Kubernetes cluster, we will be using Docker as our container runtime. In this lesson, we will go through a brief overview of Docker and then install Docker CE 18.06.1 to our cluster nodes. Installation Steps: Add GPG key: # curl -fsSL | sudo apt-key add - Add Docker repository: # sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable" Update packages: # sudo apt-get update Install Docker: # sudo apt-get install -y docker-ce=18.06.1~ce~3-0~ubuntu

Installing Kubeadm, Kubelet, and Kubectl


Lesson Description:

**Important: Due to an issue introduced by a recent security update, the kubernetes binaries need to use version1.12.7-00 instead of 1.12.2-00. Please see instalation instructions below. Kubeadm, kubelet, and kubectl are important components for our implementation of Kubernetes. Kubeadm provides a streamlined way to bootstrap a kubernetes cluster. Kubelet is the agent that runs on the cluster nodes and performs various actions on the components of the cluster. Then we have kubectl, which is the command line utility for interacting and managing the cluster. In this lesson, we will discuss each of these components and install them on our cluster nodes. Installation Instructions:Add the GPG key:# curl -s | sudo apt-key add -Add the Kubernetes repository:

# cat << EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb kubernetes-xenial main
Resynchronize the package index:# sudo apt-get updateInstall the required packages:# sudo apt-get install -y kubelet=1.12.7-00 kubeadm=1.12.7-00 kubectl=1.12.7-00Prevent packages from being automatically updated:# sudo apt-mark hold kubelet kubeadm kubectl

Bootstrap the Kubernetes Cluster


Lesson Description:

The kubeadm command was developed to provide best practices for initializing a Kubernetes cluster and for joining nodes to the cluster. In this lesson, we will be using the kubeadm command to bootstrap our kubernetes cluster and then join our cloud servers to the cluster. Installation Steps: Initialize the Cluster on the Master: # sudo kubeadm init --pod-network-cidr= Set up kubeconfig for a Local User on the Master # mkdir -p $HOME/.kube # sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config # sudo chown $(id -u):$(id -g) $HOME/.kube/config Join Nodes to the Cluster # sudo kubeadm join $controller_private_ip:6443 --token $token --discovery-token-ca-cert-hash $hash

Configure Cluster Network with Flannel


Lesson Description:

In Kubernetes, the communication between pods occurs on the cluster network. To set up the cluster network, install the network add-on after bootstrapping the cluster. In this lesson, we will prepare the cluster nodes for the cluster network and then install the Flannel network add on. Install the Flannel Network Addon(on all nodes) Add net.bridge.bridge-nf-call-iptables=1 to sysctl.conf.# echo "net.bridge.bridge-nf-call-iptables=1" | sudo tee -a /etc/sysctl.conf(on all nodes) Apply the change made to sysctl.conf# sudo sysctl -p(on Master) Use kubectl to install Flannel using YAML template.# kubectl apply -f

Hands-on Labs are real live environments that put you in a real scenario to practice what you have learned without any other extra charge or account to manage.


Working with Microservices

What are Microservices?


Lesson Description:

Microservice architecture has become a very appealing model that many companies are trying to adopt. In this video, we will try to answer the question “What are microservices?”, and talk about some benefits of microservices architecture.

Installing a Single Application to the Cluster


Lesson Description:

The Kubernetes command line utility, kubectl, provides a streamlined way to interact with the cluster and manage applications. In this lesson, we will discuss namespaces and pods, and then install an application to our Kubernetes cluster.

Installing a Microservice Application to the Cluster


Lesson Description:

In this lesson, we will install a complex microservice application provided by WeaveWorks. This microservice application will be our main subject of study as we continue the course. We will work with this application as we walk through some of the main features provided by Kubernetes. Install Git and Clone the Microservice RepositoryInstall Git: sudo apt-get install gitSwitch to the user's home directory: cd ~Clone the Microservice repo: git clone the Microservice Application to the ClusterCreate a namespace for the application: kubectl create namespace sock-shopInstall the microservice application under the sock-shop namespace: kubectl -n sock-shop create -f complete-demo.yamlList the pods for the newly created application." kubectl get pods -n sock-shopNote: Using -w allows you to view the pods as they start-up in real-time: kubectl get pods -n sock-shop -w

Kubernetes API


Lesson Description:

The Kubernetes API is the main gateway for interacting with the Kubernetes cluster. In this lesson, we will discuss the API server and interacting with it to gain information about our cluster.

Service Discovery


Lesson Description:

Service discovery is the process of automatically detecting available services and how to connect to them. In this lesson, we will go over the different methods of service discovery in Kubernetes and also work with the cluster DNS server.



Lesson Description:

Kubernetes uses replication to create multiple instances of an application across the cluster. In this video, we will discuss replication and talk about the differences between replication controllers, replica sets, and deployments.



Lesson Description:

In reference to Kubernetes, Ingress is an API object that manages external access to services in the cluster. In this lesson, we will discuss Ingress and work with a NodePort service that will provide access to the cluster.

Scaling Microservices


Lesson Description:

The ability to scale the individual components of a microservice application is one of the great features that Kubernetes offers. In this lesson, we walk through manually and automatically scaling microservices in our cluster.

Self Healing


Lesson Description:

Self-healing is the ability of the Kubernetes cluster to recover from service or node failure automatically. In this video, we discuss and show the benefit of using replication for your microservices and the way that the Kubernetes cluster can automatically recover from a service failure.

Hands-on Labs are real live environments that put you in a real scenario to practice what you have learned without any other extra charge or account to manage.


Hands-on Labs are real live environments that put you in a real scenario to practice what you have learned without any other extra charge or account to manage.


What's Next

Next Steps


Lesson Description:

Congratulations on completing the course! In this video, we will go over some of the other available content at Linux Academy and how to search for it.

Take this course and learn a new skill today.

Transform your learning with our all access plan.

Start 7-Day Free Trial