Skip to main content

Minikube in the Cloud on Ubuntu

Course

Intro Video

Photo of Michael McClaren

Michael McClaren

Linux Training Architect I in Content

Length

06:34:49

Difficulty

Beginner

Videos

22

Hands-on Labs

9

Course Details

In this course we will be exploring Minikube. It is a local implementation of Kuberenetes, in a single node format, that is useful for local development.

Syllabus

Getting Started

Welcome to the Course

Course Introduction

00:01:22

Lesson Description:

Welcome to the course! In this video, I provide an overview of what we will be learning. I hope that you enjoy this course as much as I enjoyed creating it!

About the Instructor

00:00:21

Lesson Description:

My name is Mike, and I am a DevOps engineer with over a decade of experience working in cloud environments. I got my start in enterprise support, and then moved to web hosting. I am proud to bring you this course on Minikube.

Containers and Kubernetes Review

Container Basics

00:06:38

Lesson Description:

In this lesson we will contrast containers and virtual machines. We will also take a look at exactly what a container is, and how a container is created using namespaces. This will give us the foundation that we need to move forward into orchestrating containers with Kubernetes, and how to manage them locally using Minikube.

Kubernetes Basics

00:04:00

Lesson Description:

In this lesson we will cover the absolute basics of Kubernetes, as they applies to a full installation of Kuberentes in a cluster. We will talk about container orchestration and pods. If you already know Kubernetes, please feel free to mark this as complete and move on to the next section.

Exploring Minikube

The Difference Between Traditional Kubernetes and Minikube

00:05:40

Lesson Description:

In this lesson we will look at the differences between a full Kubernetes cluster and Minikube. We will focus mostly on the differences in deployment, and how to leverage Minikube to allow quick deployment of a local Kubernetes cluster.

Installing Minikube in the Cloud Playground

00:11:20

Lesson Description:

In this lesson we will look at installing Minikube in our Cloud Playground. There are a few things that make this different than installing it on an Ubuntu workstation. This is a virtualization-on-virtualization type of installation, and we can use these techniques to deploy to the major cloud providers. Commands used in this lesson: Installing and testing Docker (remember to log out and back in for group changes to take effect):

sudo apt install -y docker.io
sudo usermod -aG docker cloud_user
docker run hello-world
Get and install Minikube:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_1.4.0.deb
sudo dpkg -i minikube_1.4.0.deb
Configure and start Minikube:
sudo minikube config set vm-driver none
sudo minikube start
Additional configurations and installation of kubectl:
sudo chown -R $USER $HOME/.kube $HOME/.minikube
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
sudo chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
sudo kubectl create deployment --image nginx my-nginx
sudo kubectl expose deployment my-nginx --port=80 --type=NodePort
sudo minikube ip
sudo kubectl get svc

Minikube-Specific Commands

00:07:03

Lesson Description:

In this lesson we will be taking a look at the Minikube commands. We can use these commands to manage a cluster and perform tasks such as starting, stopping, and deleting the cluster. Additionally we can check the logs, cache images, and get the status of the cluster.

Minikube Addons

00:07:40

Lesson Description:

In this lesson we will take a look at how to enable Minikube addons, specifically the Kubernetes dashboard. There are some additional steps we will be taking to ensure that the dashboard is acessible via the public IP of our server, as we are running a Cloud Playground server.

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.

Installing Minikube in the Cloud

00:30:00

Working with Minikube

Managing Minikube

Managing Configurations

00:06:12

Lesson Description:

In this lesson, we use the minikube config command to work with the configuration of the Minikube cluster. We demonstrate how to configure the memory allocation of the Minikube installation as well as revert those changes. We also show a listing of all of the configurations that can be modified in the Minikube installation.

Monitoring Our Cluster

00:06:37

Lesson Description:

In this lesson, we will be deploying the Heapster addon to provide monitoring insights into our cluster. We also demonstrate how to manipulate the Nginx proxy to allow us access to our monitoring and an application.

Using a Specific Version of Kubernetes

00:03:45

Lesson Description:

In this lesson, we discuss how to install specific versions of Kubernetes. Typical production environments are the last ones to be updated, and any changes need to be tested first. This means that in our development environment, we most likely will not be building against the latest version of Kubernetes, and will need to install the same version as what is in the production environment.

Local Storage and Volumes

00:06:17

Lesson Description:

In this lesson, we map a local directory to our pod by creating a volume mapped to the directory. Then we create a claim on that volume. Once the claim is bound, we can mount it into our pod and access the data located on our local storage.

