Skip to main content

Docker & Kubernetes Part 2 with Minikube

Greetings earthlings! And non-earthlings. Last time we spoke about Docker and Kubernetes was very brief. Today we're going to dive into running Kubernetes as your orchestration tool.
Speaking of orchestration, what is this? Let's dig into why you need both Docker and K8 (short for Kubernetes). Docker, like LXC, is the container engine. This engine allows you to create your images that you will run as containers. These images consist of whatever you want, from a MySQL image to a Redis image to a Nginx image. Think of this as your "golden image" or your "template". This "golden image" or "template" allows you to spin up your environment however you'd like.
Now, for the K8 part. What does K8 do? It gives you the orchestration. It allows you to spin up your environment, as customized as you want, and with however many of those environments you want. For example, let's say you're running an application for your organization. This application goes out to clients and you are manually spinning up VM's, which you don't want to do anymore because it's a time sink and a lot of resources. You can use something like K8 to spin up an entire environment for a client in minutes. As a matter of fact, you can spin up TEN or TWENTY on ONE HUNDRED of that same exact environment.
Today we're going to be spinning up that Kubernetes environment on a Mac with Docker, Kubernetes, Kubernetes Manfiests, and minikube. Minikube is an interesting little tool. With Kubernetes, you're supposed to have multiple notes for redundancy and failover. That's one of the big points of orchestration. Instead of having to do all of that in a test environment, Minikube allows you to do this locally with one node. Let's get started.

The first thing we want to confirm is that Docker for Mac is installed and Kubernetes is running. To install this, we will use Brew. For install instructions to use brew, please follow this link:
First, you are going to install the Docker engine for Mac. For instructions on this, please look at part one of Docker & Kubernetes.

The first thing we want to do is confirm kubectl is installed. Kubectl is the Kubernetes API CLI we will use to manage Kubernetes
brew install kubernetes-cli
To confirm it was installed, check the version. You should see something similar to the lines below. Depending on when you read this, you may have a newer version.
kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:55:54Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
To install minikube and give execute permissions to the owner, run the following:
curl -Lo minikube && chmod +x 
The above will pull down Minikube. In the curl command, the -Lo is important. The "L" will pull from a new location if the specified URL moved. The "o" is to output the info from the download.
Once installed, you're going to run minikube and move the binary to the bin directory.
minikube && sudo mv minikube /usr/local/bin/
Next, run the following:
minikube start
This will start the installation of minikube on your local system and get your local/dev environment ready. You should see something like the below (please note: this may take a while):
To disable this notification, run the following:
minikube config set WantUpdateNotification false
Starting local Kubernetes v1.8.0 cluster...
Starting VM...
Downloading Minikube ISO
 140.01 MB / 140.01 MB [============================================] 100.00% 0s
If everything was set up properly, you should see the following:
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
If not, please take a look at these troubleshooting steps:
If any VM issues with Fusion of VirtualBox, run the following:
Run minikube start --vm-driver=none instead
if you have any permission denied errors, give yourself read/execute/write permissions on the minikube binary run the following:
chmod 700 /usr/bin/minikube
That's the gist! In part 3, we will start spinning up pods and deployments with docker images we bring down from Docker Hub.


Popular posts from this blog

DevOps tooling in the Microsoft realm

When I really started to dive into automation and practicing DevOps with specific tooling, there were a few key players. At the time Microsoft was not one of them. They were just starting to embrace the open source world, including the art and practice of DevOps. Since then Microsoft has went all in and the tech giant has made some incredible tooling. Recently I switched to a Microsoft-heavy environment and I love it. I went from AWS/Python/Ansible/Jenkins to Azure/PowerShell/ARM/Azure DevOps. My first programming language was PowerShell so being back in the saddle allowed me to do a full circle between all of the different types of tooling in both worlds. Today I want to share some of that tooling with you.

The first thing I want to talk about is ARM. What is ARM? ARM is a configuration management tool that allows you to perform software-defined-infrastructure. Much like Ansible and Terraform, ARM allows you to define what you want your environment to look like at scale. With ARM, yo…

Monitoring your containers in an AKS cluster with Prometheus

Monitoring and alerting is arguably one of the most important thing in Cloud Engineering and DevOps. It's the difference between your clients stack being up and a client being down. Most of us have SLA's to abide by (for good reason). Today we're going to learn how to spin up Prometheus in an AKS cluster to monitor our applications.

1. Intermediate knowledge of Kubernetes
2. An AKS cluster spun up in Azure

Recently AKS supports Prometheus via Helm, so we'll use that for an automated solution to spin this up. This installs kube-prometheus, which is a containerized version of the application. With raw Prometheus, there are a few things that are needed for the operator;

1. Prometheus: Defines a desired deployment.
2. ServiceMonitor: Specifies how groups of services should be monitored
3. Alertmanager: Defines the operator to ensure services and deployments are running by matching the resource

With kube-prometheus, it is all packaged for you. This means configuri…

So, you want to be a Cloud Engineer?

In 2019 one of the biggest pieces of tech is the cloud. Whether it be public cloud or private cloud, cloud technologies are here to stay (for now). I predict that Cloud Engineering will be a very big part of IT (and development) for another 5-10 years. Today I want to share with you my journey in becoming a Cloud Engineer and some helpful tips. A career timeline to be a Cloud Engineer can go like so;

Desktop Support > Junior Sysadmin > Sysadmin > Sysadmin/Technical Lead > Engineer >  Cloud Engineer.

Although our career paths may not align, I believe that this progression is very import. Let me tell you why.

Helpdesk/Desktop Support Helpdesk and desktop support get your feet wet. It allows you to understand technology and how it's used in the workplace from a business perspective. It shows you what technologies may be best in the current environment your in and how to support those technologies. It also teaches you soft skills and how to support people from a technic…