#!/bin/bash # # Copyright IBM Corp All Rights Reserved # # SPDX-License-Identifier: Apache-2.0 # function pull_docker_images() { push_fn "Pulling docker images for Fabric ${FABRIC_VERSION}" docker pull ${FABRIC_CONTAINER_REGISTRY}/fabric-ca:$FABRIC_CA_VERSION docker pull ${FABRIC_CONTAINER_REGISTRY}/fabric-orderer:$FABRIC_VERSION docker pull ${FABRIC_CONTAINER_REGISTRY}/fabric-peer:$FABRIC_VERSION docker pull ${FABRIC_CONTAINER_REGISTRY}/fabric-tools:$FABRIC_VERSION docker pull ghcr.io/hyperledgendary/fabric-ccs-builder:latest docker pull ghcr.io/hyperledgendary/fabric-ccaas-asset-transfer-basic:latest pop_fn } function load_docker_images() { push_fn "Loading docker images to KIND control plane" kind load docker-image ${FABRIC_CONTAINER_REGISTRY}/fabric-ca:$FABRIC_CA_VERSION kind load docker-image ${FABRIC_CONTAINER_REGISTRY}/fabric-orderer:$FABRIC_VERSION kind load docker-image ${FABRIC_CONTAINER_REGISTRY}/fabric-peer:$FABRIC_VERSION kind load docker-image ${FABRIC_CONTAINER_REGISTRY}/fabric-tools:$FABRIC_VERSION kind load docker-image ghcr.io/hyperledgendary/fabric-ccs-builder:latest kind load docker-image ghcr.io/hyperledgendary/fabric-ccaas-asset-transfer-basic:latest pop_fn } function apply_nginx_ingress() { push_fn "Launching Nginx ingress controller" # This ingress-nginx.yaml was generated 9/24 from https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml # with modifications for ssl-passthrough required to launch IBP-support with the nginx ingress. # It may be preferable to always load from the remote mainline? # kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml kubectl apply -f kube/ingress-nginx.yaml pop_fn } function kind_create() { push_fn "Creating cluster \"${CLUSTER_NAME}\"" # 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 </dev/null || true)" if [ "${running}" != 'true' ]; then docker run \ -d --restart=always -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" \ 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 <