I am using docker toolbox (windows 7) to create my docker image, now I would like to use kubernetes as a container orchestration.
I want to run Kubernetes locally, I install it using minikube and kubectl. Is it the best way? Can I use k3s on windows7 ?
And is it possible to create a private registry as docker hub on windows 7?
Thank you.
Docker Desktop 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.
Refer to : https://docs.docker.com/docker-for-windows/kubernetes/
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.
You can deploy a stack on Kubernetes with docker stack deploy
, the docker-compose.yml
file, and the name of the stack.
docker stack deploy --compose-file /path/to/docker-compose.yml mystack
docker stack services mystack
To be able running on kubernetes specify the orchestrator
in your stack deployment.
docker stack deploy --orchestrator kubernetes --compose-file /path/to/docker-compose.yml mystack
Exaples Apps :
version: '3.3'
services:
traefik:
image: traefik:v2.2
container_name: traefik
restart: always
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
ports:
- 80:80
- 443:443
networks:
- nexus
volumes:
- /var/run/docker.sock:/var/run/docker.sock
nexus:
container_name: nexus
image: sonatype/nexus3
restart: always
networks:
- nexus
volumes:
- /nexus-data:/nexus-data
labels:
- traefik.port=8081
- traefik.http.routers.nexus.rule=Host(`NEXUS.mydomain.com`)
- traefik.enable=true
- traefik.http.routers.nexus.entrypoints=websecure
- traefik.http.routers.nexus.tls=true
- traefik.http.routers.nexus.tls.certresolver=myresolver
networks:
nexus:
external: true
The easiest way to experiment with Kubernetes locally is with Minikube.
As for a docker registry, I would suggest running the official registry image from Docker Hub. When you want to step up, Nexus is a really nice choice.
If you want to play with Kubernetes, the latest version of Docker Desktop allows you to setup a fully functional Kubernetes environment on your desktop, and enable this with a click, see image below and here Docker docs
A private registry allows you to store your images, and pull offical images provided by vendors. That's a cloud service, Docker Hub is just one of many repositories available.