Skip to content

Instantly share code, notes, and snippets.

@thomasdarimont
Last active July 6, 2023 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasdarimont/5db95906158745bac779b760fbf6999f to your computer and use it in GitHub Desktop.
Save thomasdarimont/5db95906158745bac779b760fbf6999f to your computer and use it in GitHub Desktop.
Kind with local registry

Create locale registry

create-podman-registry.sh

#!/bin/sh
reg_name='kind-registry'
reg_port='5000'
running="$(podman inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)"
if [ "${running}" != 'true' ]; then
  podman run \
    -d --restart=always -p "${reg_port}:5000" --name "${reg_name}" \
    registry:2
fi

kind cluster config with local registry

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
containerdConfigPatches:
- |-
  [plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5000"]
    endpoint = ["http://kind-registry:5000"]  

Create new Kind cluster with access to local registry

kind create cluster --config local-registry.yaml

Connect networks

podman network connect "kind" "kind-registry"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment