Advertisement

header ads

Install Kubernetes on Mac OS in 5 minitues



Kubernetes is a well known and widely used Orchestration system originally developed by Google and currently managed by Cloud Native Computing Foundation. Today we are going to start our first tutorial of Kubernetes tutorial series. In today's tutorial, we are going to install Kubernetes environment in our Mac.

Apart from ordinary step wise tutorial, we are going to discuss on how to solve some issues which can occur during the setup process.

We don't install the main version of Kubernetes to our local Mac PC. Instead, we are going to configure the Mini version of it called "Minikube" which is recommended for local use.

1. Installing virtual box

Go to https://virtualbox.org and download latest stable release of the virtual box and install it.

Possible errors can occur

Installation of virtual box can be failed without exposing proper error message.

Solution

  • Go to up System Preferences
  • Click on theSecurity & Privacy icon
  • Then  you’ll see a message - saying System software from developer “Oracle America, Inc.” was blocked from loading.
  • If it is there, click the lock icon in the bottom left of the window
  • Enter your Mac password
  • Then click the Allow button
  • Then go to applications
  • You will probably see virtual Box has been listed as an installed application. Remove it.
  • Then reinstall it again.
  • Now you will be able to install it successfully.
After installing Virtual Box. Restart the PC.

2. Installing kubectl

  • This is the command line tool for kubernetes. You can install it easily using Homebrew.
  • Type command - brew install kubectl
  • If you have not installed HomeBrew, install it using this link.

3. Installing Minikube


Just run below command in your terminal.

curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.27.0/minikube-darwin-amd64 &&\chmod +x minikube &&\sudo mv minikube /usr/local/bin/


After that run minikube start  command
If everything is OK you will get a response like below.


Possible errors can occur

If you get an error message like below;


šŸ˜æ  Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
šŸ‘‰  https://github.com/kubernetes/minikube/issues/new
❌  Problems detected in "kube-addon-manager":
    error: unable to recognize "STDIN": Get https://localhost:8443/api?timeout=32s: dial tcp 127.0.0.1:8443: connect: connection refused
    error: no objecWRN: == Error getting default service account, retry in 0.5 second ==
    error: no objects passed to apply

Check wether your firewall is turned on. If it is, please turn it off .
Then run minikube delete command to delete the partially created image.
Then re run minikube start command.
if everything went fine. You will end up with a response like following.



Now you have configured kubernetes successfully.


4. Verifying Installation

Run following command in order to very your kubernetes (Minikube) configuration
  • kubectl version
  • minikube version


Dineths-MacBook-Pro:~ dineth$ kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.0", GitCommit:"641856db18352033a0d96dbc99153fa3b27298e5", GitTreeState:"clean", BuildDate:"2019-03-26T00:04:52Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"darwin/amd64"}
Dineths-MacBook-Pro:~ dineth$ minikube version
minikube version: v1.0.0

You have now completed configuring kubernetes environment on your local PC. Please use below comment sections for clarifications. Like our facebook page to get latest tutorials.

Post a Comment

0 Comments