#!/usr/bin/env bash # # Copyright IBM Corp All Rights Reserved # # SPDX-License-Identifier: Apache-2.0 # function kind_create() { push_fn "Creating cluster \"${CLUSTER_NAME}\"" # prevent the next kind cluster from using the previous Fabric network's enrollments. rm -rf $PWD/build # todo: always delete? Maybe return no-op if the cluster already exists? kind delete cluster --name $CLUSTER_NAME local reg_name=${LOCAL_REGISTRY_NAME} local reg_port=${LOCAL_REGISTRY_PORT} local ingress_http_port=${NGINX_HTTP_PORT} local ingress_https_port=${NGINX_HTTPS_PORT} # the 'ipvs'proxy mode permits better HA abilities cat < /etc/containerd/certs.d/localhost:${reg_port}/hosts.toml </dev/null || true)" if [ "${running}" != 'true' ]; then docker run \ --detach \ --restart always \ --name "${reg_name}" \ --publish "${reg_interface}:${reg_port}:5000" \ registry:2 fi # connect the registry to the cluster network # (the network may already be connected) docker network connect "kind" "${reg_name}" || true # Document the local registry # https://github.com/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/generic/1755-communicating-a-local-registry cat <