Drakos
Posted on
• Edited on
Intro (Updated 17/07/2022)
Kubernetes is made for managing your cloud resources and build scalable apps. It’s considered the most popular tool for automating, deploying, and scaling your whole cloud. It runs on all major operating systems and it is the most popular open source tool in the cloud market. Kubernetes can scale your whole infrastructure, check the health of each service, work as a load balancer, automate deployments and many more. You can install & setup as many nodes (clusters) as you want, and deploy your pods (docker containers) and services across the cloud. In this tutorial you will learn how to setup Kubernetes and deploy the official web GUI dashboard where you can manage and monitor everything but first you have to install Hyper-V & Docker in order to use Kubernetes.
Step 1: Install & Setup Hyper-V
Windows as we all know, have their own virtualization software and it’s called Hyper-V which is basically something like VirtualBox on steroids. Hyper-V can manage your virtual machines (VM) using the default GUI tool provided by Microsoft for free, or through command line. Enabling Hyper-V can be easily done but first, make sure your PC meets the following requirements: Your OS should be Windows 10 (Enterprise, Pro or Education) with minimum 4GB RAM and CPU Virtualization support, although you have to double check if it’s enabled in your BIOS settings.
You can remove or add features that don’t come up pre-installed during the installation of Windows, like Hyper-V. Always remember that some of the features require internet access to download extra components from Windows Update. Follow the next steps to enable Hyper-V on your machine.
- Go to Control Panel
- On your left panel, click on Programs
- Then click Programs and Features followed by Turn Windows features on and off.
- Check Hyper-V and Windows Hypervisor Platform
- Click OK
Your system will now start installing Hyper-V on the background, it may need to reboot a couple of times until everything is configured properly. Don’t expect any notification or something! Run the following powershelgl command as Administrator and verify if Hyper-V is installed successfully on your machine: Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
Example.
PS C:\Windows\system32> Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
FeatureName : Microsoft-Hyper-V
DisplayName : Hyper-V Platform
Description : Provides the services that you can use to create and manage virtual machines and their resources.
RestartRequired : Possible
State : Enabled
Enter fullscreen mode
Exit fullscreen mode
Step 2: Install Docker for Windows
Kubernetes is build on top of Docker, theoretically is just a tool that communicate with your Docker containers and manage everything on enterprise level. To install Docker just grab & run the following installer https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe . During installation Docker will ask you to choose between Hyper-V and WSL. For better security uncheck WSL 2. Docker will setup a Linux virtual machine on top of Hyper-V and start all the necessary services without manually configure anything. After the installation, you can either «communicate» with Docker using the CLI tool docker
or running HTTP requests though its API.
Step 3: Install Kubernetes on Windows 10
Docker comes with a handy GUI tool where you can modify some settings or install & enable Kubernetes. Follow the following instructions, WARNING! If Docker is installed successfully and you can’t locate its tray icon, you have to reboot your system. If the problem persists, check the official troubleshooting guide here https://docs.docker.com/docker-for-windows/troubleshoot/. Now follow the instructions to install Kubernetes.
- Right-click the Docker tray icon
- Click «Settings»
- On the left panel click «Kubernetes»
- Check
Enable Kubernetes
and click «Apply»
*** If you’re behind a firewall, don’t forget to allow:
C:\program files\docker\docker\frontend\docker desktop.exe
C:\program files\docker\docker\resources\com.docker.backend.exe
C:\program files\docker\docker\resources\bin\kubectl.exe
C:\program files\docker\docker\resources\com.docker.vpnkit.exe
Enter fullscreen mode
Exit fullscreen mode
During installation, Docker is going to install additional packages and dependencies. It may take around 5~10 minutes and the installation time depends on your Internet speed and your PC performance. Wait until the ‘Installation complete!’ popup message is shown up. After installing Kubernetes you can make sure that everything is working fine using the Docker app. If both services (Docker & Kubernetes) are running successfully without any errors then both icons at bottom left will go green.
Example.
OR
Step 4: Install Kubernetes Dashboard
Kubernetes Dashboard is the official web-based UI where you can manage Kubernetes resources. It’s not installed by default. Deploying applications with Kubernetes can be easily managed using the cli tool called kubectl
where you can interact with your cloud and manage your Pods, Nodes, or Clusters. If you pass the apply
argument followed by your YAML configuration file you can easily create or update Kubernetes resources. Run the following commands to deploy & enable the Kubernetes Dashboard using the following commands.
- Go to https://github.com/kubernetes/dashboard/releases
- Scroll down to
Installation
and download latest yaml configuration file for example https://raw.githubusercontent.com/kubernetes/dashboard/v2.6.0/aio/deploy/recommended.yaml - Deploy it using
kubectl apply -f .\recommended.yaml
- Verify that it’s running using the following command:
kubectl.exe get -f .\recommended.yaml.txt
Example.
PS C:\Users\user\Desktop> kubectl.exe get -f .\recommended.yaml.txt
NAME STATUS AGE
namespace/kubernetes-dashboard Active 2m10s
NAME SECRETS AGE
serviceaccount/kubernetes-dashboard 1 2m10s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes-dashboard ClusterIP 10.97.3.127 <none> 443/TCP 2m9s
Enter fullscreen mode
Exit fullscreen mode
Step 5: Access the dashboard
There are two ways to access the dashboard with tokens, the first one (deprecated, works only for older versions) is using the default token that was crated during the installation of Kubernetes and the second (more secure) way is by creating users, giving them permissions, and then get the generated token.
Newest version
-
Create a new configuration file:
dashboard-admin.yamlapiVersion: v1 kind: ServiceAccount metadata: name: admin-user namespace: kubernetes-dashboard --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: admin-user roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: admin-user namespace: kubernetes-dashboard
-
Deploy it using
kubectl.exe apply -f .\dashboard-admin.yaml.txt
-
Generate token using
kubectl.exe -n kubernetes-dashboard create token admin-user
-
Run
kubectl proxy
-
Copy paste the token to http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
Old version (deprecated)
- Run the following command powershell (not cmd)
((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1]
- Copy the generated token
- Run
kubectl proxy
. - Open the following link on your browser: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
- Select
Token
& paste the generated token - Sign In
Finally
If everything is configured properly you’ll be able to see the dashboard and your cloud resources. From there you can do almost all the «hard» work without dealing with the CLI every time. You may sometimes get your hands dirty with the command line but if you don’t understand the concept of Docker and Kubernetes or you don’t have time to for maintaining your own cloud, it’s better to stick with some PaaS providers that can cost you a fortune.
Support
If you liked this article please follow me on Twitter
https://twitter.com/devcrafter91
If you need a portable, extensible, and open-source platform you can use to manage containerized workloads and services, Kubernetes on Windows is a must-have. Kubernetes enables you to deploy and manage containerized applications at scale.
In this tutorial, you’ll learn to install Kubernetes on Windows using Hyper-V and Docker. And at the end of this tutorial, you will have a working Kubernetes cluster and a web-based UI you can use to deploy and manage your pod and applications.
Read on and start scaling your applications!
Prerequisites
This tutorial will be a hands-on demonstration. If you’d like to follow along, be sure you have a Windows 10 computer (or later) with the following:
- At least 4GB of RAM. The general rule for RAM is 300MB for each node in the cluster.
- A processor that supports hardware virtualization (most Intel and AMD processors released since 2005).
Enabling Hyper-V to Support Virtualization
Before running Kubernetes, you first have to enable Hyper-V on your machine. Hyper-V is a type 1 hypervisor that provides the virtualization technology upon which Kubernetes will run.
1. Open PowerShell as an administrator, and run the command below to enable Hyper-V (Microsoft-Hyper-V).
2. Once enabled, reboot your computer to apply the changes.
3. Finally, run the following command to verify that Hyper-V is enabled and running.
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
The output below shows you’ve successfully enabled Hyper-V.
Installing Docker Desktop
After enabling Hyper-V, you next need to install Docker Desktop so that you can work quickly with Docker containers on your computer. Docker Desktop includes everything you need to run containers, including the Docker Engine, a container runtime, and a management UI.
Kubernetes is designed to run on top of a container runtime like Docker. While you could install Kubernetes directly on your computer, using Docker Desktop is much easier as it includes all of the necessary tools and utilities.
1. Open your favorite web browser, navigate to the Docker Desktop download page, and download and run the installer.
2. Once Docker Desktop is installed, click Close and Restart to restart your computer.
A restart is required to complete the installation since the installer needs to modify your Windows configuration.
3. After restart, open Docker Desktop, tick the I accept the terms checkbox, and click Accept to accept the license agreement.
If all goes well, Docker Desktop opens, as shown below.
4. Finally, run the below docker run command to verify that Docker is working as expected.
This command pulls the hello-world container from Docker Hub if it is not already present on your computer and runs it.
The docker command is accessible from any CLI(Command Line Interface) like PowerShell or Command Prompt, as long as the Docker service runs. If not, run the command below to start the Docker service. Start-Service *docker*
This output below signifies your installation is working correctly.
Installing Kubernetes via the Docker Desktop
Now that you have enabled Hyper-V and installed Docker Desktop, you’re ready to install Kubernetes on Windows. In this tutorial, you will use the Docker Desktop GUI to enable and install Kubernetes.
1. Right click on the Docker icon in the system tray and select Settings from the context menu to access the Docker Desktop settings.
2. Next, select Kubernetes (left panel), tick the Enable Kubernetes checkbox, click Apply & Restart to apply the changes, and restart Docker Desktop.
3. Click Install when prompted, as shown below. Doing so installs Kubernetes on your computer, which might take a few minutes to complete.
You will see the Kubernetes cluster starting in the middle of the screen. This cluster contains a single node, which is your computer.
At this point, your Kubernetes cluster is running (bottom-left) like in the screenshot below, and you can start using that cluster.
Installing kubectl on Windows
You’ve successfully started your Kubernetes cluster, but how do you manage it? kubectl is a command line tool that lets you interact with your Kubernetes cluster, which you need to install.
kubectl is available as a standalone binary that you can download from the Kubernetes releases page.
1. Download the latest kubectl binary for your computer. The latest version at the time of writing this tutorial is kubectl v1.25.
2. Next, download the checksum file for the same release. You will use this checksum file to verify the authenticity of the downloaded binary.
3. Run the below command to compare the two SHA-256 hashes of the kubectl release and checksum file you downloaded.
You must put the kubectl binary and the checksum file in the same directory for this validation to work.
The commands below perform the following:
- Change the working directory to the kubectl binary and checksum files’ location. Ensure you change the C:\Users\ata\Download\Programs path to where you saved the files.
- Compute the SHA-256 hash (CertUtil) of the kubectl binary.
- Compare the result with the checksum in the checksum file.
cd C:\Users\ata\Download\Programs
$($(CertUtil -hashfile .\kubectl.exe SHA256)[1] -replace " ", "") -eq $(type .\kubectl.exe.sha256)
If both results match, you will see a True output, as shown below, which indicates that the binary is not corrupt, and you can proceed with installing the binary. Otherwise, you’ll get a False output and have to re-download the kubectl binary.
4. Now, run the below command to add the path of the kubectl binary to your PATH environment variable. Be sure to replace <full/path/of/kubectl/binary> with your computer’s actual path of the kubectl binary.
This command makes the kubectl binary accessible on the command-line interface
setx /m PATH "$Env:PATH;<full/path/of/kubectl/binary>"
5. Close the current PowerShell session, and open a new one for the changes to take effect.
6. Next, run the below command to verify that kubectl is installed and working.
This command prints out the man page for kubectl, which indicates that it is working correctly.
7. Lastly, run the following command to double-check that kubectl is configured to work with your Kubernetes cluster. This command prints out the URL and the status (cluster-info) of your Kubernetes master.
If you get an Unable to connect to the server error, as shown below, make sure your Kubernetes cluster is running and that you can connect to it from your computer.
Conclusion
Throughout this tutorial, you learned how to install Kubernetes on Windows and verify the installation works by starting up a Kubernetes cluster. Kubernetes has made it possible to automate many of the manual processes to ease the tasks of deploying, managing, and scaling containerized applications.
Now at this point, you have a working Kubernetes cluster and are ready to deploy your first application. Why not explore more about Kubernetes? Start running your applications on Windows without any headaches!
If you’ve been curious about how to install Kubernetes on Windows 10, you’re in the right place! This guide will walk you through the process step-by-step. By the end, you’ll have Kubernetes running on your Windows 10 machine. Let’s dive in!
Setting up Kubernetes on Windows 10 involves several steps, including installing Docker, enabling Kubernetes within Docker, and configuring some settings. Follow these steps, and soon you’ll be able to run Kubernetes clusters right from your Windows 10 machine.
Step 1: Install Docker Desktop
First, download and install Docker Desktop for Windows from the official Docker site.
Docker Desktop is essential because Kubernetes runs on top of Docker. Make sure you download the version compatible with Windows 10.
Step 2: Enable Kubernetes in Docker Desktop
After installing Docker, open Docker Desktop and navigate to settings. From there, go to the Kubernetes tab and check the “Enable Kubernetes” option.
This step allows Docker to manage Kubernetes clusters. Docker will automatically download and configure the necessary components for Kubernetes.
Step 3: Apply and Restart
Click the “Apply and Restart” button in Docker Desktop settings to apply the changes.
Restarting Docker ensures that all changes take effect, and Kubernetes starts running.
Step 4: Verify Installation
Open a command prompt and type kubectl version
to check if Kubernetes is running.
This command helps you confirm that Kubernetes is properly installed and configured. If everything is set up correctly, you’ll see details about the Kubernetes version.
Step 5: Run a Test Deployment
Create a simple deployment to test if Kubernetes is working properly. Use the command kubectl run hello-world --image=k8s.gcr.io/echoserver:1.4 --port=8080
.
This command deploys a simple application that you can use to verify your Kubernetes setup.
Step 6: Check the Deployment
Use the kubectl get deployments
command to check if your deployment is running.
This command lists all the deployments, allowing you to verify that your test deployment is up and running.
After completing these steps, Kubernetes should be fully operational on your Windows 10 machine. You can now deploy and manage applications using Kubernetes.
Tips for Installing Kubernetes on Windows 10
- Ensure your Windows 10 version is up-to-date to avoid compatibility issues.
- Allocate sufficient resources (CPU and RAM) to Docker Desktop to ensure Kubernetes runs efficiently.
- Familiarize yourself with basic Docker and Kubernetes commands for smoother operations.
- Use Kubernetes documentation for troubleshooting common issues.
- Consider using Minikube for a lightweight Kubernetes setup if Docker Desktop feels too heavy.
Frequently Asked Questions
Is it necessary to install Docker Desktop to run Kubernetes on Windows 10?
Yes, Docker Desktop is required because Kubernetes relies on Docker to create and manage containers.
Can I install Kubernetes on Windows 10 Home edition?
Yes, but you might need to enable Hyper-V and WSL 2 (Windows Subsystem for Linux) for better compatibility.
Are there any alternatives to Docker Desktop for running Kubernetes?
Yes, Minikube is a popular alternative, especially for lightweight or single-node Kubernetes clusters.
How much RAM should I allocate to Docker Desktop?
Allocating at least 4 GB of RAM should be sufficient for most basic Kubernetes setups.
What should I do if Kubernetes doesn’t start after enabling it in Docker Desktop?
Restart Docker Desktop and your computer. If the problem persists, check Docker and Kubernetes logs for errors.
Summary
- Install Docker Desktop
- Enable Kubernetes in Docker Desktop
- Apply and Restart
- Verify Installation
- Run a Test Deployment
- Check the Deployment
Conclusion
Installing Kubernetes on Windows 10 is a straightforward process if you follow the steps carefully. With Docker Desktop as a foundation, enabling Kubernetes and verifying your setup can be done in no time. This guide aims to simplify that process, ensuring you’re up and running quickly.
Kubernetes is a powerful tool for managing containerized applications, and getting it set up on your local machine can be a great way to learn and experiment. Remember to keep your Docker and Kubernetes components updated, and don’t hesitate to consult the official documentation for any advanced configurations or troubleshooting.
Happy Kubernetes-ing! Now that you know how to install Kubernetes on Windows 10, you can explore more complex setups and deployments, expanding your skills and understanding of container orchestration.
Matt Jacobs has been working as an IT consultant for small businesses since receiving his Master’s degree in 2003. While he still does some consulting work, his primary focus now is on creating technology support content for SupportYourTech.com.
His work can be found on many websites and focuses on topics such as Microsoft Office, Apple devices, Android devices, Photoshop, and more.
If you wish to run containers on the scale, then Docker and Kubernetes are two of the most important tools at your disposal. With the help of this tool, you will be able to manage your cloud resources and develop cloud-based scalable apps. So, if you are in need of the tool Kubernetes, you have come to the right page, because here we are going to let you know how you can install Kubernetes on windows 10. After this page, it will become quite easy for you to install this tool on your machine and set it up. With the help of the docker tool in your system, your machine will be all set to scale the application. We are going to mention step by step by guides for you so that you can follow them at your ease. Furthermore, we are going to let you know how you can make a great career in this field and can learn from the best for DevOps Course. But before we dive straight into the installation process, let us jog our memory a little and know about Kubernetes and why it is one of the most in-demand tools right now!
Introduction
As mentioned above, Kubernetes is a container-based platform that is used to manage cloud resources as well as help in developing scalable applications. This is one of the platforms that can be used for automating, deploying, and scaling the entire cloud infrastructure in the project. This is an open-source cloud computing tool and the great thing is that it runs on all the operating systems. Not only it is going to help you to scale the entire infrastructure, but it is also going to monitor each of the service’s health. This acts as a load balancer and automates the deployments, making it easier to manage the whole process. Using this tool, the developers are able to deploy the pods docker containers and other services across the cloud by installing and configuring as many clusters as you need as per the requirements.
One of the main advantages that come with this tool is that allows the users to schedule and run the Linux containers in physical or VM Clusters. Although it is a Linux technology, it is possible to run this tool on windows as well. And in the roadmap that we are going to share in the article below, you will be able to install Kubernetes on windows and work on it as per your requirements.
Its main advantage is that it allows users to schedule and run Linux containers in physical or VM clusters. Although it is primarily a Linux technology, running Kubernetes on Windows is possible. You will be able to manage and monitor everything with the steps and the guide that we are going to share below.
Master Devops Course in Chennai with StarAgile – Enroll Now to Boost Your Career with Hands-On Training and Industry-Recognized Certification!
Prerequisites for Installing Kubernetes on Windows 10
There are some things that you need to take care of when you are going to install this tool on your machine. The prerequisites are mentioned as follows for both hardware and software:
Hardware Requirements
· Master node with at least 2 GB memory. (Additional will be great)
· Worker node with 700 MB memory capacity.
· Your Mouse/Keyboard (monitor navigation)
Software Requirements
· Hype-V
· Docker Desktop
· Unique MAC address
· Unique product UUID for every node
Apart from this, you need to make sure that there is a full range of connectivity among all the machines that are part of the cluster is very much pivotal.
Also Read: Devops VS CI CD
Your step-by-step guide to installing Kubernetes in your system
Step 1: Install and Setup Hyper-V
Now that you are going to install this application on the Windows operating system, you will first need to install and set up Hyper-V in your system. It is kind of like VirtualBox and using this, you can manage the virtual machines using the default GUI tool that is provided by Microsoft for free or even using the command line. Enabling this tool in your system is quite easy but there are certain things that you need to do before running this on your machine. These requirements are: Your OS should be Windows 10 which can be Enterprise, Pro, or Education with a minimum of 4GB RAM. There should be CPU Virtualization support available. If you are not sure of this, then you can have a look at this setting in your BIOS setting in your machine.
There could be some features that you need to add or remove which do not come with the pre-installed windows on your machine. You need to make sure that you are connected to the internet as there could be some features that will require internet access to download those components further on windows updates. Then you can follow the below-mentioned steps to enable Hyper-V in your machine:
1. Open the control panel in your system.
2. Locate Properties on your left panel and open it.
3. Now click the Program and Features which is followed by Turn Windows Features on and off.
4. Now look for Hyper-V and Windows Hypervisor Platform.
5. Now click OK.
With this click, the system will start installing Hyper-V in the background. You may reboot a couple of times to make sure that it is configured properly. You can the following command to make sure that Hyper-V is installed successfully on your machine as Administrator on PowerShell.
Get to know about Kubernetes Architecture
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
Step 2: Install the Docker application
As we are aware of the fact that Kubernetes is the container orchestration system that is built on top of Docker, we need to install docker essentially. It is the tool that is needed for communicating with Docker containers and also managing various things at an enterprise level. For this, you can simply go and install the Docker and get the Docker Desktop for Windows (stable). This is the version of Docker that is optimized for Windows 10. This is now a native application that is used for developing, shipping, and running dockized apps simply. The highlighting feature of this application is that it is very reliable and fast. As it used windows native Hyper-V virtualization and networking, it makes it the fastest. Also, if you are using the Docker desktop for windows, then you are able to run the docker containers on both Linux as well windows.
Know about Prometheus Kubernetes with our detailed blog
Now we are going to mention some of the steps that you can follow to install Docker Desktop for windows.
1. Double click on the Docker for Window installer and this will start the installation.
2. Docker will not be started automatically once the installation is completed. You can locate the whale symbol in the notification area which will suggest that it is running and can be accessed from the terminal.
3. Now click on RUN.
4. You can now try out some of the common docker commands in the command line terminal like PowerShell.
5. You can check the Docker Version
6. Run Docker run hello-world to make sure that docker is able to pull and run images and with this, your application is all set to be used.
7. You are able to access this application from the terminal as long the desktop application for windows is running. You can access it from the UI.
Bonus Tip: If you are not able to locate the tray icon even after the installation was successfully done, then you might need to restart your computer. Troubleshoot your system if this still persists and follow the measures to resolve the issues.
Get Kubernetes Cheat Sheet for easy working over Kubernetes
Step 3: Install Kubernetes on Windows 10
When you have installed Docker in your system, you are going to have a handy GUI tool where you can modify some of the settings and install and enable Kubernetes. You can follow the below-mentioned steps to install Kubernetes in your system.
1. You need to right-click the Docker tray icon
2. Now click on «Settings»
3. On the left panel, you will find Kubernetes, click «Kubernetes»
4. Check Enable Kubernetes and click «Apply»
When you click apply, the installation is going to begin, it might take some time as Docker needs to install additional packages and dependencies. It makes take around 5-10 minutes depending on the internet speed and the performance of your system. You should not do anything till it says installation complete. Then you can make sure that everything is a working file using the docker app. If both Kubernetes and Docker are working fine and do not have any errors, then you will find both the icons of these tools as green at the bottom left.
Prepare yourself for Kubernetes Interview with Kubernetes Interview Questions
Step 4: Install and access the Kubernetes dashboard
If you wish to use the Kubernetes resources then the official web-based UI for the same is by using the Kubernetes Dashboard. As it is not set up by default, you need to follow some steps. You can use the CLI tool Kubectl to deploy the Kubernetes application which will help you to interact with the cloud and manage the pods, nodes, and clusters present in your system. Furthermore, using the YAML configuration file, you can also create and update the Kubernetes resources by passing the apply argument. We are going to mention some commands which can be used to deploy and enable the Kubernetes dashboard in your application.
You can download the YAML Configuration file and use this to deploy it
. kubectl apply -f .\recommended.yaml
You can now check if this is up and running by using the command
kubectl.exe get -f .\recommended.yaml.txt
Now you can access this dashboard in two ways. The first way is to use the default token which is created during the installation and the second way is by creating users and giving them permission and then receiving the generated token. The second way is a more secure way.
1. Run the following command PowerShell (not cmd)
((kubectl -n kube-system describe secret default | Select-String «token:») -split » +»)[1]
2. Copy the generated token
3. Run
kubectl proxy.
4. Open the following link on your browser:
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
5. Select Token & paste the generated token
6. Sign In to your account
After this, you will be able to see the dashboard and the cloud resources that are set up correctly in your machine.
Also Read: DevOps Automation
Unlock Your Future with the Best DevOps Course in Bangalore!
Master the essential DevOps tools and methodologies with hands-on training from industry experts. Join our comprehensive course and kickstart your career in one of the most in-demand fields. 🚀 Enroll Now to secure your spot and transform your career!
Conclusion
In this tutorial, we have come across the installation of two of the most important container managing tools that are widely used. Docker and Kubernetes are very easy to install and use and if you follow the steps mentioned above to install Kubernetes on windows, then you will face any issues. One of the main things to note here is that there is a fundamental difference between Kubernetes and Docker. While Kubernetes is meant to run across a cluster, Docker is supposed to run through nodes. There are various things that can be resolved if you are using these applications in your project.
So, if you are looking to make your career in this field, and want to know more about the DevOps concepts, then there is no better time than now. With StarAgile, you are going to get the best devops course training that is going to be a stepping stone for your career. Here you are going to get certified learning along with the hands-on experience that will help you build your career at great lengths. So, start now and give your best shot.
- Home
- Blog
- Devops
- How to Install Kubernetes on Windows? Step-by-Step Guide
Table of Contents
- Kubernetes Installation System Requirements for Windows
- How to Install Kubernetes on Windows? In 5 Simple Steps
- How to Use Kubernetes?
- How to Uninstall Kubernetes on Windows?
- What is Kubernetes?
- Conclusion
With the increasing complexity of contemporary software creation, containerization techniques have become essential since they are practical and flexible in transporting applications.
As more and more organizations adopt hybrid and multi-cloud, Kubernetes becomes a strategic instrument to harmonize and organize container-based workloads. In 2022, Platform9 published a survey among enterprises where it was stated that as many as 85% run containerized apps in production, with Kubernetes being the most common choice out of several other options for orchestration.
Let’s get started. We will guide you through the complete roadmap on how to install Kubernetes for Windows users. This tutorial will show you how to set up Kubernetes and deploy the official web GUI dashboard, which will allow you to manage and monitor everything.
Kubernetes Installation System Requirements for Windows
For installing Kubernetes in your system, here are a few prerequisites that need special attention. The hardware and software requirements are discussed below:
A. Hardware requirements
- Master node with at least 2 GB memory. (Additional will be great)
- Worker node with 700 MB memory capacity.
- Your Mouse/Keyboard (monitor navigation)
B. Software requirements
- Hype-V
- Docker Desktop
- Unique MAC address
- Unique product UUID for every node
C. Additional Libraries or Tools (Installed Prior)
- Enable Hyper-V and the WSL.
- Enable Kubernetes and Microsoft’s PowerShell functionality.
- Ensure you install all the required libraries and other tools beforehand for proper Kubernetes usage.
- Ensuring that there is a full range of connectivity between all the machines in the cluster is a must.
How to Install Kubernetes on Windows? In 5 Simple Steps
Let’s discuss the detailed process on how to install Kubernetes on Windows in just five simple steps:
Step 1: Install & Setup Hyper-V
As we all know, Windows has its virtualization software, known as Hyper-V, which is essentially VirtualBox on steroids. Hyper-V allows you to manage your virtual machines (VMs) using either the free Microsoft GUI tool or the command line. It’s simple to enable Hyper-V, but first, make sure your PC meets the following requirements:
- Your operating system should be Windows 10 (Enterprise, Pro, or Education), with
- At least 4GB of RAM and CPU Virtualization support, though you should double-check that it’s turned on in your BIOS settings.
You can disable or enable features like Hyper-V that may not be pre-installed when Windows is installed. Always keep in mind that some of the features require internet access to download additional Windows Update components.
To enable Hyper-V on your machine, follow the steps below:
1. Open the Control Panel.
2. Select Programs from the left panel.
3. Next, go to Programs and Features, then Turn Windows Features On or Off.
4. Examine Hyper-V and the Hypervisor Platform for Windows.
5. Select OK.
Your system will now begin installing Hyper-V in the background; it may be necessary to reboot a few times until everything is properly configured. Don’t hold your breath for a notification or anything! Verify that Hyper-V is installed successfully on your machine by running the following command as Administrator in PowerShell:
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
Once the state is shown as Enabled for above command in Power shell, we are good to go.
Step 2: Download Docker for Windows and install it.
Kubernetes is a container orchestration system built on top of Docker. It is essentially just a tool for communicating with Docker containers and managing everything at an enterprise level. Simply go to install Docker and click to Get Docker Desktop for Windows (stable).
Windows users can use Docker Desktop
Docker Desktop for Windows is a version of Docker optimized for Windows 10. It’s a native Windows application that makes developing, shipping, and running dockerized apps simple. Docker Desktop for Windows is the fastest and most reliable way to develop Docker apps on Windows, as it uses Windows-native Hyper-V virtualization and networking. Docker Desktop for Windows can run Docker containers on both Linux and Windows.
Installation of Docker Desktop
Let us take a look on the different steps involved in installing docker desktop.
- Double-click Docker for Windows Installer to run the installer.
- Docker starts automatically once the installation is complete. Docker is running and accessible from a terminal, as indicated by the whale in the notification area.
- Run .
- Try out some Docker commands in a command-line terminal like PowerShell!
- Run the Docker version to check the version.
- Run Docker run hello-world to verify that Docker can pull and run images.
- Boom!
As long as the Docker Desktop for Windows app is running, Docker is accessible from any terminal. The Docker whale in the taskbar has a setting button that can be accessed from the UI.
For a detailed step by step installation guide with screenshot, visit the blog — How to Install Docker on Windows, Mac, & Linux: A Step-By-Step Guide
WARNING: FOLLOW THE INSTRUCTIONS BELOW! If Docker was successfully installed but you can’t find its tray icon, you’ll need to restart your computer. Check the official troubleshooting guide here if the issue persists.
Step 3: Install Kubernetes on Windows 10
Docker includes a graphical user interface (GUI) tool that allows you to change some settings or install and enable Kubernetes.
To install Kubernetes, simply follow the on-screen instructions on the screen:
1. Right-click the Docker tray icon and select Properties.
2. Select «Settings» from the drop-down menu.
3. Select «Kubernetes» from the left panel.
4. Check Enable Kubernetes and click «Apply»
Docker will install additional packages and dependencies during the installation process. It may take between 5 and 10 minutes to install, depending on your Internet speed and PC performance. Wait until the message ‘Installation complete!’ appears on the screen. The Docker app can be used after Kubernetes has been installed to ensure that everything is working properly. Both icons at the bottom left will turn green if both services (Docker and Kubernetes) are running successfully and without errors.
Example.
Step 4: Install Kubernetes Dashboard
The official web-based UI for managing Kubernetes resources is Kubernetes Dashboard. It isn’t set up by default. Kubernetes applications can be easily deployed using the cli tool kubectl, which allows you to interact with your cloud and manage your Pods, Nodes, and Clusters. You can easily create or update Kubernetes resources by passing the apply argument followed by your YAML configuration file.
Use the following commands to deploy and enable the Kubernetes Dashboard.
1. Get the yaml configuration file from here.
2. Use this to deploy it.
. kubectl apply -f .\recommended.yaml
3. Run the following command to see if it’s up and running.:
kubectl.exe get -f .\recommended.yaml.txt
Step 5: Access the dashboard
The dashboard can be accessed with tokens in two ways: the first is by using the default token created during Kubernetes installation, and the second (more secure) method is by creating users, giving them permissions, and then receiving the generated token. We’ll go with the first option for the sake of simplicity.
1. Run the following command PowerShell (not cmd)
((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1]
2. Copy the generated token
3. Run
kubectl proxy.
4. Open the following link on your browser:
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
5. Select
Token & paste the generated token
6. Sign In
Finally
You’ll be able to see the dashboard and your cloud resources if everything is set up correctly. You can then do almost all of the «hard» work without having to deal with the CLI every time. You may occasionally get your hands dirty with the command line, but if you don’t understand Docker and Kubernetes or don’t have the time to manage your own cloud, it’s better to stick with some PaaS providers that can be quite expensive.
How to Use Kubernetes?
Kubernetes is one of the effective container orchestration platforms that automatically deploys, scales, and manages containerized applications. After we have seen how to install Kubernetes on Windows, here are the top three tips that I prefer when using Kubernetes:
Understand the Basics:
- Pods: Smallest deployable units in Kubernetes. Each container might be a pod with the same or different network space, volume, and port mapping.
- Deployments: Establish the targeted state that you would want for your application. These help you to have a certain number of copies of your application available and operational throughout.
- Services: Connect a group of pods to a network. They help in load balancing, service discovery, and providing stable network endpoints.
Use Declarative Configuration:
Kubernetes is built as a declarative system that describes the needed condition and leaves it to care for itself. Define your applications, services, and other resources in YAML or JSON configuration files. State your need and go to Kubernetes to show how to arrive at and sustain this stage.
Learn and use kubectl:
Kubectl is the command-line interface between a Kubernetes cluster and user(s). Check your cluster status using kubectl get, kubectl describe, and kubectl logs for a view of pods and services. You can also enroll in a certified DevOps Foundation course to learn in a better way.
How to Uninstall Kubernetes on Windows?
The procedures for uninstalling cert-manager on Kubernetes are outlined below. Depending on which method you used to install cert-manager — static manifests or helm — you have two options.
Warning: To uninstall cert-maneger, follow the same steps as you did to install it, but in reverse. Whether cert-manager was installed from static manifests or helm, deviating from the following process can result in issues and potentially broken states. To avoid this, make sure you follow the steps outlined below when uninstalling.
Step 1: Before continuing, make sure that all user-created cert-manager resources have been deleted. You can check for any existing resources with the following command:
$ kubectl get Issuers,ClusterIssuers,Certificates,CertificateRequests,Orders,Challenges --all-namespaces
After you’ve deleted all of these resources, you can uninstall cert-manager by following the steps outlined in the installation guide.
Step 2: Using regular manifests to uninstall.
- Uninstalling from a regular manifest installation is as simple as reversing the installation process and using the delete command.
kubectl.
2. Delete the installation manifests using a link to your currently running version vX.Y. Z like so:
$ kubectl delete -f https://github.com/jetstack/cert-manager/releases/download/vX.Y.Z/cert-manager.yaml
Step 3: Uninstalling with Helm.
1. Uninstalling cert-manager from a Helm installation is as simple as reversing the installation process and using the delete command on both the server and the client. kubectl and helm.
$ helm --namespace cert-manager delete cert-manager
2. Next, delete the cert-manager namespace:
$ kubectl delete namespace cert-manager
3. Finally, delete the cert-manger CustomResourceDefinitions using the link to the version vX.Y.Z you installed:
$ kubectl delete -f https://github.com/jetstack/cert-manager/releases/download/vX.Y.Z/cert-manager.crds.yaml
The namespace is in the process of being terminated.
The namespace may become stuck in a terminating state if it is marked for deletion without first deleting the cert-manager installation. This is usually because the APIService resource is still present, but the webhook is no longer active and thus no longer reachable.
4. To fix this, make sure you ran the above commands correctly, and if you’re still having problems, run:
$ kubectl delete apiservice v1beta1.
What is Kubernetes?
Kubernetes is a container-based platform for managing cloud resources and developing scalable apps. It is widely regarded as the most common platform for automating, deploying, and scaling the entire cloud infrastructure. The platform runs on all major operating systems and is the most widely used open-source cloud tool.
Kubernetes can scale your entire infrastructure, monitor each service’s health, act as a load balancer, and automate deployments, among other things. You can deploy your pods (docker containers) and services across the cloud by installing and configuring as many nodes (clusters) as you want.
Conclusion
In this tutorial, we have explained in detail how to install Kubernetes with Hyper-V. Also, we have tackled what requirements we need, both in terms of the software and hardware. We have explained how to install Hyper-V and Docker on Windows 10. It is important to note that the fundamental difference between Kubernetes and Docker is that Kubernetes is meant to run across a cluster and Docker is meant to run through nodes.
Kubernetes is also more extensive than Docker Swarm and is meant to coordinate a cluster of nodes at scale in production in an efficient manner. Each software is crucial to having a smooth installation process.
You must ensure you are well-versed with DevOps concepts for the best outcome. Want to learn Kubernetes and how to use it? KnowledgeHut-certified DevOps foundation courses are perfect as per my experience to get the best hands-on learning of Kubernetes to build scalable applications.
Frequently Asked Questions (FAQs)
1. What is the easiest way to install Kubernetes on Windows?
Setting up a Kubernetes cluster on your local machine is very easy if you use Docker Desktop, making the installation process simple.
2. Do all Kubernetes features work on Windows?
Not all Kubernetes features supported by Windows are available as they differ in some regards. One must also confirm with the Kubernetes docs which specific features work in Windows.
3. Is there a specific version of Windows Server required for Kubernetes on Windows?
Yes, Kubernetes on Windows demands Windows Server 2019 and above versions for containerization and orchestration.
4. Are there any limitations when using Windows containers in Kubernetes?
Yes, there are challenges to some extent. For instance, some network plugins are unsupported, while Linux containers may act differently. Please refer to the Kubernetes documentation for more specific information about Windows container limitations.