Lesson 1 8:22
Setting Up Your Workstation
In this lesson, you’ll learn which tools you'll need for developing applications to run on Kubernetes.
Hi, I'm Eric Smalling and I'm a staff field engineer at VMware. This course is for developers building applications for deployment to Kubernetes.
In this lesson, you'll learn how to set up your workstation with the tools you'll need to work with containers and Kubernetes.
The first of these tools is Docker, which you'll use to build container images and run containers on your workstation. If you're using Linux, you'll install the Docker CE engine. On Mac or Windows, you'll want to install Docker Desktop. Links below this video will take you to the installation documentation for your operating system.
Okay, let's take a look at installation. Docker Desktop is available through Docker Hub and the link is at the top of the installation page, as you see here. Now, you're going to need to log in to Docker Hub with an account. If you don't already have an account, go ahead and build one. You'll want one later anyway.
Go ahead and log into Docker Hub, if you're not already. You should be taken to a page that has a direct link to the download. On a Mac, that'll be a DMG file like this one, or on Windows, it'll be an installer. For the Mac. You'll copy the file into applications. Very similar to any other application on a Mac. Windows, you'll double-click the installer.
Then, you're going to run Docker. As it comes up, you'll see a note, some pop-ups. On the Mac, you'll need to enter your credentials so that it can set up networking. On Windows, just take the default install and answer yes to the security pop-up.
If you're installing on Linux, I'm not going to walk through all the steps here, but just follow the page. It's pretty self-explanatory. The high level basics are you're going to install a repository for your package manager on your distributional Linux, and then install the Docker packages.
There's some other steps about removing older versions of Docker in case you have it. I do recommend, however, you go to the bottom of the page and look at the post installation steps.
That'll walk you through setting it up so you don't have to be root to run your Docker commands, which I do highly recommend.
Okay. Let's test out our Docker installation. Go ahead and open your favorite terminal program and type docker version. Now, run that and you should get the output you see here, or something similar, with both client and server side putting out the version information.
If you don't see this, go back through the installation steps and make sure you didn't miss anything.
We're going to do on another test. We can do a docker run --rm -IT and put hello-world. That is an image out on Docker Hub, that when you run this, Docker will go get that image and run the contents of.
This will test to make sure that everything's working correctly. Sure enough, there we go. We've got the output from Docker. So let's clean up after our self.
There's a command called rmi, which will remove that image that we just downloaded. So you docker rmi hello-world. There we go, we're all cleaned up. If you got to this stage and saw the similar output to this, your Docker installation is set up correctly.
Next is kind, which stands for Kubernetes in Docker. In a production environment, Kubernetes nodes are physical or virtual servers that run the container workloads.
On our local workstation we'll actually use Docker containers as Kubernetes nodes. That sounds complicated that's because it kind of is, but we have kind to simplify it for us.
If you take a look at the install screen, there's sections for each operating system and package manager. I'm on a Mac with Homebrew, so I'm going to go ahead and follow the instructions to do that.
We'll go ahead and run that command. There we go. Once the command is done, I can type kind and I have the output. Now that we have Docker and kind, we need kubectl, which is the standard CLI tool for interacting with Kubernetes. Kubectl translates commands you give it into API calls to the Kubernetes API. You install kubectl locally and give it a config file, kubeconfig, which provides connection info and credentials to the Kubernetes API. In a later lesson, we'll use kubectl to deploy our application to our local kind cluster. For Mac and Windows users take note that Docker Desktop may have already installed kubectl for you, but the version that they installed may not be the one you need for your cluster. For instance, in this example, I know that I want to use Kubernetes version 1.17 which is the GA as of this recording.
If we take a look at what Docker is installed for us we can see that I've got 1.15. So I'm going to go ahead and install on top of what Docker has already put on there.
To install kubectl from the installation page choose the section for your operating system. Again, I'm on a Mac. So I'm going to go here and I do have Homebrew. So I'm going to use this section And we'll let Homebrew do its thing.
Homebrew's installed this, but you can see that it gave a couple warnings at the end. So if I run kubectl version clients again, I still see 1.15. I'm going to go whack up here. And I'm going to run this link overwrite which rearranges [inaudible 00:05:42] system, and should give me the version I want. Sure enough, we have Git version 1.17.2. Other operating systems installation will be similar. Just make sure that when you're all done, your version is the current GA version of Kubernetes.
Another tool we'll use is Kustomize. In one of the lessons in this course, you'll learn how to write the manifest to define how your application will be deployed in a Kubernetes cluster. However, not all Kubernetes clusters are created equal. There are important differences between your local kind cluster and a production cluster for example. And Kustomize will help us manage the changes that need to be made to those manifests. Taking a look at the installation page for Kustomize we can see that there's a standard cURL, Homebrew and Chocolatey methods. Since I, again, am on Mac with Homebrew, I'm going to go ahead and use that tool.
Cool. Let's go ahead and run Kustomize. And sure enough, I get output.
Many organizations use a tool called Helm to package their applications for Kubernetes. If your team uses Helm, you'll need to know how to templatize your manifests and create Helm charts. So we'll cover that in the lesson, in this course as well. Installation for this also very simple. You can see that you can get the binary version direct download, or you can use the installer tools on Windows or Mac.
Once finished installing should be able to run the helm command and get output such as this.
The final tool we're going to install is Skaffold. As you'll learn in a lesson in this course, it helps streamline the process of building and pushing container images, as well as deploying your applications so that you can focus on your development work. If you look at the installation page for this tool, we have tabs for the different operating systems, including a Docker [inaudible 00:07:43]. We're going to go ahead and stick with the operating system installs. So for myself, I'll be using the Homebrew installation for Mac OS. You of course will choose whatever is needed for your workstation.
Now that the installation is done, we should be able to type skaffold version and you should get output put like that.
Well, that's it. You've got all the tools you need to complete this course. We look forward to seeing you in the next lesson where you begin building your own container images. Thank you very much.
- Docker Desktop/Engine for Mac
- Docker Desktop/Engine for Windows
- Docker Desktop/Engine for Linux
Have feedback about this course or lesson? We want to hear it!
Send your thoughts to KubeAcademy@VMware.com.
Share your thoughts!
Help us improve. We want to know what you think of this course — good, bad, and ugly.
Building Applications for Kubernetes
Introduction to the Course
Setting Up Your Workstation
Building Container Images
Running Kubernetes Locally
Deploying Your Application
Packaging Your Application
Improving Developer Workflow
The Top Takeaways From the Course