Persistent Storage

00:05:40

Lesson Description:

In this lesson, we leverage the dynamic provisioner to create persistent storage for a MySQL pod. This is in contrast to our local storage, and this is the method that would be used for production Kubernetes clusters.

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.

Minikube: Installing the Heapster Addon for Monitoring

00:30:00

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.

Minikube: Using Local Storage

00:30:00

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.

Minikube: Persistent Storage

00:30:00

Deploying to Minikube

Our First Deployment

00:04:58

Lesson Description:

In this lesson, we take the objects we've previously created and package them into a deployment. This allows us to create the objects in one command and also delete the objects in a command. This sets the stage for future deployments so we can create more complicated environments.

Deploying with Persistent Storage

00:06:03

Lesson Description:

In this lesson, we leverage the kustomization tool using an example from the official Kuberentes site. We include our YAML charts and a kustomization file in a directory, and then allow kubectl to deploy using the kustomization file. This deployment will use dynamically-provisioned persistent storage for a WordPress installation.

Microservices in Minikube

00:04:37

Lesson Description:

In this lesson, we deploy microservices in Minikube. We use the robot-shop application from Instana for this purpose. Once we have the application deployed, we explore the services created and look at the performance of the application on our Minikube cluster.

git clone https://github.com/instana/robot-shop.git

Helm on Minikube

00:08:52

Lesson Description:

In this lesson, we install Helm into our Minikube cluster. Then we use Helm to deploy both a database and the robot-shop application into our cluster. Helm is the "package manager" for Kubernetes, and it can be used to simplify deployment by using a preconfigured package or chart into our cluster.

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.

Minikube: Deploying to Our Cluster

00:30:00

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.

Minikube: Deploying Persistent Storage

00:30:00

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.

Minikube: Deploying Microservices

00:30:00

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.

Minikube: Using Helm

00:30:00

When Things Go Wrong

Troubleshooting Minikube

Common Issues

00:07:23

Lesson Description:

In this lesson, we work with a new instance in the Cloud Playground. Minikube is installed, but nothing will work. We fail to deploy Minikube and then show how to correct the issue to eventually get a working cluster. We walk through permissions errors, version issues, and driver problems, as well as how to recognize and correct these issues.

Logging and Debugging

00:04:10

Lesson Description:

In this lesson, we take a look at Minikube logging, exploring how to enable the different log levels when we start our cluster. We also take a look at getting some insight into the containers that make up our Kubernetes deployment within Minikube.

Users, Certificates, and Contexts

00:06:55

Lesson Description:

In this lesson, we look at how users are added into Kubernetes. We generate keys and certificates for the users so they can access the Kubernetes API. When troubleshooting a cluster issue, it's important to understand how users are created, so that we can take things like certificate expiration into account. Commands used in this lesson:

openssl genrsa -out dev.key 2048
openssl req -new -key dev.key -out dev.csr -subj "/CN=dev/O=group"
openssl x509 -req -in dev.csr -CA /home/cloud_user/.minikube/ca.crt -CAkey /home/cloud_user/.minikube/ca.key -CAcreateserial -out dev.crt -days 500

kubectl config set-credentials dev --client-certificate=/home/cloud_user/keys/dev.crt  --client-key=/home/cloud_user/keys/dev.key
kubectl config set-context dev --cluster=minikube --namespace=default --user=dev

RBAC and What It Does

00:07:00

Lesson Description:

In this lesson, we take a look at role-based access control (RBAC). This is the permissions system for Kubernetes. We have a created user and will apply permissions for that user by creating a role, and then binding the role to the user. Files used in this lesson: pod-viewer.yaml

kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  namespace: default
  name: pod-reader
rules:
- apiGroups: [""] # “” indicates the core API group
  resources: ["deployments", "pods"]
  verbs: ["get", "watch", "list"]
pod-rolebinding.yaml
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: read-pods
  namespace: default
subjects:
- kind: User
  name: dev # Name is case sensitive
  apiGroup: ""
roleRef:
  kind: Role #this must be Role or ClusterRole
  name: pod-reader # must match the name of the Role
  apiGroup: ""

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.

Minikube: Troubleshooting Installation Issues

00:30:00

Where to Go from Here

Food for Thought

Courses to Take Once You Have Completed This One

00:02:06

Lesson Description:

In this video, we take a look at the courses available on Linux Academy. We also review the search page that we can use to locate additional courses about Kubernetes and related technologies.

Take this course and learn a new skill today.

Transform your learning with our all access plan.

Start 7-Day Free Trial