mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-23 01:55:10 +00:00
Improved wait for Nginx Ingress - this was causing some test flakes
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
This commit is contained in:
parent
9df4cdde93
commit
5db297db60
1 changed files with 29 additions and 6 deletions
|
|
@ -31,7 +31,7 @@ function load_docker_images() {
|
|||
}
|
||||
|
||||
function apply_nginx_ingress() {
|
||||
push_fn "Launching Nginx ingress controller"
|
||||
push_fn "Launching 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.
|
||||
|
|
@ -42,12 +42,29 @@ function apply_nginx_ingress() {
|
|||
pop_fn
|
||||
}
|
||||
|
||||
function install_cert_manager() {
|
||||
push_fn "Installing cert-manager"
|
||||
function wait_for_nginx_ingress() {
|
||||
push_fn "Waiting for ingress controller"
|
||||
|
||||
# Install cert-manager to manage TLS certificates
|
||||
kubectl wait --namespace ingress-nginx \
|
||||
--for=condition=ready pod \
|
||||
--selector=app.kubernetes.io/component=controller \
|
||||
--timeout=90s
|
||||
|
||||
pop_fn
|
||||
}
|
||||
|
||||
function apply_cert_manager() {
|
||||
push_fn "Launching cert-manager"
|
||||
|
||||
# Install cert-manager to manage TLS certificates
|
||||
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml
|
||||
|
||||
pop_fn
|
||||
}
|
||||
|
||||
function wait_for_cert_manager() {
|
||||
push_fn "Waiting for cert-manager"
|
||||
|
||||
kubectl -n cert-manager rollout status deploy/cert-manager
|
||||
kubectl -n cert-manager rollout status deploy/cert-manager-cainjector
|
||||
kubectl -n cert-manager rollout status deploy/cert-manager-webhook
|
||||
|
|
@ -58,6 +75,9 @@ function install_cert_manager() {
|
|||
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
|
||||
|
||||
|
|
@ -157,13 +177,16 @@ function kind_init() {
|
|||
|
||||
kind_create
|
||||
apply_nginx_ingress
|
||||
install_cert_manager
|
||||
apply_cert_manager
|
||||
launch_docker_registry
|
||||
|
||||
if [ "${STAGE_DOCKER_IMAGES}" == true ]; then
|
||||
pull_docker_images
|
||||
load_docker_images
|
||||
fi
|
||||
fi
|
||||
|
||||
wait_for_cert_manager
|
||||
wait_for_nginx_ingress
|
||||
}
|
||||
|
||||
function kind_unkind() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue