DEV Community

Mohamed M El-Kalioby
Mohamed M El-Kalioby

Posted on

Django on K8s (Part I: Installing Docker & minikube)


Docker is the de-facto standard for containers, Minikube is a developers playground to test and use Kubernetes without the hassle of installing it, and it can be deployed with Vagrant, or libvirt but we will use docker in this series.

Installing Docker

Installing Docker from the docker repo (based on docker documentation)

  • Remove old version

sudo apt-get remove docker docker-engine containerd runc

  • Download the required tools

sudo apt-get install ca-certificates curl gnupg lsb-release

  • Add Docker repo key

curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

  • Add Docker repo to apt

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

  • Install Docker
    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli

  • Test Installation

sudo docker run hello-world

The steps are in on the github

You shall end up by the following
Docker Installed

Note: Add your user to docker group and re-login to ubuntu.

sudo adduser $USER docker

Install minikube

Minikube configures all Kubernetes layers for the developer to play around & it has alot of options

  • Get the minikube binary using the link below for Ubuntu on amd64 or get the correct binary from the following url minikube for other platforms

curl -LO
sudo install minikube-linux-amd64 /usr/local/bin/minikube

  • Alias kubectl command
    alias kubectl="minikube kubectl --"

  • Create your minikube cluster

minikube start

Note: you can the minikube cluster IP range using --service-cluster-ip-range if your company is using range as minikube network defaults to

You shall end with something like the image below.

minikube installed

  • Test your minikube

Run kubectl get po which shall show that no resources available as shown below

minikube working

This concludes Part I of the series and next is creating a docker image for the django application.

Top comments (1)

joaorafaelm profile image

if anyone is on a mac m1 and having trouble starting minikube, you need to docker as the default driver before starting minikube: minikube config set driver docker