Kube Mac OS

broken image


This is a step-by-step guide to installing and running Kubernetes on your Mac so that you can develop applications locally.

You will be guided through running and accessing a Kubernetes cluster on your local machine using the following tools:

'If you're serious about security, Qubes OS is the best OS available today. It's what I use, and free.' 'Happy thought of the day: An attacker who merely finds a browser bug can't listen to my microphone except when I've told Qubes to enable it.' 'When I use Qubes I feel like a god. Tear down Kubernetes in Docker for OS X is quite an easy task. Go to Preferences, open Reset tab, and click Reset Kubernetes cluster. All object that have been created with Kubectl before that will be deleted. Click to see full answer. Sep 29, 2020 You can be up and exploring Kubernetes on Mac within 10 minutes, with all the advantages of an API managed, immutable, secure Kubernetes OS. First, install Docker Desktop. Run Docker, give it the access it asks for, and you'll see it chugging along in the menu bar.

  • Homebrew
  • Docker for Mac
  • Minikube
  • virtualbox
  • kubectl

Installation Guide

The only pre-requisite for this guide is that you have Homebrew installed. Homebrew is a package manager for the Mac. You'll also need Homebrew Cask, which you can install after Homebrew by running brew tap caskroom/cask in your Terminal.

  1. Install Docker for Mac. Docker is used to create, manage, and run our containers. It lets us construct containers that will run in Kubernetes Pods.

  2. Install VirtualBox for Mac using Homebrew. Run brew cask install virtualbox in your Terminal. VirtualBox lets you run virtual machines on your Mac (like running Windows inside macOS, except for a Kubernetes cluster.)

    Skip to step three if everything has worked to this point.

    In my case, I already had the non-Homebrew VirtualBox app installed which caused issues when trying to start minikube.

    If you already have VirtualBox installed, start the installation as before with brew cask install virtualbox. You will get a warning that confirms this saying Warning: Cask 'virtualbox' is already installed.. Once this is confirmed, you can reinstall VirtualBox with Homebrew by running brew cask reinstall virtualbox.

    If you happen to have VirtualBox already running when you do this, you could see an error saying Failed to unload org.virtualbox.kext.VBoxDrv - (libkern/kext) kext is in use or retained (cannot unload).

    This is because the kernel extensions that VirtualBox uses were in use when the uninstall occurred. If you scroll up in the output of that command, beneath Warning! Found the following active VirtualBox processes: you'll see a list of the processes that need to be killed.

    Kill each of these in turn by running kill first_column_number (first_column_number is the process identifier for that process).

    Now re-run brew cask reinstall virtualbox and it should succeed.

  3. Install kubectl for Mac. This is the command-line interface that lets you interact with Kuberentes. Run brew install kubectl in your Terminal.

  4. Install Minikube via the Installation > OSX instructions from the latest release. At the time of writing, this meant running the following command in Terminal…

    Minikube will run a Kubernetes cluster with a single node.

  5. Everything should work! Start your Minikube cluster with minikube start. Then run kubectl api-versions. If you see a list of versions, everything's working! minikube start might take a few minutes.

  6. At this point, I got an error saying Error starting host: Error getting state for host: machine does not exist. because I had previously tried to run Minikube. You can fix this by running open ~/.minikube/ to open Minikube's data files, and then deleting and deleting the machines directory. Then run minikube start again.

Come Together

You've installed all these tools and everything looks like it's working. A quick explanation of how the components relate is needed.

  • VirtualBox is a generic tool for running virtual machines. You can use it to run Ubuntu, Windows, etc. inside your macOS operating system host.
  • Minikube is a Kubernetes-specific package that runs a Kubernetes cluster on your machine. That cluster has a single node and has some unique features that make it more suitable for local development. Minikube tells VirtualBox to run. Minikube can use other virtualization tools—not just VirtualBox—however these require extra configuration.
  • kubectl is the command line application that lets you interact with your Minikube Kubernetes cluster. It sends request to the Kubernetes API server running on the cluser to manage your Kubernetes environment. kubectl is like any other application that runs on your Mac—it just makes HTTP requests to the Kubernetes API on the cluster.

By the end of this document, you'll have a local installation of Minikube kubernetes cluster along with all the default core components ofKubeedge deployed as services in the pods. You should be able to access JupyterHub notebooks, and the Kubeedge Dashboard.

