Deploying AI Models with Docker and Kubernetes / Start Here

Install Docker, kubectl and kind

Lesson 2 of 29. Open to read. No account needed.

What You Will Set Up

Three command-line tools do all the work in this course, and each has one job. docker builds images and runs containers through the Docker engine. kind creates a Kubernetes cluster by running a node as a Docker container. kubectl talks to a Kubernetes cluster, whichever one its configuration points at. By the end of this lesson all three are installed, each has answered a readiness command, and you know how to tell which tool a problem belongs to.

Three tools, three jobs. Your terminal runs docker, kind and kubectl. docker talks to the Docker engine, which owns images such as aim-api:0.1.0 and containers such as aim-api. kind uses Docker to create the node container aim-control-plane, which runs Kubernetes 1.36, and writes the connection details into the kubectl configuration. kubectl sends API calls to the API server inside the node through a port on 127.0.0.1. A note gives the skew rule: kubectl within one minor version of the cluster.

Read the diagram left to right. Each arrow from the terminal is one tool doing its job: docker builds, runs and pushes; kind creates the node container and, along the dashed blue line, writes the connection details into kubectl's configuration file; kubectl then calls the Kubernetes API server that lives inside that container. The node container is the only thing kind makes; everything you later deploy runs as containers inside it. Nothing in the picture leaves your computer.

The Three Tools

Docker

Docker is two things: a command-line client and an engine (a background service) that the client talks to. On Linux you install Docker Engine, the free software project, as system packages from Docker's repository or your distribution. On macOS and Windows you install Docker Desktop, which runs the engine inside a small virtual machine and includes the client, the Compose plugin and a Kubernetes option the course does not use. Docker Desktop is free for personal use, education, non-commercial open source and businesses with fewer than 250 employees and less than USD 10 million in annual revenue; larger organisations need a paid subscription. On Linux, Docker Engine carries no such terms.

Docker Engine 29 is the current series; the course's images and commands assume 29 or later and were checked with 29.4. Engine 29 stores images with the containerd image store, which matters in one place later: it is what lets the same build produce images for more than one processor architecture.

Pulling images from Docker Hub without signing in is limited to 100 pulls per six hours per network address; the course pulls about a dozen images in total, so the limit should not bite, but a free account doubles it if you share a network with others.

kubectl

kubectl is the Kubernetes command-line client. It does nothing by itself; it reads a configuration file (~/.kube/config by default, the kubeconfig) that lists clusters and credentials and names a current context, and it sends every command to that cluster's API server. The cluster you create in module 4 will add itself to that file. One rule to install by: kubectl must be within one minor version of the cluster, older or newer. The practice cluster runs Kubernetes 1.36, so kubectl 1.35, 1.36 or 1.37 is right; a 1.34 client works for most commands but prints a skew warning, and the course does not test it.

kind

kind ("Kubernetes in Docker") creates a cluster whose node is a Docker container running the Kubernetes components and a container runtime of its own. It needs only Docker, creates a cluster in a few minutes, deletes it in seconds, and loads images straight from your machine. The course uses kind v0.33.0 and pins the node image to Kubernetes 1.36.4 in module 4. On macOS and Windows, kind's documentation asks for at least 6 GB of memory for Docker Desktop's virtual machine, 8 GB recommended.

Installing

Follow the official instructions for your platform; the course does not copy them, because installers change. The table says which route each lesson was written against and what to confirm.

PlatformDockerkubectlkind
LinuxDocker Engine from Docker's repository for your distribution, plus the docker-compose-plugin package; add your user to the docker group (this grants root-equivalent privileges, so do it only on your own machine)Binary from dl.k8s.io with the checksum step, or the pkgs.k8s.io repository for the 1.36 minorRelease binary from the kind releases page
macOSDocker Desktop for Apple silicon or Intel; current and two previous macOS releases; at least 4 GB RAMbrew install kubectl or the binary with the checksum stepbrew install kind or the release binary
Windows 11Install WSL 2 with wsl --install (Ubuntu), then Docker Desktop with WSL integration enabled for that distribution; run every course command inside the Ubuntu shellInside WSL, the Linux routeInside WSL, the Linux route

On Windows, Docker Desktop also puts its own kubectl on the Windows PATH. The course uses the WSL shell only, so install kubectl there and ignore the Windows copy. On macOS, Docker Desktop installs a kubectl too; if which kubectl points into /Applications/Docker.app, that copy may lag behind the skew rule, so install your own and make sure it comes first on PATH.

Shell Bridge

The exercises run in bash or zsh and use a handful of shell features. If any of these is new, read this section; otherwise skip to the exercise.

  • Variables. AIM_PORT=18000 sets a variable for the current shell; echo $AIM_PORT prints it; export AIM_PORT=18000 also passes it to programs the shell starts. Variables vanish when the terminal closes.
  • Exit codes. Every command finishes with a number: 0 for success, anything else for failure. echo $? prints the code of the last command. curl uses 7 for "could not connect", which several exercises treat as the expected answer when checking that a port is free.
  • curl. curl -sS URL fetches a URL quietly but still shows errors; -X POST, -H and -d set the method, a header and a body; -o /dev/null -w '%{http_code}' prints only the status code.
  • Reading JSON. Many commands print JSON. The course keeps it short enough to read by eye and tells you which field to look at; where a single field matters, it uses --format or -o jsonpath options that the lesson explains at that point.
  • Here documents. A block starting cat > file <<'EOF' and ending with a line containing only EOF writes everything between into file. The quotes around the first EOF keep the text exactly as written. Copy such a block whole, from cat to EOF.

Exercise: Confirm the Toolchain

Goal: prove that each tool works and that your shell behaves as the exercises expect.

