Skip to content

Instantly share code, notes, and snippets.

@bademux
Last active February 14, 2024 11:40
Show Gist options
  • Save bademux/82767b85eb17aacdb8e3a24b24ac7a26 to your computer and use it in GitHub Desktop.
Save bademux/82767b85eb17aacdb8e3a24b24ac7a26 to your computer and use it in GitHub Desktop.
How to use localhost:5000 docker registry along with k3d cluster

Install k3d https://k3d.io/#installation

Create registry k3d registry create registry.localhost --port 5000

Create Cluster with registry and expose port k3d cluster create mycluster -p "8081:80@loadbalancer" --registry-use k3d-registry.localhost:5000 --registry-config registries.yaml

registries.yaml:

mirrors:
  "localhost:5000":
    endpoint:
      - http://k3d-registry.localhost:5000

optionaly:

#mirrors:
  docker.io:
    endpoint:
      - http://k3d-registry.localhost:5000

Now you can push docker push localhost:5000/myimage:latest and then use it kubectl run myimage --image localhost:5000/myimage:latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment