Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
fixed the local registry
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinvieriu committed Jul 24, 2020
1 parent 685aa2f commit 1ba7f02
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
resources
node_modules
dist
registry
coredns-patch.yaml
kyma.crt
1 change: 1 addition & 0 deletions download-kyma-charts.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
curl https://codeload.github.com/kyma-project/kyma/zip/master --output kyma-master.zip
unzip -qq kyma-master.zip kyma-master/resources/*
rm -rf ./resources
mv kyma-master/resources .
rm -Rf ./kyma-master*
3 changes: 2 additions & 1 deletion kyma-k3d-delete.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This will delete the cluster and the docker registry
k3d cluster delete kyma
docker rm -f k3d-registry
docker rm -f registry.localhost
docker network rm k3d-kyma
8 changes: 5 additions & 3 deletions kyma-k3d.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ function waitForJobs() {
docker run -d \
-p 5000:5000 \
--restart=always \
--name k3d-registry \
--name registry.localhost \
--network k3d-kyma \
-v $PWD/registry:/var/lib/registry \
registry:2

Expand All @@ -18,9 +19,10 @@ k3d cluster create kyma \
--port 443:443@loadbalancer \
--k3s-server-arg --no-deploy \
--k3s-server-arg traefik \
--volume $PWD/registries.yaml:/etc/rancher/k3s/registries.yaml \
--timeout 60s


docker network connect k3d-kyma registry.localhost

# Delete cluster with keep-registry-volume to cache docker images
# k3d cluster delete kyma
Expand Down Expand Up @@ -58,7 +60,7 @@ helm upgrade -i testing resources/testing -n kyma-system &
kubectl apply -f cert-manager.yaml &

# Patch CoreDNS with entries for registry.localhost and *.local.kyma.dev
REGISTRY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' /k3d-registry)
REGISTRY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' /registry.localhost)
sed "s/REGISTRY_IP/$REGISTRY_IP/" coredns-patch.tpl >coredns-patch.yaml
kubectl -n kube-system patch cm coredns --patch "$(cat coredns-patch.yaml)" &
helm upgrade -i istio resources/istio --set global.isLocalEnv=true -n istio-system &
Expand Down
6 changes: 6 additions & 0 deletions registries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mirrors:
registry.localhost:5000:
endpoint:
- http://registry.localhost:5000
configs: {}
auths: {}

0 comments on commit 1ba7f02

Please sign in to comment.