Table of Content
Getting Kubernetes up and running on your Mac is incredibly simple, thanks to Docker Desktop.
Docker Desktop is one of the easiest methods of installing and managing Docker on macOS. With this GUI tool installed you can easily deploy and manage containers, all from your Mac.
But did you know that Docker desktop can also include Kubernetes? That’s right. With a few quick clicks you can get a single-node Kubernetes cluster up and running all from within the handy Docker Desktop GUI.
Let me show you how easy this is.
SEE: Serverless computing: A guide for IT leaders (TechRepublic Premium)
What you need
The only thing you need to get this up and running is a working installation of Docker Desktop on your Mac laptop, desktop, or server. To find out how to get Docker Desktop installed, read “The easiest way to install Docker on macOS.”
In order to enable Kubernetes with Docker Desktop, click on the Docker Desktop icon (in the macOS panel) and click Preferences (Figure A).
In the Preferences window, click the Kubernetes tab and then click the checkbox for Enable Kubernetes (Figure B).
You can optionally set Kubernetes as the default orchestrator for the docker stack command. The docker stack command allows you to deploy an entire stack of services with a single docker command.
After clicking the Enable Kubernetes checkbox, you’ll be warned that the installation will take some time (roughly 2-5 minutes). Click Install (Figure C) and the process will start.
While Kubernetes is being installed, you can opt to have it run in the background (so you can continue working with Docker Desktop), or you can simply let it complete the process. When the installation finishes, a new window will pop up informing you that the installation is complete. Close that window and you’ll then see that Kubernetes is, in fact, running on your system (Figure D).
Testing the installation
We can run a quick and easy test, to make sure that Kubernetes is actually running on the machine. Open a macOS terminal window and issue the command:
Kubernetes should report that both Kubernetes master and KubeDNS are running on localhost:6443 (Figure E).
And that’s how easy it is to get a single node Kubernetes instance up and running, thanks to the Docker Desktop GUI. You can now begin developing for one of the most powerful container tools on the market.