I'm trying to install calico locally (for development/testing) on Kubernetes with docker-desktop (Windows with WSL2). I want to install it to test network policies.
I'm following the following quickstart guide: https://projectcalico.docs.tigera.io/getting-started/kubernetes/quickstart
I don't see any pods in the calico-system namespace (Step 3 in the "Install Calico" section), nor do I see any calico pods in any namespace. I'd appreciate any help.
Dockerdesktop ist not suitable for your tutorial.
To use kubeadmin, you need a linux machine. While Kubernetes on Docker-Desktop is already intalled.
I would try using Multipass, which you can use also on Windows.
https://multipass.run/docs/installing-on-windows
Then start an instance:
multipass launch --name mynodename
multipass shell mynodename
Inside install your cluster as described in the tutorial.
You have to look which ipaddress is assigned to your multipass instance.
If your local network starts with 192.x.x.x then use
sudo kubeadm init --pod-network-cidr=10.10.0.0/16
Calico for Windows is a hybrid implementation that requires Windows nodes for Windows workloads and a Linux cluster for Calico components and Linux workloads.
And you are following the quickstart which will get you a single-host Kubernetes cluster with Calico, it will be different from the calico for windows.
For calico for windows follow this guide, Before you begin check requirements.
Related
I have a Intel Atom Dual Core with 4 GB RAM left over and want to use it to run docker images.
What possible solutions are there for such a local installation? I already found MicroK8s which looks promising, yet wondering which other alternatives there are. Is there maybe a complete distribution focused on only running docker containers?
If I would install MicroK8s, I still have to also manage the Ubuntu installation hosting it. Would be nice to have a distribution that only focuses on running docker containers and updates operating system and docker stuff together, so I know it always works fine together.
If you can run Docker, run Docker's Desktop Kubernetes Cluster.
You also can run minikube (on a top of docker, or hypervisor, or virtualbox)
kind - which is docker in docker k8s cluster.
This is a lab env for playing with Docker containers on Kubernetes without installing nothing: https://labs.play-with-k8s.com/
Minikube: https://github.com/kubernetes/minikube .
Docker Swarm: https://docs.docker.com/engine/swarm/ is an alternative to kubernetes with less features, but easy to setup. (comparison: https://medium.com/faun/kubernetes-vs-docker-swarm-whos-the-bigger-and-better-53bbe76b9d11)
Make your own cluster using VirtualBox: https://medium.com/#KevinHoffman/building-a-kubernetes-cluster-in-virtualbox-with-ubuntu-22cd338846dd
Local-machine Solutions
Community Supported Tools
Minikube is a method for creating a local, single-node Kubernetes cluster for development and testing. Setup is completely automated and doesn’t require a cloud provider account.
Kubeadm-dind is a multi-node (while minikube is single-node) Kubernetes cluster which only requires a docker daemon. It uses docker-in-docker technique to spawn the Kubernetes cluster.
Kubernetes IN Docker is a tool for running local Kubernetes clusters using Docker container “nodes”. It is primarily designed for testing Kubernetes 1.11+. You can use it to create multi-node or multi-control-plane Kubernetes clusters.
Ecosystem Tools
Docker Desktop is an easy-to-install application for your Mac or Windows environment that enables you to start coding and deploying in containers in minutes on a single-node Kubernetes cluster.
Minishift installs the community version of the Kubernetes enterprise platform OpenShift for local development & testing. It offers an all-in-one VM (minishift start) for Windows, macOS, and Linux. The container start is based on oc cluster up (Linux only). You can also install the included add-ons.
MicroK8s provides a single command installation of the latest Kubernetes release on a local machine for development and testing. Setup is quick, fast (~30 sec) and supports many plugins including Istio with a single command.
IBM Cloud Private-CE (Community Edition) can use VirtualBox on your machine to deploy Kubernetes to one or more VMs for development and test scenarios. Scales to full multi-node cluster.
IBM Cloud Private-CE (Community Edition) on Linux Containers is a Terraform/Packer/BASH based Infrastructure as Code (IaC) scripts to create a seven node (1 Boot, 1 Master, 1 Management, 1 Proxy and 3 Workers) LXD cluster on Linux Host.
Ubuntu on LXD supports a nine-instance deployment on localhost.
My very opionated answer: you should use k3s by Rancher Labs https://k3s.io/
I am new to the world containers, docker, kubernetes and I am investigating requirements for implementing a my middleware distributed project. I took some key container courses with Docker and Kubernetes.
But I would like to ask for those who have more experience, in a production environment (or just execution and instantiation of modules, where each module would be a container) what would be the dependencies to execute a container?
Is it mandatory for me to have the dependency package for docker and docker itself installed for this? To just raise the pods and services with Kubernetes is it also mandatory to have kubectl installed on my host?
Note: For local development and deployment using google cloud I have already done some testing and I know it is necessary.
To Setup docker on your system you need below things
if you are going to setup K8s with docker
docker-ce/docker
kubelet
kubectl
curl & wget
if you are going to setup k8s with minikube
you will need minikube
virtualenv
I feel you need to be more specific what exactly you wanted to know.
There are multiple container technologies are existing currently. To install docker specifically your linux machine should have kernel version > 3.10.
If you want to install Kubernetes on your linux machines
you need to modify OS level things.(like firewall,swap etc)
you need to install one of the container run time & other kubernetes packages(kubelet kubeadm kubectl ) then setup container networking.
Here you can find clear instructions to install kuberentes via Kubeadm
I have installed kubernetes on digital ocean cloud. I installed both flannel and calico as CNI. Will, that causes any problems in my cluster?
Calico and Flannel uses different default IP subnets and CNI driver binaries, they will not work together on the same cluster if you deploy them using standard (not Canal) installations. But it's required for Kubernetes cluster to have one of the network add-on installed. You are not limited to use Flannel or Calico add-ons, there are more of them
To remove Calico or Flannel from the cluster usually it's enough to run kubectl delete -f <calico-or-flannel.yaml> and reboot all nodes to get rid of interfaces created by Calico or Flannel. You may need to rejoin worker nodes to the cluster after that.
You can use them together, but make sure you configure things so that Calico isn't trying to control tunneling or routing. This joint configuration is sometimes called "Canal", but you can find the docs most on the Calico side at https://docs.projectcalico.org/v3.4/getting-started/kubernetes/installation/flannel
Most tutorials I've seen for developing with Kubernetes locally use Minikube. In the latest Edge release of Docker for Windows, you can also enable Kubernetes. I'm trying to understand the differences between the two and which I should use.
Minikube lets you choose the version of Kubernetes you want, can Docker for Windows do that? I don't see a way to configure it.
Minikube has CLI commands to enable the dashboard, heapster, ingress and other addons. I'm not sure why because my undertstanding is that these are simply executing kubectl apply -f http://....
With Minikube I can do a minikube ip to get the cluster IP address for ingress, how can I do this with Docker for Windows?
Is there anything else different that I should care about.
I feel like you largely understand the space, and mostly have answers to your questions already. You might find Docker for Mac vs. Docker Toolbox an informative read, even if it's about the Mac equivalent rather than Windows and about Docker packaged as a VM rather than Kubernetes specifically.
In fact you are stuck with the specific version of Kubernetes the Docker Edge desktop distribution publishes.
is answered in the question.
I believe NodePort-type Services are published on your host's IP address; there isn't an intermediate VM address like there is with Docker Toolbox.
Docker Toolbox and minikube always use a full-blown virtual machine with an off-the-shelf hypervisor. The Docker desktop application might use a lighter-weight virtualization engine if one is available.
Kubernetes can involve some significant background work. If you're using Kubernetes-in-Docker it's hard to "turn off" Kubernetes and still have Docker available; but if you have a separate minikube VM you can just stop it.
Here is a part from Docker documentation:
Kubernetes is only available in Docker for Windows 18.02 CE Edge.
Kubernetes support is not included in Docker for Windows 18.02 CE
Stable. To find out more about Stable and Edge channels and how to
switch between them, see General configuration.
Docker for Windows 18.02 CE Edge includes a standalone Kubernetes
server and client, as well as Docker CLI integration. The Kubernetes
server runs locally within your Docker instance, is not configurable,
and is a single-node cluster.
The Kubernetes server runs within a Docker container on your local
system, and is only for local testing. When Kubernetes support is
enabled, you can deploy your workloads, in parallel, on Kubernetes,
Swarm, and as standalone containers. Enabling or disabling the
Kubernetes server does not affect your other workloads.
See Docker for Windows > Getting started to enable Kubernetes and
begin testing the deployment of your workloads on Kubernetes.
If you have enough CPU and RAM resources, you can easily have both, minikube and docker-for-desktop on the same machine and switch between them by selecting the context, e.g.:
> kubectl config get-contexts
> kubectl config use-context docker-for-desktop
There is no place at the moment to choose the Kubernetes version for docker-for-desktop. It is preselected in the Docker distribution package.
Unfortunately, version of docker inside the minikube is a step behind compared to available on the docker website, and some features could be missing, but if you are interested in Kubernetes environment, it doesn't really matter in most cases.
Some of the features of Kubernetes rely on external resources and could be unavailable for you in case of local installation. For example, you need an ability to create Cloud Load Balancer to use some types of the Ingress or Service objects.
But other resources can be easily started inside the minikube, or docker-for-desktop using kubectl create/apply.
To expose your cluster resources externally, you can use Webhook Relay Ingress controller.
Here is a link to the installation manual.
I guess that minikube needs VirtualBox because of dockers' dependencies, but my current docker version doesn't need it.
So do I still need VirtualBox or another VM to start minikube?
this is only case on window or osx, do need virtualbox, vmware to create minikube vm using boot2docker, in Linux even Linux VM minikube can directly run kubernetes in host docker when choice --vm-driver none, which uses localkube.
Minikube uses the docker machine to manage the kubernetes VM, so it abstracts the plugin architecture that Docker Machine uses to provide a consistent way to manage various VM providers. Minikube embeds VirtualBox and VMware Fusion drivers so there are no additional steps to use them. However, other drivers require an extra binary to be present in the host PATH like KVM, xhyve, HyperV, etc.
Yes you need the virtualbox along with respective driver to run the kubernetes cluster on your machine and it is because of docker dependencies. Minikube started a virtual machine for us(based on our local environment), and a Kubernetes cluster is running in that VM i.e. all your nodes and services are running under the VM box.
You can work on Minikube even without installing VirtualBox.
Minikube also supports a --driver=none option that runs the Kubernetes components on the host and not in a VM. Using this driver requires Docker and a Linux environment but not a hypervisor.
If you’re using the none driver in Debian or a derivative, use the .deb packages for Docker rather than the snap package, which does not work with Minikube. You can download .deb packages from Docker.
You can also use --driver=docker
For more information, you can refer here
Minikube creates a simple local kubernetes cluster having one VM. Minikube needs a hypervisor such as VirtualBox or KVM... to create this VM.
Minikube won't be able to start if VirtualBox (which is the default) is not available.
minikube start
You will get this error:
VBoxManage not found. Make sure VirtualBox is installed and VBoxManage
is in the path
As per minikube Windows Getting started you can now choose between Virtual Box and Hyper-V for Windows, meaning Virtual Box is not mandatory if you have Hyper-V.
Prerequisites
Windows 8 or above
A hypervisor, such as Hyper-V or VirtualBox
Hardware virtualization support must be enabled in BIOS
4GB of RAM
Using minikube start --driver=docker works just fine. The docker engine could act as a virtual machine.