So you want to install Kubernetes on your Mac? The easiest way to get going is to run Kubernetes on Docker, using Talos OS - Talos OS will install and configure Kubernetes on Docker for you. (Note that Docker Desktop does have support for Kubernetes built in, but it is an older version of Kubernetes, and limited to a single node cluster.) You can be up and exploring Kubernetes on Mac within 10 minutes, with all the advantages of an API managed, immutable, secure Kubernetes OS.
Qubes OS is a free and open-source, security-oriented operating system for single-user desktop computing. Qubes OS leverages Xen-based virtualization to allow for the creation and management of isolated compartments called qubes. Apr 03, 2020 $ kubectl get nodes NAME STATUS ROLES AGE VERSION k3s Ready master 3h27m v1.17.4+k3s1 $ kubectl get all NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/kubernetes ClusterIP 10.43.0.1 443/TCP 3h37m $ kubectl get pods -all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE kube-system local-path-provisioner-58fb86bdfd-d9nrv 1/1. A nightly updated Mac OS image is available. Requires Mac OS Mavericks (10.9) or later. Kube is available for a variety of distributions. Minikube Like kind, minikube is a tool that lets you run Kubernetes locally. Minikube runs a single-node Kubernetes cluster on your personal computer (including Windows, macOS and Linux PCs) so that you can try out Kubernetes, or for daily development work. Sep 29, 2020 You can be up and exploring Kubernetes on Mac within 10 minutes, with all the advantages of an API managed, immutable, secure Kubernetes OS. First, install Docker Desktop. Run Docker, give it the access it asks for, and you'll see it chugging along in the menu bar.
First, install Docker Desktop.
Run Docker, give it the access it asks for, and you'll see it chugging along in the menu bar. It will launch a wizard, which you can skip if you just want to run Talos and Kubernetes on your Mac.
A key component of Talos is talosctl
, the CLI (Command Line Interface) which lets you interact with the OS running on your kubernetes nodes (virtual nodes in this case, but the same talosctl is used for Kubernetes on bare metal, VMWare, or cloud providers). Clever chameleon mac os.
To get going with talosctl
you need to download the latest release as shown below (or from Github here.)
Now, test if it's working by running: Lone troopers mac os.
Creating a local cluster is as simple as:
This command will create a simple two node cluster, with one master node and one worker node.
You can create a more complex kubernetes cluster on your Mac by passing in different parameters. Note that creating a larger cluster in Docker uses a lot of resources and takes quite a while, and is not recommended unless you have a powerful Mac. e.g. to create a cluster with 3 masters and 1 worker, use:
(Note that in order to install a new Talos OS based kubernetes cluster on the same Mac, you should talosctl cluster destroy
the old cluster first, else you will run into naming conflicts. You can manually assign unique names and run multiple clusters - but it's certainly easier to just destroy the old cluster, then create a new cluster.)
The creation of the kubernetes cluster takes a while to process (a few minutes on my Macbook Pro for a two node cluster), and you can expect to see some errors, as below, where the installation system expects services to be up, but they take longer on a docker based system than expected. Note that once the services do start, the installation proceeds correctly.
As well as the command output, you can also watch the progress from the Docker dashboard (click the Docker icon in the menu bar and select Dashboard.) Click the node talos-default-master-1, and you will see the logs of the master node, and be able to watch services start:
Once the cluster create command has exited successfully, you need to set the Kubernetes configuration so it knows how to reach the API server: Pixelbator mac os.
Mac Os Mojave
talosctl config nodes 10.5.0.2
talosctl kubeconfig .
kubectl --kubeconfig kubeconfig config set-cluster talos-default --server https://127.0.0.1:6443
Finally, we just need to modify the talosctl config to specify which nodes you want to get information on. Talosctl can operate on one or all the nodes in the cluster - this makes cluster wide commands much easier.
talosctl config nodes 10.5.0.2 10.5.0.3
As well as the command output, you can also watch the progress from the Docker dashboard (click the Docker icon in the menu bar and select Dashboard.) Click the node talos-default-master-1, and you will see the logs of the master node, and be able to watch services start:
Once the cluster create command has exited successfully, you need to set the Kubernetes configuration so it knows how to reach the API server: Pixelbator mac os.
Mac Os Mojave
talosctl config nodes 10.5.0.2
talosctl kubeconfig .
kubectl --kubeconfig kubeconfig config set-cluster talos-default --server https://127.0.0.1:6443
Finally, we just need to modify the talosctl config to specify which nodes you want to get information on. Talosctl can operate on one or all the nodes in the cluster - this makes cluster wide commands much easier.
talosctl config nodes 10.5.0.2 10.5.0.3
Note that these are the default node addresses for a one master, one worker cluster. If you already have a variety of containers running, or created more master or worker nodes, you can verify the node addresses using docker inspect
or talosctl cluster show
You now have a complete (albeit simple) kubernetes cluster running on your mac. You can use talosctl to operate and examine the nodes. Some commands to try are:
For further options with talosctl see the getting started guide and the talosctl documentation.
You can also explore kubernetes on your Mac with kubernetes commands (passing in the kubeconfig):
Line Mac Os
There are other more flexible ways to run Kubernetes on MacOS - we'll explore a qemu based installation in a later article. But if you want to get Kubernetes on a Mac up and running quickly so you can start learning and testing - Docker and Talos OS is the way to do it. And if you want to see similar ease of use in bare metal kubernetes - check out Sidero!