DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Ansible and the Pre-Container Arts
  • Optimizing Java Applications for Arm64 in the Cloud
  • KubeVirt: Can VM Management With Kubernetes Work?
  • KubeVirt Implementation: Who Needs It and Why?

Trending

  • Searching Kafka Without an Index: Lessons From Building Message Search for Kafdrop
  • Delta Lake UniForm to Snowflake: Cross-Platform Table Access Without a Second Copy
  • Giving AI Agents Safe Access to Legacy Systems: Introducing legacy2mcp
  • Beyond the Endpoint: How Agent Cards Enable Discovery, Interoperability, and Trust

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. How to Install Kubernetes on an Ubuntu VM

How to Install Kubernetes on an Ubuntu VM

Want to get your favorite orchestration tool (assuming it's Kubernetes, of course) up and running on an Ubuntu VM? Here's a step-by-step guide.

By 
Ajitesh Kumar
·
Jan. 02, 18 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
35.0K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

This article is a quick, crisp, and to-the-point method of how to set up Kubernetes on an Ubuntu VM. The steps below will help you get started with Kubernetes on your laptop with the help of Minikube. Minikube is a tool that runs a single-node Kubernetes cluster inside a VM (VirtualBox in this article) on your laptop.

In this article, we will look at the steps for installing Kubernetes within an Ubuntu VM.  The steps remain almost same for Ubuntu OS with the difference of how you enable the virtualization at the BIOS level.

  • Install VirtualBox (as part of installing a hypervisor)

  • Enable Virtualization

  • Install Kubectl

  • Install Minikube

  • Start/stop Kubernetes

Install VirtualBox

First and foremost, a hypervisor needs to be installed. We will install Virtualbox. Detailed instructions can be found on the VirtualBox installation page. For Linux distributions, the instructions can be found on this page, VirtualBox for Linux.

Open the sources.list file:

sudo vi /etc/apt/sources.list


Place the following command in the sources.list file:

deb http://download.virtualbox.org/virtualbox/debian xenial contrib


In place of “xenial” (Ubuntu 16.04), use the following for other versions of Linux/Ubuntu:

  • zesty: Ubuntu 17.04

  • yakkety: Ubtuntu 16.10

  • Vivid: Ubuntu 15.04

  • Trusty: Ubuntu 14.04

  • Utopic: Ubuntu 14.10

Execute the following commands to install VirtualBox:

sudo apt-get update
sudo apt-get install virtualbox-5.2


Enable Virtualization

Click on processors and check the box Virtualize Intel VT-x… as shown in the diagram below.

Enable Virtualization on Ubuntu VM

Figure 1. Enable Virtualization on the Ubuntu VM

Install Kubectl

Download Kubectl:

# The command below installs Kubectl version 1.9.0
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.9.0/bin/linux/amd64/kubectl
# For stable version, use following command:
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl


Once you're done with one of the above commands, execute the following command to move kubectl to /usr/local/bin:

chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl


Install Minikube

curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.24.1/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
minikube version


Start/Stop Kubernetes

Start Minikube:

minikube start


The following screenshot represents the process:

Minikube Start

Figure 2. Minikube Start


Access the Kubernetes Dashboard. The command below will open up a browser:

minikube dashboard


The following page shows up in the browser:

kubernetes dashboard

Figure 3. Kubernetes Dashboard


Stop Kubernetes:

minikube stop


Kubernetes Virtual Machine ubuntu

Published at DZone with permission of Ajitesh Kumar. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Ansible and the Pre-Container Arts
  • Optimizing Java Applications for Arm64 in the Cloud
  • KubeVirt: Can VM Management With Kubernetes Work?
  • KubeVirt Implementation: Who Needs It and Why?

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook