From 8889950b60ad2201a44d6b58da67919ee0dce769 Mon Sep 17 00:00:00 2001 From: Michael Nairn Date: Tue, 21 Nov 2023 09:17:30 +0000 Subject: [PATCH] docs: TLS and DNS Policy user guides --- Makefile | 1 + doc/user-guides/gateway-dns.md | 224 +++++++++++++++++++++++++++++++++ doc/user-guides/gateway-tls.md | 209 ++++++++++++++++++++++++++++++ utils/kind-cluster.yaml | 7 +- 4 files changed, 440 insertions(+), 1 deletion(-) create mode 100644 doc/user-guides/gateway-dns.md create mode 100644 doc/user-guides/gateway-tls.md diff --git a/Makefile b/Makefile index a91225fb0..566cb02a0 100644 --- a/Makefile +++ b/Makefile @@ -371,6 +371,7 @@ deploy-dependencies: kustomize dependencies-manifests ## Deploy dependencies to .PHONY: install-metallb install-metallb: $(KUSTOMIZE) ## Installs the metallb load balancer allowing use of an LoadBalancer type with a gateway $(KUSTOMIZE) build config/metallb | kubectl apply -f - + kubectl -n metallb-system wait --for=condition=ready pod --selector=app=metallb --timeout=60s .PHONY: uninstall-metallb uninstall-metallb: $(KUSTOMIZE) diff --git a/doc/user-guides/gateway-dns.md b/doc/user-guides/gateway-dns.md new file mode 100644 index 000000000..ae5aea927 --- /dev/null +++ b/doc/user-guides/gateway-dns.md @@ -0,0 +1,224 @@ +# Gateway DNS for Cluster Operators + +This user guide walks you through an example of how to configure DNS for all routes attached to an ingress gateway. + +
+ +## Requisites + +- [Docker](https://docker.io) +- [Rout53 Hosted Zone](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingHostedZone.html) + +### Setup + +This step uses tooling from the Kuadrant Operator component to create a containerized Kubernetes server locally using [Kind](https://kind.sigs.k8s.io), +where it installs Istio, Kubernetes Gateway API and Kuadrant itself. + +Clone the project: + +```shell +git clone https://github.com/Kuadrant/kuadrant-operator && cd kuadrant-operator +``` + +Setup the environment: + +```shell +make local-setup +``` + +Install metallb: +```shell +make install-metallb +``` + +Fetch the current kind networks subnet: +```shell +docker network inspect kind -f '{{ (index .IPAM.Config 0).Subnet }}' +``` +Response: +```shell +"172.18.0.0/16" +``` + +Create IPAddressPool within kind network(Fetched by the command above) e.g. 172.18.200 +```shell +kubectl -n metallb-system apply -f -< +export AWS_HOSTED_ZONE_ID= +``` + +> **Note:** ROOT_DOMAIN and AWS_HOSTED_ZONE_ID should be set to your AWS hosted zone *name* and *id* respectively. + +### Create a ManagedZone + +Create AWS credentials secret +```shell +export AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= + +kubectl -n my-gateways create secret generic aws-credentials \ + --type=kuadrant.io/aws \ + --from-literal=AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ + --from-literal=AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY +``` + +Create a ManagedZone +```sh +kubectl -n my-gateways apply -f - < + +## Requisites + +- [Docker](https://docker.io) + +### Setup + +This step uses tooling from the Kuadrant Operator component to create a containerized Kubernetes server locally using [Kind](https://kind.sigs.k8s.io), +where it installs Istio, Kubernetes Gateway API, CertManager and Kuadrant itself. + +Clone the project: + +```shell +git clone https://github.com/Kuadrant/kuadrant-operator && cd kuadrant-operator +``` + +Setup the environment: + +```shell +make local-setup +``` + +Install metallb: +```shell +make install-metallb +``` + +Fetch the current kind networks subnet: +```shell +docker network inspect kind -f '{{ (index .IPAM.Config 0).Subnet }}' +``` +Response: +```shell +"172.18.0.0/16" +``` + +Create IPAddressPool within kind network(Fetched by the command above) e.g. 172.18.200 +```shell +kubectl -n metallb-system apply -f -< **Note:** We are using a [self-signed](https://cert-manager.io/docs/configuration/selfsigned/) issuer here but any supported CerManager issuer or cluster issuer can be used. + +```shell +kubectl get issuer selfsigned-issuer -n my-gateways +``` +Response: +```shell +NAME READY AGE +selfsigned-issuer True 18s +``` + +Create a Kuadrant `TLSPolicy` to configure TLS: +```sh +kubectl apply -n my-gateways -f - <