Skip to content

Commit

Permalink
Local registry mirror for local setup (#1509)
Browse files Browse the repository at this point in the history
* Enable local registry according to https://k3d.io/v5.4.4/usage/registries/#creating-a-registry-proxy-pull-through-registry

* Use it in local test-gslbX clusters

* This is to optimize local setup, especially to avoid dockerhub rate
  limiting

Signed-off-by: Yury Tsarev <yury@upbound.io>
  • Loading branch information
ytsarev authored Mar 21, 2024
1 parent badbd90 commit 83e8cde
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ deploy-k8gb-with-helm:
--set k8gb.log.level=$(LOG_LEVEL) \
--set rfc2136.enabled=true \
--set k8gb.edgeDNSServers[0]=$(shell $(CLUSTER_GSLB_GATEWAY)):1053 \
--wait --timeout=2m0s
--wait --timeout=10m0s

.PHONY: deploy-gslb-operator
deploy-gslb-operator: ## Deploy k8gb operator
Expand Down
12 changes: 12 additions & 0 deletions k3d/edge-dns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,15 @@ options:
- arg: --disable=traefik,servicelb,metrics-server,local-storage
nodeFilters:
- server:*
registries:
create:
name: k3d-docker-io # name of the registry container
proxy:
remoteURL: https://registry-1.docker.io # proxy DockerHub
volumes:
- /tmp/reg:/var/lib/registry # persist data locally in /tmp/reg
config: | # tell K3s to use this registry when pulling from DockerHub
mirrors:
"docker.io":
endpoint:
- http://k3d-docker-io:5000
6 changes: 6 additions & 0 deletions k3d/test-gslb1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ options:
- arg: --disable=traefik,servicelb,metrics-server,local-storage
nodeFilters:
- server:*
registries:
config: | # tell K3s to use this registry when pulling from DockerHub
mirrors:
"docker.io":
endpoint:
- http://k3d-docker-io:5000
6 changes: 6 additions & 0 deletions k3d/test-gslb2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ options:
- arg: --disable=traefik,servicelb,metrics-server,local-storage
nodeFilters:
- server:*
registries:
config: | # tell K3s to use this registry when pulling from DockerHub
mirrors:
"docker.io":
endpoint:
- http://k3d-docker-io:5000
6 changes: 6 additions & 0 deletions k3d/test-gslb3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ options:
- arg: --disable=traefik,servicelb,metrics-server,local-storage
nodeFilters:
- server:*
registries:
config: | # tell K3s to use this registry when pulling from DockerHub
mirrors:
"docker.io":
endpoint:
- http://k3d-docker-io:5000

0 comments on commit 83e8cde

Please sign in to comment.