Menu
In addition to releases you can download or install development snapshots of Helm. From Canary Builds 'Canary' builds are versions of the Helm software that are built from the latest master branch. They are not official releases, and may not be stable. However, they offer the opportunity to test the cutting edge features.
You possibly heard about Kubernetes, right? It’s a tool used by many companies and DevOps Engineers for container management.
- Install Minikube via direct download. To install Minikube manually on Windows, download minikube-windows-amd64, rename it to minikube.exe, and add it to your path. Cleanup local state. If you have previously installed minikube, and run: minikube start. And this command returns an error.
- Now to install Minikube. There are few different ways for Mac, as documented HERE. I am going to use Homebrew. Brew cask install minikube Now to Deploy a Cluster and Test, from a Terminal: minikube start. This will pull down the Minikube ISO. You will see a Minikube VM appear in your Hypervisor.
Kubernetes
You can manage an entire infrastructure with it and just to make you feel better about this wonderful tool: Google developed it and still use it! Not enough? Well I’ll tell you more about it:
- Legend has it that Google deploys over two billion application containers a week using it
- Check out who’s using it: Ebay, The New York Times, Philips, Samsung, SAP, SoundCloud, Yahoo… It’s a long list so I’m going to stop here.
- “Ok, it seems to be a good tool but I already have Docker to manage my containers”. You’re right! Docker is a great tool to manage containers as well but let me tell you something, Kubernetes offers more! You have no idea how easy it is to deploy new versions of your software using k8s (a.k.a Kubernetes), I’ll give a few examples later on. Ah, and it uses docker in one of its layers.
- You will also have scalability (Scale your nodes and pods up and down), automated deployments with zero downtime (That’s interesting!)
Minikube
Now you know what Kubernetes is. Let’s talk about Minikube too because that’s what we’re going to use to test it. Check the description below (Taken from its official documentation):
“Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.”
As you can see, Minikube is not for production nor big environments but it’s great to test your YAML files and infrastructure in general.
I think that’s enough, it’s time to see some action. Let’s install minikube:
Here’s what we did with the commands above:
- The first command will download and move the kubectl command to /usr/local/bin/. That should be already in your path so you don’t need to do anything else
- We used the brew extension called cask to install virtualbox
- The third command also uses the cask extension, it installs minikube
- It will start minikube. This should take a few seconds
The last command will download the Minikube ISO and configure the cluster. The output should be similar to the one below:
Play time
Before we start having fun, let’s make sure the cluster is working properly and you’re able to access it. Type the command below and check its output:
In the example above, we used the kubectl command for the first time to check the current nodes in the cluster. We can see it’s ready, for how long it’s been up and its version.
Creating a simple container
We are going to create a simple container to serve a simple web page. So simple, right?
Run the following command:
This will create a deployment of one single pod (A pod is basically a single container or a group of containers) with the name webserver1, it will download the docker image echoserver 1.4. You will be able to access it on the port 8080.
We’re going to expose the deployment we just created using Kubernetes services. Do the following:
K8s will expose the deployment and create a random port (From 30000 to 32767 by default) and each node will proxy this port. Let’s see the result, type the following commands to check what we just created:
Let’s now create an ingress rule to allow “external” access. That means, anyone else within our computer network will have access to it.
That’s why Minikube is great for tests, we can easily enable the ingress add-on by typing the following command:
And you should see the message: “ingress was successfully enabled”. You would have to install an nginx-controller like this one or Traefik if you were using Kubernetes.
Download the ingress.yaml file from my github repository here. Use it to create an ingress rule, which will map the external access to our service. Type the following:
You can list the ingress rules by typing “kubectl get ing”:
Now, you will need to resolve the host test.example.com to the IP 192.168.99.100. You can simply add that to your /etc/hosts file and then test it either using the web browser or curl/wget. See the output below:
That’s it! We’re now able access the pod we created using an ingress rule.
Intro
This is a follow on to the previous writeup on Kubernetes with Minikube and shows how to quickly and easily get a Kubernetes cluster up and running using VirtualBox and Minikube.
The setup is very similar for all platforms, but this post is specifically focused on Mac, as I’m planning on using this as the basis for a more complex post on Jenkins & Kubernetes Pipelines (and that post is now posted, here!).
Installing required components
There are three main components required:
VirtualBox is a free and open source hypervisor. It is a light weight app that allows you to run Virtual Machines on most platforms (Mac, Windows, Linux). We will use it here to run the Minikube Virtual Machine.
Kubectl is a command line tool for controlling Kubernetes clusters, we install this on the host (Mac) and use it to control and interact with the Kubernetes cluster we will be running inside the Minikube VM.
![Mac Mac](/uploads/1/1/8/2/118218683/515419076.jpeg)
Minikube is a tool that runs a single-node Kubernetes cluster in a virtual machine on your personal computer. We’re using this to provision our k8s cluster and will also take advantage of some of the developer friendly addons it offers.
Downloads and Instructions
Here are links to the required files and detailed instructions on setting each of these components up – I went for the ‘
brew install
‘ options but there are many alternatives in these links. The whole process is very simple and took about 10 minutes.VirtualBox: https://www.virtualbox.org/wiki/Downloads
simply download the Mac VirtualBox .dmg image file and install it
kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/
Minikube Windows 10
brew install kubectl
Minikube: https://kubernetes.io/docs/tasks/tools/install-minikube/
brew install minikube
Starting up Kubernetes via Minikube in VirtualBox on Mac
From the Mac terminal (iTerm2 or whatever you use) running
minikube start
should kick off the download of the minikube VirtualMachine image.If you would prefer to use another hypervisor (VMWare, kvm etc) you may need to specify the driver from this list:
https://kubernetes.io/docs/setup/learning-environment/minikube/#specifying-the-vm-driver
https://kubernetes.io/docs/setup/learning-environment/minikube/#specifying-the-vm-driver
most popular hypervisors are well supported by Minikube.
Here’s what that looks like on my Mac – this may take a few minutes as it’s downloading a VM (if not already available locally), starting it up and configuring a Kubernetes Cluster inside it:
there’s quite a lot going on and not very much to see; you don’t even need to look at VirtualBox as it’s running ‘headless’, but if you open it up you can see the new running VM and its settings:
these values are all set to sensible defaults, but you may want to tweak things like memory or cpu allocations – running
minikube config -h
should help you see what to do, for example
minikube start --memory 1024
to change the allocated memory.
If you then take a look at the config file in
~/.minikube/config/config.js
you will see how your preferences – resource limits, addons etc – are persisted and managed there.Looking back at VirtualBox, if you click on “Show” or the running VM you can open that up to see the console for the Minikube VM:
Install Minikube On Windows 10
to stop the vm simply do a
minikube stop
, or just type minikube
to see a list of args and options to manage the lifecycle, e.g. minikube delete
, status
, pause
, ssh
and so on.Minikube Addons
One of the handy features Minikube provides are its selection of easy to use addons. As explained in the official docs here you can see the list and current status of each addon by typing
minikube addons list
the storage-provisioner and default-storeageclass addons were automatically enabled on startup, but I usually like to add the metrics server and dashboard too, like so:
minikube addons enable metrics-server
minikube addons enable dashboard
I often use helm & tiller, efk, istio and the registry too – this feature save me a lot of time and messing about!
Accessing the Kubernetes Dashboard – all done!
Once that’s completed you can run
minikube dashboard
to open up the Kubernetes dashboard on your host. Minikube makes this all very easy; we didn’t have to forward ports, configure firewalls, consider ingress and egress, create RBAC roles, manage accounts/passwords/keys or set up DNS, or any of the many things you would normally want or have to consider to get to this point.
Minikube Mac Os
These features make Minikube a great choice for development work, where you don’t want to care about things like this as you would in a “for real” environment.
Minikube Update
Your browser should open up the Kubernetes Dashboard, and you can click around and see the status of the many components that comprise your new Kubernetes cluster:
And then…
Next up I’ll be building on this setup by deploying a Jenkins instance inside the Kubernetes Cluster, then configuring that to use Kubernetes to build, manage and deploy applications on the same Kubernetes Cluster.
This is now covered in the next post, here: