fix: local cluster name collision (#779)

This commit is contained in:
Luke Kingland 2022-01-25 03:30:30 +09:00 committed by GitHub
parent 650f99f936
commit 6649a71f4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View File

@ -47,7 +47,7 @@ main() {
kubernetes() {
echo "${em}① Kubernetes${me}"
cat <<EOF | kind create cluster --wait=60s --config=-
cat <<EOF | kind create cluster --name=func --wait=60s --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
@ -63,7 +63,7 @@ nodes:
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:50000"]
endpoint = ["http://kind-registry:5000"]
endpoint = ["http://func-registry:5000"]
EOF
sleep 10
kubectl wait pod --for=condition=Ready -l '!job-name' -n kube-system --timeout=5m
@ -179,8 +179,8 @@ registry() {
# see https://kind.sigs.k8s.io/docs/user/local-registry/
echo "${em}⑥ Registry${me}"
docker run -d --restart=always -p "127.0.0.1:50000:5000" --name "kind-registry" registry:2
docker network connect "kind" "kind-registry"
docker run -d --restart=always -p "127.0.0.1:50000:5000" --name "func-registry" registry:2
docker network connect "kind" "func-registry"
kubectl apply -f - <<EOF
apiVersion: v1
kind: ConfigMap

View File

@ -14,12 +14,11 @@ main() {
local red=$(tput bold)$(tput setaf 2)
local reset=$(tput sgr0)
echo "${green}Deleting Cluster, Registry and Network${reset}"
kind delete cluster --name "kind"
docker stop kind-registry && docker rm kind-registry
docker network rm kind
echo "${green}Deleting Cluster and Registry${reset}"
kind delete cluster --name "func"
docker stop func-registry && docker rm func-registry
echo "${red}NOTE:${reset} The following changes have not been undone:"
echo " - Manual docker config registering registry at localhost:50000 (kind-registry) as insecure"
echo " - Config setting registry localhost:50000 (func-registry) as insecure"
echo " - Downloaded container images were not removed"
echo "${green}DONE${reset}"
}