From 9dac15e329f08a09474f224e03f2c08d135b31f6 Mon Sep 17 00:00:00 2001 From: Craig Brookes Date: Mon, 14 Oct 2024 14:31:02 +0100 Subject: [PATCH] small updates and improvements for install docs (#939) Signed-off-by: craig rh-pre-commit.version: 2.2.0 rh-pre-commit.check-secrets: ENABLED update RLP version --- doc/install/install-kubernetes.md | 44 ++++++++++------- doc/install/install-openshift.md | 28 +++++++---- doc/user-guides/secure-protect-connect.md | 60 ++++++++++++++++++++--- 3 files changed, 98 insertions(+), 34 deletions(-) diff --git a/doc/install/install-kubernetes.md b/doc/install/install-kubernetes.md index 7a3b6dca9..993524dfa 100644 --- a/doc/install/install-kubernetes.md +++ b/doc/install/install-kubernetes.md @@ -10,6 +10,7 @@ All required labels are formatted as `kuadrant.io/*`. Removal of any labels with the prefix may cause unexpected behaviour and degradation of the product. + ## Prerequisites - Access to a Kubernetes cluster, with `kubeadmin` or an account with similar permissions @@ -48,9 +49,9 @@ curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releas There are several ways to install Istio (via `istioctl`, Helm chart or Operator) - this is just an example for starting from a bare Kubernetes cluster. ```bash -curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.21.4 sh - -./istio-1.21.4/bin/istioctl install --set profile=minimal -./istio-1.21.4/bin/istioctl operator init +curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.22.5 sh - +./istio-1.22.5/bin/istioctl install --set profile=minimal +./istio-1.22.5/bin/istioctl operator init kubectl apply -f https://raw.githubusercontent.com/Kuadrant/kuadrant-operator/main/config/dependencies/istio/istio-operator.yaml ``` @@ -115,7 +116,9 @@ Kuadrant is now ready to use. ### (Optional) `DNSPolicy` setup -If you plan to use `DNSPolicy`, you will need an AWS Account with access to Route 53 (more providers coming soon), and a hosted zone. +If you plan to use `DNSPolicy`, this doc uses an AWS Account with access to Route 53. There are other providers that you can also use for DNS integration: + +[DNS Providers](https://docs.kuadrant.io/latest/dns-operator/docs/provider/) Export the following environment variables for setup: @@ -146,7 +149,11 @@ Follow these steps to create the necessary secret: ```bash # Replace this with an accessible Redis cluster URL export REDIS_URL=redis://user:xxxxxx@some-redis.com:6379 - + + ``` +3. Create the secret: + + ```bash kubectl -n kuadrant-system create secret generic redis-config \ --from-literal=URL=$REDIS_URL ``` @@ -154,24 +161,25 @@ Follow these steps to create the necessary secret: This will create a secret named `redis-config` in the `kuadrant-system` namespace containing your Redis cluster URL, which Kuadrant will use for multi-cluster rate limiting. -You'll also need to update your earlier created `Kuadrant` instance to reconfigure Kuadrant to use Redis: +You'll also need to update the `Limitador` instance (the component that handles rate limiting) to reconfigure Kuadrant to use Redis: ```bash -kubectl apply -f - <**Note:** If you are running on a local kind cluster, it is also recommended you use [metallb](https://metallb.universe.tf/) to setup an IP address pool to use with loadbalancer services for your gateways. An example script for configuring metallb based on the docker network once installed can be found [here](https://github.com/Kuadrant/kuadrant-operator/blob/main/utils/docker-network-ipaddresspool.sh). + +``` +./utils/docker-network-ipaddresspool.sh kind yq 1 | kubectl apply -n metallb-system -f - +``` + ## Overview In this guide, we will cover the different policies from Kuadrant and how you can use them to secure, protect and connect an Istio-controlled gateway in a single cluster, and how you can set more refined protection on the HTTPRoutes exposed by that gateway. @@ -40,7 +49,7 @@ Adjust the name of the cluster accordingly to match the kubernetes cluster you a You can get the current context with `kubectl config current-context` ```sh -# Typical single cluster context +# Typical single cluster context export KUBECTL_CONTEXT=kind-kuadrant-local # Example context for additional 'multi cluster' clusters @@ -115,7 +124,7 @@ spec: EOF ``` -> **Note:** You may have to create a cluster issuer in the Kubernetes cluster, depending on if one was created during your initial cluster setup or not. Here is an example of how to create a self-signed CA as a cluster issuer. +> **Note:** You may have to create a cluster issuer in the Kubernetes cluster, depending on if one was created during your initial cluster setup or not. Here is an example of how to create a self-signed CA as a cluster issuer. This is a self signed issuer for simplicity, but you can use other issuers such as [letsencrypt](https://letsencrypt.org/). Refer to the [cert-manager docs](https://cert-manager.io/docs/configuration/acme/dns01/route53/#iam-user-with-long-term-access-key) ```sh kubectl --context $KUBECTL_CONTEXT apply -f - < **Note:** This configuration will work fine for a single gateway also, but does create some additional records. + +```sh +kubectl --context $KUBECTL_CONTEXT apply -f - < **Note:** This resource is managed by kuadrant and so shouldn't be changed directly. ```sh kubectl --context $KUBECTL_CONTEXT get dnsrecord.kuadrant.io api-gateway-api -n kuadrant-system -o=yaml ``` -So now we have a wildcard DNS record to bring traffic to our gateway. -Let's test it again. This time we expect a `403` still as the _deny-all_ policy is still in effect. Notice we no longer need to set the Host header directly. +With DNS in place, let's test it again. This time we expect a `403` still as the _deny-all_ policy is still in effect. Notice we no longer need to set the Host header directly. > **Note:** If you have followed through this guide on more than 1 cluster, the DNS record for the HTTPRoute hostname will have multiple IP addresses. This means that requests will be made in a round robin pattern across clusters as your DNS provider sends different responses to lookups. You may need to send multiple requests before one hits the cluster you are currently configuring.