Starting state: Docker, kubectl and kind installed as above; Docker Desktop running if you use it. Internet access for one small image pull. Nothing else is required; this exercise creates no files.

  1. Docker client and engine:

    docker version
    docker run --rm hello-world
    docker compose version
    

    docker version prints a Client section and a Server section. If only the Client section appears, followed by an error, the engine is not running. Illustrative Server lines:

    Server: Docker Desktop 4.69.0 (224084)
     Engine:
      Version:          29.4.0
      API version:      1.54 (minimum version 1.40)
      OS/Arch:          linux/arm64
    

    Compare the Engine version with 29 and note the OS/Arch: it is the architecture your images will be built for. docker run --rm hello-world pulls a tiny image, runs it, prints a message that begins "Hello from Docker!" and removes the container because of --rm. docker compose version prints "Docker Compose version v2...".

  2. kubectl and kind:

    kubectl version --client
    kind version
    

    Illustrative output:

    Client Version: v1.36.4
    Kustomize Version: v5.7.1
    kind v0.33.0 go1.27.0 darwin/arm64
    

    The client minor must be 35, 36 or 37. kubectl version --client reads no cluster; without --client it would also try to reach whatever cluster the current context names and may print a connection error, which is harmless now and useful later.

  3. Which cluster would kubectl talk to right now?

    kubectl config current-context
    kubectl config get-contexts
    

    On a fresh machine the first command prints error: current-context is not set, which is the right answer for now. If it prints a name, that is a cluster you already use: note it, because the course will add kind-aim beside it and you will switch between them deliberately.

  4. The shell bridge:

    export AIM_PORT=18000
    echo "port is $AIM_PORT"
    curl -sS http://127.0.0.1:$AIM_PORT/ ; echo "exit code $?"
    

    Expected: port is 18000, then a curl error such as Failed to connect to 127.0.0.1 port 18000 and exit code 7. That is the pattern the exercises use to confirm a port is free before publishing on it.

  5. Clean up the only thing you created:

    docker image rm hello-world
    docker image ls hello-world
    

    The second command prints only its heading line.

Success: docker version shows an Engine of 29 or later, hello-world printed its message, Compose is v2, kubectl is 1.35 to 1.37, kind is v0.33.0, and the curl check ended with exit code 7.

If something differs:

What you seeLikely causeNext step
Cannot connect to the Docker daemon at unix:///...The engine is not runningStart Docker Desktop, or sudo systemctl start docker on Linux, then retry
permission denied while trying to connect to the Docker daemon socket (Linux)Your user is not in the docker groupFollow Docker's post-install steps, log out and in, retry
docker: 'compose' is not a docker commandThe Compose plugin is missing (Linux Engine)Install docker-compose-plugin from Docker's repository
kubectl version --client shows 1.34 or olderAn old or bundled client, often Docker Desktop'sInstall the current client and put it first on PATH; which kubectl shows which one runs
kind: command not foundNot installed or not on PATHReinstall from the releases page or Homebrew; echo $PATH
hello-world pull fails with toomanyrequestsDocker Hub pull limit on your networkWait, or sign in to a free Docker Hub account with docker login
docker image rm hello-world says the image is used by a containerA hello-world container exists from an earlier run without --rmdocker ps -a --filter ancestor=hello-world; remove that container with docker rm, then remove the image

Independent task: read the three illustrative failures below and, for each, write down which tool the problem belongs to (Docker, kubectl or kind) and the first command you would run to confirm it. Then check your answers.

A. $ kubectl get nodes
   The connection to the server 127.0.0.1:54124 was refused - did you specify the right host or port?

B. $ kind create cluster
   ERROR: failed to create cluster: failed to pull image "kindest/node:v1.36.4@sha256:099e04..."

C. $ docker run --rm hello-world
   docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Cleanup: done in step 5. Nothing else was created.

Check Your Understanding

  1. docker version prints a Client section and then an error. What is running and what is not?
  2. Why does the course insist on the one-minor skew rule for kubectl when a 1.34 client "mostly works" against a 1.36 cluster?
  3. On Windows, why does the course run every command inside WSL rather than in PowerShell, even though Docker Desktop provides docker.exe?
  4. You add yourself to the docker group on a Linux laptop. What have you granted yourself?

Answer and Reasoning

Independent task

A belongs to kubectl and the cluster: the client works, but the context points at an API server that is not answering, here a kind cluster that has been deleted or stopped. Confirm with kubectl config current-context and docker ps to see whether a node container exists. B belongs to kind and Docker: kind could not pull the node image, which is a Docker pull; confirm with docker pull of the same image to see the network or disk error. C belongs to Docker: the client cannot reach the engine; confirm the engine is running (Docker Desktop's window, or systemctl status docker).

Understanding check

  1. The client is installed and running; the engine is not reachable. Start Docker Desktop or the Docker service.
  2. "Mostly" is the problem: an out-of-skew client can mis-render or refuse newer fields and prints a warning on every command, and the course cannot test every combination. The rule is cheap to follow and is what the Kubernetes project supports.
  3. One shell syntax for every learner: the exercises use here documents, $VAR and exit codes the bash way, and the kind and kubectl guides for Linux apply inside WSL. Docker Desktop's WSL integration makes docker available there.
  4. Root-equivalent privileges: anyone who can talk to the Docker engine can start a container that mounts the whole disk. Docker's documentation says so, which is why the course limits this to your own machine.

References

24 more lessons in the full course

Course access opens every lesson and adds revision notes, the Quick Reference, saved progress, bookmarks and your own notes.

INR 199 plus 18% GST. 90 days of online access. No auto-renewal.

Get the full course

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy