From eed725c8fc2f8e7c432beff99317c8f0f180216b Mon Sep 17 00:00:00 2001 From: Alan Greene Date: Fri, 20 Aug 2021 15:04:23 +0100 Subject: [PATCH] Make use of ingress in local dev cluster opt-in Update the behaviour of the `prepare-kind-cluster create` command so it no longer installs and configures an ingress. This reduces the resources required for the default dev environment as we no longer need to install and configure the nginx ingress controller. It also avoids issues where ports 80 or 443 are already bound to other services on the host machine. Add a new command `prepare-kind-cluster create-with-ingress` which will behave in the same way as the previous `create` command, allowing devs to opt-in to this behaviour if they wish. --- docs/dev/README.md | 8 +++++++- scripts/prepare-kind-cluster | 19 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/docs/dev/README.md b/docs/dev/README.md index 7316c5651..25a793c30 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md @@ -136,7 +136,7 @@ e.g. to connect your local dev frontend to the Dashboard deployed on the robocat The Dashboard repository contains a script that will provision a [`kind` cluster](https://kind.sigs.k8s.io/) named 'tekton-dashboard' with the latest releases of Tekton Pipelines and Tekton Triggers installed, as well as a version of the Tekton Dashboard which can be customised by providing additional parameters matching those expected by the installer script described earlier. -For example, the following will create a cluster with a local build of the Tekton Dashboard with log streaming enabled, exposed via ingress at `tekton-dashboard.127.0.0.1.nip.io`: +For example, the following will create a cluster with a local build of the Tekton Dashboard with log streaming enabled: `./scripts/prepare-kind-cluster create` @@ -144,6 +144,12 @@ To delete the cluster: `./script/prepare-kind-cluster delete` +To create a cluster with the Tekton Dashboard exposed via ingress at `tekton-dashboard.127.0.0.1.nip.io`: + +`./scripts/prepare-kind-cluster create-with-ingress` + +This ensures the cluster is created with the required node labels and port mappings (ports 80 and 443). + ## Run backend tests ### Backend unit tests diff --git a/scripts/prepare-kind-cluster b/scripts/prepare-kind-cluster index 61021e0ac..4cfb025fe 100755 --- a/scripts/prepare-kind-cluster +++ b/scripts/prepare-kind-cluster @@ -14,10 +14,14 @@ set -e CLUSTERNAME=tekton-dashboard -DEFAULT_OPTIONS="--log-format console --ingress-url tekton-dashboard.127.0.0.1.nip.io" +DEFAULT_OPTIONS="--log-format console" +ENABLE_INGRESS="false" create_cluster() { -kind create cluster --name $CLUSTERNAME --config - <