Line

Prerequisites

  • Laptop, Desktop or a Workstation
    • >= 12GB RAM
    • >= 8 CPU Cores
    • ~100GB or more Disk Capacity
    • Optional: GPU card
  • Mac OS X or Linux (Ubuntu/RedHat/CentOS)
  • sudo or admin access on the local machine
  • Access to an Internet connection with reasonable bandwidth
  • A hypervisor such as VirtualBox, Vmware Fusion, KVM etc.

If you already have a hypervisor on your system, you can follow the Quick Setup to do a guided Minikube setup.

Install a Hypervisor

If you do not already have a hypervisor or a virtualizer installed, install a new one. Once the hypervisor is installed, you don't need to start or use it directly. Minikube will automatically invoke the hypervisor to start the VM.

Mac OS X

Install Virtual Box or VMware Fusion.

Ubuntu

Install Virtual Box or KVM.

The KVM2 driver is intended to replace KVM driver. The KVM2 driver is maintained by the minikube team, and is built, tested and released with minikube.For installing KVM:

Then install the driver itself:

CentOS

Install Virtual Box or KVM.

For installing KVM:

Then install the driver itself:

Quick Setup

The following describes a script driven installation that you can use to deploy allthe necessary components including kubectl, minikube, kfctl along with Kubeedge itself. The script requires input from you on some configuration information and then it drives the rest of the installation. Run the following to start the installation:

Kubeedge_TAG is a tag corresponding to the version to checkout such as v0.3.0 or master.

The script asks for some config input as shown below:

Let us consider the example for CPUs configuration. When it asks Assign CPUs between 3..10 [6]: the 3..10 suggest the range of CPU cores available based on your host machine. [6] is the suggested default. You can choose any value within the range and enter the value or just press enter to accept the default value suggested in square brackets. In the image above, we choose the default 6 for CPUs and specified 12GB of memory explicitly. Note that:

  1. You will need to specify the virtualizer installed on the system explicitly and it needs to be one of the values provided as options.
  2. If you don't want to mount any local directory into the JupyterHub simply press enter instead of specifying any path.

After the configuration is complete, the script will continue execution for the next few minutes and when finished successfully should output some like:

When the installation finishes successfully, you can access JupyterHub as described in Where to go next. If you have trouble with the installation script or run into errors, you can follow the detailed installation steps manually as described below.

Install Kubectl

GCloud SDK
Mac OS X
Ubuntu
CentOS

Verify kubectl installed

Try running

This should output something like

Install & Start Minikube

Please see detailed instructions for Minikube installation.For quick setup instructions follow along below.

Mac OS X

OR

Ubuntu or CentOS
Start your minikube cluster

This takes a couple minutes as it will talk to the hypervisor and create a VM with the specified configuration.

Notes:

  1. These are the minimum recommended settings on the VM created by minikube for Kubeedge deployment. You are free to adjust them higher based on your host machinecapabilities and workload requirements.
  2. Using certain hypervisors might require you to set –vm-driver option specifying the driveryou want to use.

In case, you have the default minikube VM already created (following detailed installation instructions), please use the following to update the VM.

Installing Kubeedge using kfctl

The following steps will deploy Kubeedge components and start them on the Minikube you created above.

  1. Download Kubeedge source

    • Kubeedge_SRC is the directory where you want to download the source
    • Kubeedge_TAG is a tag corresponding to the version to checkout such as v0.3.0
  2. Run the following to setup and deploy Kubeedge:

    • KFAPP is the name of a directory to store your configs. This directory is created when you run init. Please see understanding the deployment process for more details.

The above installation may take a few minutes. At the end of the installation you should see:

Where to go next

Now you can access the Kubeedge dashboard at http://localhost:8080/ and JupyterHub at http://localhost:8080/hub/.For JupyterHub, you'll be landing on a login page.

Kube Mac Os Catalina

  • Use any username and password to login
  • Pick an available CPU tensorflow image
  • Provide at least 2 CPUs
  • Provide 4Gi for the memory
  • Leave 'Extra Resource Limits' alone for now
  • Click Spawn.
  • You should be redirected to a page that waits while the server is starting.

If the page doesn't refresh, please seetroubleshooting.

Kube Mac Os X

For further exploration refer to the guide.





broken image