Hey Folks, welcome to another article, in this article we'll be taking a look at Kubernetes specifically on docker for windows.
Prerequisites:
First of all, we'll be taking a look at as is the prerequisites that how to install and configure some of the issues you may find on the way and how to solve them as well. So the first thing we're going to do is take a look at a number of things you're going to need to install in order to get started.
The first thing you're going to want to make sure is that hyper-v is enabled if you already have hyper-v enabled that's the hypervisor for Windows you can skip this step but to enable it just follow the steps.
Just click on the start bar and search for the control panel.
Once the control panel comes up go to programs then go to turn Windows Features on and off and you will see a list what you're going to look for is the hyper-v sectioning you want to take all these boxes turn them on and press apply and ok.
If you cannot turn it on from here you also need to make sure that you have turned it on in the BIOS on your machine. It's disabled some laptops come shipped with the hyper-v turned off by default so you won't be able to turn it on unless you boot into the BIOS and turn it on.
The main reason why you need hyper-v enabled is because Docker for Windows as well as the Kubernetes are offering basically Linux technologies so the whole software package will run a Linux virtual machine behind the scenes.
2. Docker for Windows:
The next thing you're going to need is Docker for Windows. Just go to your browser and search Docker for Windows. Once you go there you will see a bunch of instructions the main one is for the installation so you're going to want to go ahead and click on that. That'll go through to the installation page where you can download from the Docker Hub.
Once you go onto that link, it'll ask you to log in so in order to use Docker. You need to create a docker hub account so go ahead and create one sign-in once you've signed in you can follow the remaining steps to download the installer and once you've started installation things will get rolling.So once docker is installed. Now to install Kubernetes it's really simple all you do is head over to the Kubernetes setting and enable it so you just press this tick box and you say apply that'll give you a little prompt to say it may take a few minutes it also requires an internet connection because what this will do is download all the cluster components.
3. KUBECTL:
Okay so now what we're going to want to do is head over to Google and type KUBECTL, you'll see install and setup documentation will come up and this is
the guide for how to install Kubectl. Basically, Kubectl is the command-line utility
used to operate and manage, and works with Kubernetes. The installation
instructions are pretty straightforward. There's a section for windows right here.
So just go ahead and click on it and that'll start the download so you can download this binary or this exe file and put it anywhere on your machine wherever you want.
The next thing you're gonna want to do is head over to the search bar and just search for the 'environment' you'll see edit the system environment variables and then click on Environment Variables.
Now you can do two things you can either set it up for your account or you can set it up for the whole system. so what you want to do is pick one of them and then expand them and you'll see all these paths. Here you can hit over-click the
new button and you can start typing in a path. Now just paste the path of the Kubectl folder.
So once you've added an entry into your path variable you want to make sure you
restart your PowerShell window if you have one open or ready because otherwise,
it won't load the path variables you. Now just type Kubectl and you'll see it automatically print out the help commands for Kubectl.
If you see commands it means that you've configured your command line to nowhere Kubectl is so Kubectl has the ability to interface with multiple Kubernetes
clusters and it does this through a config.
Now, this Kubectl will be pointing to a Kubernetes config somewhere in your system where you've installed docker for Windows and you enabled Kubernetes. It will create an entry for you now to see that entry what you to do is type kubectl config current-context that'll give you the current context of what is configured for Kubectl.
You can have multiple contexts added so you can have your development environment, your staging environment, and your production environment
all configured within that Kube config. Now you're ready to start working on our docker for the Windows environment.
Now am going to break it down to keep the article short and informative but what we've done here is we've created a Kubernetes cluster and whatever we do with this cluster is going to be the same as your production environment and that's the beauty of our Kubernetes as it abstracts away the machines. So whether it's a docker machine running here in our Windows environment or whether it's a machine in the cloud it doesn't matter so the way we talk to Kubernetes is going to be the same way. Now you can develop an environment and your production environment all right so it's literally that simple.
0 Comments