Skip to content

kamloiic/k3d-local-steup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Local setup of a kubernetes infrastructure

Note: All the procedures has been tested on Mac using

Local docker registry

Create a new docker registry locally

sh docker-registry.sh

Edit your /etc/hosts/ file

127.0.0.1 registry.local

Test the registry

docker pull containous/whoami
docker tag  containous/whoami registry.local:5000/containous/whoami:latest
docker push registry.local:5000/containous/whoami:latest

Create k3d cluster

Create a new k3d cluster using the command below. It will install the cluster without Traefik that we will deploy in the next step.

k3d cluster create $cluster_name \
  --k3s-arg "--no-deploy=traefik@server:0" \
  --port "80:32080@loadbalancer" \
  --port "443:32443@loadbalancer" \
  --port "9000:32090@loadbalancer" \
  --port "9042:32091@loadbalancer" \
  --port "9142:32092@loadbalancer" \
  --port "8880:30080@loadbalancer" \
  --port "8881:30081@loadbalancer" \
  --port "8882:30082@loadbalancer"

Use the Traefik Helm values file traefik.values.yaml to install.

helm repo add traefik https://helm.traefik.io/traefik
helm repo update
helm install traefik traefik/traefik -n traefik --create-namespace -f traefik.values.yaml

To make sure that the deployment is running

kubectl get svc -n traefik

To test the Traefik deployment, apply the test-k3d-traefik.yaml and run the following command

curl -k https://localhost:80/whoami/

About

Local setup of a k3d cluster

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages