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
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Ansible and the Pre-Container Arts
  • KubeVirt Implementation: Who Needs It and Why?
  • Kubernetes Cluster Setup on Ubuntu, Explained
  • Create a Kubernetes Cluster With Centos

Trending

  • Unlocking the Potential of Apache Iceberg: A Comprehensive Analysis
  • Measuring the Impact of AI on Software Engineering Productivity
  • Understanding IEEE 802.11(Wi-Fi) Encryption and Authentication: Write Your Own Custom Packet Sniffer
  • Agentic AI for Automated Application Security and Vulnerability Management
  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 user avatar
Ajitesh Kumar
·
Jan. 02, 18 · Tutorial
Likes (7)
Comment
Save
Tweet
Share
34.6K Views

Join the DZone community and get the full member experience.

Join For Free

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, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Ansible and the Pre-Container Arts
  • KubeVirt Implementation: Who Needs It and Why?
  • Kubernetes Cluster Setup on Ubuntu, Explained
  • Create a Kubernetes Cluster With Centos

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!