diff --git a/doc/user-guides/secure-protect-connect.md b/doc/user-guides/secure-protect-connect.md index e3c71faf4..845a25bef 100644 --- a/doc/user-guides/secure-protect-connect.md +++ b/doc/user-guides/secure-protect-connect.md @@ -82,7 +82,7 @@ This is because currently there is not a TLS secret in place. Let's fix that by ### ❸ Define the TLSPolicy -Note: For convenience, in the setup, we have created a self-signed CA as a cluster issuer in the Kubernetes cluster. +> **Note:** For convenience, in the setup, we have created a self-signed CA as a cluster issuer in the Kubernetes cluster. ```sh kubectl --context kind-kuadrant-local apply -f - < **Note:** It may take a couple of minutes for the RateLimitPolicy to be applied depending on your cluster. + The limit here is artificially low in order for us to show it working easily. Let's test it with our endpoint: ```sh @@ -363,6 +365,8 @@ spec: EOF ``` +> **Note:** It may take a couple of minutes for the RateLimitPolicy to be applied depending on your cluster. + As just another example, we have given **bob** twice as many requests to use compared to everyone else. Let's test this new setup. diff --git a/hack/quickstart-setup.sh b/hack/quickstart-setup.sh new file mode 100755 index 000000000..cfa5667b5 --- /dev/null +++ b/hack/quickstart-setup.sh @@ -0,0 +1,111 @@ +#!/bin/bash + +# +# Copyright 2021 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +if [ -z $KUADRANT_ORG ]; then + KUADRANT_ORG=${KUADRANT_ORG:="kuadrant"} +fi +if [ -z $KUADRANT_REF ]; then + KUADRANT_REF=${KUADRANT_REF:="main"} +fi +if [ -z $MGC_REF ]; then + MGC_REF=${MGC_REF:="main"} +fi + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/${KUADRANT_ORG}/multicluster-gateway-controller/${MGC_REF}/hack/.quickstartEnv)" +source /dev/stdin <<< "$(curl -s https://raw.githubusercontent.com/${KUADRANT_ORG}/multicluster-gateway-controller/${MGC_REF}/hack/.deployUtils)" + +KUADRANT_IMAGE="quay.io/${KUADRANT_ORG}/kuadrant-operator:latest" +KUADRANT_REPO="github.com/${KUADRANT_ORG}/kuadrant-operator.git" +KUADRANT_REPO_RAW="https://raw.githubusercontent.com/${KUADRANT_ORG}/kuadrant-operator/${KUADRANT_REF}" +KUADRANT_DEPLOY_KUSTOMIZATION="${KUADRANT_REPO}/config/deploy" +KUADRANT_GATEWAY_API_KUSTOMIZATION="${KUADRANT_REPO}/config/dependencies/gateway-api" +KUADRANT_ISTIO_KUSTOMIZATION="${KUADRANT_REPO}/config/dependencies/istio/sail" +KUADRANT_CERT_MANAGER_KUSTOMIZATION="${KUADRANT_REPO}/config/dependencies/cert-manager" +KUADRANT_METALLB_KUSTOMIZATION="${KUADRANT_REPO}/config/metallb" + +set -e pipefail + +if [[ "${KUADRANT_REF}" != "main" ]]; then + echo "setting KUADRANT_REPO to use branch ${KUADRANT_REF}" + KUADRANT_IMAGE="quay.io/${KUADRANT_ORG}/kuadrant-operator:${KUADRANT_REF}" + KUADRANT_GATEWAY_API_KUSTOMIZATION=${KUADRANT_GATEWAY_API_KUSTOMIZATION}?ref=${KUADRANT_REF} + KUADRANT_ISTIO_KUSTOMIZATION=${KUADRANT_ISTIO_KUSTOMIZATION}?ref=${KUADRANT_REF} + KUADRANT_CERT_MANAGER_KUSTOMIZATION=${KUADRANT_CERT_MANAGER_KUSTOMIZATION}?ref=${KUADRANT_REF} + KUADRANT_METALLB_KUSTOMIZATION=${KUADRANT_METALLB_KUSTOMIZATION}?ref=${KUADRANT_REF} +fi + +# Make temporary directory +mkdir -p ${TMP_DIR} + +KUADRANT_CLUSTER_NAME=kuadrant-local +KUADRANT_NAMESPACE=kuadrant-system + +echo "Do you want to set up a DNS provider? (y/N)" +read SETUP_PROVIDER