"insecure-registries": [
"registry.localhost:5000"
],
"registry-mirrors": [
"https://registry-1.docker.io"
]
k3d registry create registry.localhost --port 5000
k3d cluster create --api-port 0.0.0.0:6550 -p "8081:80@loadbalancer" --registry-use k3d-registry.localhost:5000 --registry-config k3d-registries.yaml --agents 2 mycluster
docker build -t freakynit/go-k8s:1.0.0 .
docker tag freakynit/go-k8s:1.0.0 k3d-registry.localhost:5000/go-k8s:1.0.0
127.0.0.1 loadbalancer
127.0.0.1 k3d-registry.localhost
::1 k3d-registry.localhost
docker push k3d-registry.localhost:5000/go-k8s:1.0.0
Make sure that current context is of this cluster (latest version as of now does this already after creating new cluster)
kubectl apply -f k8s-deployment.yaml
kubectl get pod
curl localhost:8081/
# OR
curl loadbalancer:8081/
k3d cluster delete mycluster