diff --git a/docs/demos/dns-policy/Kuadrant - DNSPolicy (1).png b/docs/demos/dns-policy/Kuadrant - DNSPolicy (1).png deleted file mode 100644 index 572fc7d0..00000000 Binary files a/docs/demos/dns-policy/Kuadrant - DNSPolicy (1).png and /dev/null differ diff --git a/docs/demos/dns-policy/Kuadrant - DNSPolicy (2).png b/docs/demos/dns-policy/Kuadrant - DNSPolicy (2).png deleted file mode 100644 index fd2d9051..00000000 Binary files a/docs/demos/dns-policy/Kuadrant - DNSPolicy (2).png and /dev/null differ diff --git a/docs/demos/dns-policy/Kuadrant - DNSPolicy (3).png b/docs/demos/dns-policy/Kuadrant - DNSPolicy (3).png deleted file mode 100644 index 9dc510e3..00000000 Binary files a/docs/demos/dns-policy/Kuadrant - DNSPolicy (3).png and /dev/null differ diff --git a/docs/demos/dns-policy/Kuadrant - DNSPolicy.png b/docs/demos/dns-policy/Kuadrant - DNSPolicy.png deleted file mode 100644 index 50978b98..00000000 Binary files a/docs/demos/dns-policy/Kuadrant - DNSPolicy.png and /dev/null differ diff --git a/docs/demos/dns-policy/cleanup.sh b/docs/demos/dns-policy/cleanup.sh deleted file mode 100755 index b507b42d..00000000 --- a/docs/demos/dns-policy/cleanup.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -kubectl --context kind-mgc-workload-2 delete -f resources/echo-app.yaml -kubectl --context kind-mgc-workload-1 delete -f resources/echo-app.yaml -kubectl --context kind-mgc-control-plane delete -f resources/echo-app.yaml - -kubectl delete tlspolicy --all -A -sleep 2 -kubectl delete dnspolicy --all -A -sleep 2 -kubectl delete dnsrecords --all -A -kubectl delete gateways --all -A - -kubectl delete -f resources/gateway_prod-web.yaml -kubectl delete -f ../../../hack/ocm/gatewayclass.yaml -kubectl delete -f resources/placement_http-gateway.yaml -kubectl delete -f resources/managed-cluster-set-binding_gateway-clusters.yaml -kubectl delete -f resources/managed-cluster-set_gateway-clusters.yaml -kubectl --context kind-mgc-control-plane remove -f resources/tlspolicy_prod-web.yaml - -kubectl label managedcluster kind-mgc-control-plane ingress-cluster- -kubectl label managedcluster kind-mgc-workload-1 ingress-cluster- -kubectl label managedcluster kind-mgc-workload-2 ingress-cluster- - -kubectl label managedcluster kind-mgc-control-plane kuadrant.io/lb-attribute-geo-code- -kubectl label managedcluster kind-mgc-workload-1 kuadrant.io/lb-attribute-geo-code- -kubectl label managedcluster kind-mgc-workload-2 kuadrant.io/lb-attribute-geo-code- - -kubectl label managedcluster kind-mgc-control-plane kuadrant.io/lb-attribute-custom-weight- -kubectl label managedcluster kind-mgc-workload-1 kuadrant.io/lb-attribute-custom-weight- -kubectl label managedcluster kind-mgc-workload-2 kuadrant.io/lb-attribute-custom-weight- diff --git a/docs/demos/dns-policy/default.png b/docs/demos/dns-policy/default.png deleted file mode 100644 index 02416581..00000000 Binary files a/docs/demos/dns-policy/default.png and /dev/null differ diff --git a/docs/demos/dns-policy/dnspolicy-demo.md b/docs/demos/dns-policy/dnspolicy-demo.md deleted file mode 100644 index 22e586d5..00000000 --- a/docs/demos/dns-policy/dnspolicy-demo.md +++ /dev/null @@ -1,179 +0,0 @@ -# Kuadrant DNSPolicy Demo - -## Goals -* Show changes in how MGC manages DNS resources through a direct attachment DNS policy -* Show changes to the DNS Record structure -* Show weighted load balancing strategy and how it can be configured -* Show geo load balancing strategy and how it can be configured - -## Setup - -```bash -# make local-setup OCM_SINGLE=true MGC_WORKLOAD_CLUSTERS_COUNT=2 -``` - -```bash -./install.sh - && make build-gateway-controller run-gateway-controller) - -## separate window - - make build-policy-controller install run-policy-controller) - - -``` -## Preamble - -Three managed clusters labeled as ingress clusters -```bash -kubectl get managedclusters --show-labels -``` - -Show managed zone -```bash -kubectl get managedzones -n multi-cluster-gateways -``` - -Show gateway created on the hub -```bash -kubectl get gateway -n multi-cluster-gateways -``` -Show gateways -```bash -# Check gateways -kubectl --context kind-mgc-control-plane get gateways -A -kubectl --context kind-mgc-workload-1 get gateways -A -kubectl --context kind-mgc-workload-2 get gateways -A -``` - -Show application deployed to each cluster -```bash -curl -k -s -o /dev/null -w "%{http_code}\n" https://bfa.jm.hcpapps.net --resolve 'bfa.jm.hcpapps.net:443:172.31.200.0' -curl -k -s -o /dev/null -w "%{http_code}\n" https://bfa.jm.hcpapps.net --resolve 'bfa.jm.hcpapps.net:443:172.31.201.0' -curl -k -s -o /dev/null -w "%{http_code}\n" https://bfa.jm.hcpapps.net --resolve 'bfa.jm.hcpapps.net:443:172.31.202.0' -``` - -Show status of gateway on the hub: -```bash -kubectl get gateway prod-web -n multi-cluster-gateways -o=jsonpath='{.status}' -``` - -## DNSPolicy using direct attachment - -Explain the changes that have been made to the dns reconciliation, that it now uses direct policy attachement and that a DNSPOlicy must be created and attached to a target gateway before any dns updates will be made for a gateway. - -Show no dnsrecord -```bash -kubectl --context kind-mgc-control-plane get dnsrecord -n multi-cluster-gateways -``` - -Show no response for host -```bash -# Warning, will cache for 5 mins!!!!!! -curl -k https://bfa.jm.hcpapps.net -``` - -Show no dnspolicy -```bash -kubectl --context kind-mgc-control-plane get dnspolicy -n multi-cluster-gateways -``` - -Create dnspolicy -```bash -cat resources/dnspolicy_prod-web-default.yaml -kubectl --context kind-mgc-control-plane apply -f resources/dnspolicy_prod-web-default.yaml -n multi-cluster-gateways -``` - -```bash -# Check policy attachment -kubectl --context kind-mgc-control-plane get gateway prod-web -n multi-cluster-gateways -o=jsonpath='{.metadata.annotations}' -``` - -Show dnsrecord created -```bash -kubectl --context kind-mgc-control-plane get dnsrecord -n multi-cluster-gateways -``` - - - - - -Show response for host -```bash -curl -k https://bfa.jm.hcpapps.net -``` - -## DNS Record Structure - -Show the new record structure - -```bash -kubectl get dnsrecord prod-web-api -n multi-cluster-gateways -o=jsonpath='{.spec.endpoints}' -``` - -## Weighted loadbalancing by default - -Show and update default weight in policy (Show result sin Route53) -```bash -kubectl --context kind-mgc-control-plane edit dnspolicy prod-web -n multi-cluster-gateways -``` - -"A DNSPolicy with an empty `loadBalancing` spec, or with a `loadBalancing.weighted.defaultWeight` set and nothing else produces a set of records grouped and weighted to produce a [Round Robin](https://en.wikipedia.org/wiki/Round-robin_DNS) routing strategy where all target clusters will have an equal chance of being returned in DNS queries." - -## Custom Weighting - -Edit dnsPolicy and add custom weights: -```bash -kubectl --context kind-mgc-control-plane edit dnspolicy prod-web -n multi-cluster-gateways -``` - -```yaml -spec: - loadBalancing: - weighted: - custom: - - value: AWS - weight: 200 - - value: GCP - weight: 10 - defaultWeight: 100 -``` - -Add custom weight labels -```bash -kubectl get managedclusters --show-labels -kubectl label --overwrite managedcluster kind-mgc-workload-1 kuadrant.io/lb-attribute-custom-weight=AWS -kubectl label --overwrite managedcluster kind-mgc-workload-2 kuadrant.io/lb-attribute-custom-weight=GCP -``` - -## Geo load balancing - -Edit dnsPolicy and add default geo: -```bash -kubectl --context kind-mgc-control-plane edit dnspolicy prod-web -n multi-cluster-gateways -``` - -```yaml -spec: - loadBalancing: - geo: - defaultGeo: US - weighted: - custom: - - value: AWS - weight: 20 - - value: GCP - weight: 200 - defaultWeight: 100 -``` - -Add geo labels -```bash -kubectl get managedclusters --show-labels -kubectl label --overwrite managedcluster kind-mgc-workload-1 kuadrant.io/lb-attribute-geo-code=FR -kubectl label --overwrite managedcluster kind-mgc-workload-2 kuadrant.io/lb-attribute-geo-code=ES - - -Checkout that DNS: - -https://www.whatsmydns.net/#A/bfa.jm.hcpapps.net \ No newline at end of file diff --git a/docs/demos/dns-policy/dnspolicy.tape b/docs/demos/dns-policy/dnspolicy.tape deleted file mode 100644 index d32ff520..00000000 --- a/docs/demos/dns-policy/dnspolicy.tape +++ /dev/null @@ -1,294 +0,0 @@ -# This is a vhs (https://github.com/charmbracelet/vhs/) tape - for reproducable CLI recordings - -Output dnspolicy.mp4 -Set WindowBar Colorful -Set FontSize 25 -Set Width 1920 -Set Height 1080 -Set Framerate 24 - - - -Set Shell zsh - - -Type "kind get clusters" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl label managedcluster kind-mgc-control-plane ingress-cluster=true" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl label managedcluster kind-mgc-workload-1 ingress-cluster=true" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl label managedcluster kind-mgc-workload-2 ingress-cluster=true" -Sleep 500ms -Enter -Sleep 5s - -Hide -Type "clear" -Enter -Show -Sleep 500ms - -Type "kubectl apply -f resources/managed-cluster-set_gateway-clusters.yaml" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl apply -f resources/managed-cluster-set-binding_gateway-clusters.yaml" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl apply -f resources/placement_http-gateway.yaml" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl create -f ../../../hack/ocm/gatewayclass.yaml" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl apply -f resources/gateway_prod-web.yaml" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl label gateway prod-web 'cluster.open-cluster-management.io/placement'='http-gateway' -n multi-cluster-gateways" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl --context kind-mgc-control-plane apply -f resources/tlspolicy_prod-web.yaml" -Sleep 500ms -Enter -Sleep 5s - -Hide -Type "clear" -Enter -Show -Sleep 500ms - -Type "kubectl get managedclusters --show-labels" -Sleep 500ms -Enter -Sleep 5s - - -Type "cat resources/echo-app.yaml | more" -Sleep 500ms -Enter -Sleep 10s -Type "q" -Enter - -Hide -Type "clear" -Enter -Show -Sleep 500ms - -Type "kubectl --context kind-mgc-control-plane apply -f resources/echo-app.yaml" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl --context kind-mgc-workload-1 apply -f resources/echo-app.yaml" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl --context kind-mgc-workload-2 apply -f resources/echo-app.yaml" -Sleep 500ms -Enter -Sleep 5s - -Hide -Type "clear" -Enter -Show -Sleep 500ms - -Type "curl -k -s -o /dev/null -w '%{http_code}\n' https://bfa.jm.hcpapps.net --resolve 'bfa.jm.hcpapps.net:443:172.31.200.0'" -Sleep 500ms -Enter -Sleep 5s - -Type "curl -k -s -o /dev/null -w '%{http_code}\n' https://bfa.jm.hcpapps.net --resolve 'bfa.jm.hcpapps.net:443:172.31.201.0'" -Sleep 500ms -Enter -Sleep 5s - -Type "curl -k -s -o /dev/null -w '%{http_code}\n' https://bfa.jm.hcpapps.net --resolve 'bfa.jm.hcpapps.net:443:172.31.202.0'" -Sleep 500ms -Enter -Sleep 5s - -Hide -Type "clear" -Enter -Show -Sleep 500ms - -Type "kubectl --context kind-mgc-control-plane get gateways -A" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl --context kind-mgc-workload-1 get gateways -A" -Sleep 500ms -Enter -Sleep 5s - -Type "kubectl --context kind-mgc-workload-2 get gateways -A" -Sleep 500ms -Enter -Sleep 5s - -Hide -Type "clear" -Enter -Show -Sleep 500ms - -Type "kubectl get gateway prod-web -n multi-cluster-gateways -o yaml | yq .status" -Sleep 500ms -Enter -Sleep 5s - -Hide -Type "clear" -Enter -Show -Sleep 500ms - -Type "kubectl --context kind-mgc-control-plane get dnsrecord -n multi-cluster-gateways" -Sleep 500ms -Enter -Sleep 5s - -Type "cat resources/dnspolicy_prod-web-default.yaml" -Sleep 500ms -Enter -Sleep 10s - -Hide -Type "clear" -Enter -Show -Sleep 500ms - -Type "kubectl --context kind-mgc-control-plane apply -f resources/dnspolicy_prod-web-default.yaml -n multi-cluster-gateways" -Sleep 500ms -Enter -Sleep 10s - -Type "kubectl --context kind-mgc-control-plane get dnsrecord -n multi-cluster-gateways" -Sleep 500ms -Enter -Sleep 5s - -Hide -Type "clear" -Enter -Show -Sleep 500ms - -Type "kubectl get dnsrecord prod-web-api -n multi-cluster-gateways -o json | jq .spec.endpoints" -Sleep 500ms -Enter -Sleep 5s - -Hide -Type "clear" -Enter -Show -Sleep 500ms - -Type "cat resources/dnspolicy_prod-web-weighted.yaml" -Sleep 500ms -Enter -Sleep 10s - -Type "kubectl --context kind-mgc-control-plane apply -f resources/dnspolicy_prod-web-weighted.yaml -n multi-cluster-gateways" -Sleep 500ms -Enter -Sleep 10s - -Hide -Type "clear" -Enter -Show -Sleep 500ms - -Type "kubectl label --overwrite managedcluster kind-mgc-control-plane kuadrant.io/lb-attribute-custom-weight=AWS" -Sleep 500ms -Enter -Sleep 10s - -Type "kubectl label --overwrite managedcluster kind-mgc-workload-1 kuadrant.io/lb-attribute-custom-weight=AWS" -Sleep 500ms -Enter -Sleep 10s - -Type "kubectl label --overwrite managedcluster kind-mgc-workload-2 kuadrant.io/lb-attribute-custom-weight=GCP" -Sleep 500ms -Enter -Sleep 10s - -Type "kubectl get managedclusters --show-labels" -Sleep 500ms -Enter -Sleep 10s - -Hide -Type "clear" -Enter -Show -Sleep 500ms - -# Show AWS - -Type "kubectl label --overwrite managedcluster kind-mgc-control-plane kuadrant.io/lb-attribute-geo-code=ES" -Sleep 500ms -Enter -Sleep 10s - -Type "kubectl label --overwrite managedcluster kind-mgc-workload-1 kuadrant.io/lb-attribute-geo-code=DE" -Sleep 500ms -Enter -Sleep 10s - -Type "kubectl label --overwrite managedcluster kind-mgc-workload-2 kuadrant.io/lb-attribute-geo-code=US" -Sleep 500ms -Enter -Sleep 10s - -Type "kubectl get managedclusters --show-labels" -Sleep 500ms -Enter -Sleep 10s - -Type "cat resources/dnspolicy_prod-web-weighted-geo.yaml" -Sleep 500ms -Enter -Sleep 10s - -Type "kubectl --context kind-mgc-control-plane apply -f resources/dnspolicy_prod-web-weighted-geo.yaml -n multi-cluster-gateways" -Sleep 500ms -Enter -Sleep 10s - - -# https://www.whatsmydns.net/#A/bfa.jm.hcpapps.net -# Bug: Most traffic should go to GCP (WL2, ES) diff --git a/docs/demos/dns-policy/resources/dnspolicy_prod-web-default.yaml b/docs/demos/dns-policy/resources/dnspolicy_prod-web-default.yaml deleted file mode 100644 index 79295ea1..00000000 --- a/docs/demos/dns-policy/resources/dnspolicy_prod-web-default.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: kuadrant.io/v1alpha1 -kind: DNSPolicy -metadata: - name: prod-web - namespace: multi-cluster-gateways -spec: - targetRef: - name: prod-web - group: gateway.networking.k8s.io - kind: Gateway - loadBalancing: - weighted: - defaultWeight: 120 diff --git a/docs/demos/dns-policy/resources/dnspolicy_prod-web-weighted-geo.yaml b/docs/demos/dns-policy/resources/dnspolicy_prod-web-weighted-geo.yaml deleted file mode 100644 index 1ee840ba..00000000 --- a/docs/demos/dns-policy/resources/dnspolicy_prod-web-weighted-geo.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: kuadrant.io/v1alpha1 -kind: DNSPolicy -metadata: - name: prod-web - namespace: multi-cluster-gateways -spec: - targetRef: - name: prod-web - group: gateway.networking.k8s.io - kind: Gateway - loadBalancing: - geo: - defaultGeo: US - weighted: - defaultWeight: 120 - custom: - - weight: 10 - selector: - matchLabels: - kuadrant.io/lb-attribute-custom-weight: AWS - - weight: 255 - selector: - matchLabels: - kuadrant.io/lb-attribute-custom-weight: GCP \ No newline at end of file diff --git a/docs/demos/dns-policy/resources/dnspolicy_prod-web-weighted.yaml b/docs/demos/dns-policy/resources/dnspolicy_prod-web-weighted.yaml deleted file mode 100644 index 3891ac29..00000000 --- a/docs/demos/dns-policy/resources/dnspolicy_prod-web-weighted.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: kuadrant.io/v1alpha1 -kind: DNSPolicy -metadata: - name: prod-web - namespace: multi-cluster-gateways -spec: - targetRef: - name: prod-web - group: gateway.networking.k8s.io - kind: Gateway - loadBalancing: - weighted: - defaultWeight: 120 - custom: - - weight: 10 - selector: - matchLabels: - kuadrant.io/lb-attribute-custom-weight: AWS - - weight: 255 - selector: - matchLabels: - kuadrant.io/lb-attribute-custom-weight: GCP diff --git a/docs/demos/dns-policy/resources/echo-app.yaml b/docs/demos/dns-policy/resources/echo-app.yaml deleted file mode 100644 index 10beafc0..00000000 --- a/docs/demos/dns-policy/resources/echo-app.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1 -kind: HTTPRoute -metadata: - name: my-route -spec: - parentRefs: - - kind: Gateway - name: prod-web - namespace: kuadrant-multi-cluster-gateways - hostnames: - - "bfa.jm.hcpapps.net" - rules: - - backendRefs: - - name: echo - port: 8080 ---- -apiVersion: v1 -kind: Service -metadata: - name: echo -spec: - ports: - - name: http-port - port: 8080 - targetPort: http-port - protocol: TCP - selector: - app: echo ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: echo -spec: - replicas: 1 - selector: - matchLabels: - app: echo - template: - metadata: - labels: - app: echo - spec: - containers: - - name: echo - image: docker.io/jmalloc/echo-server - ports: - - name: http-port - containerPort: 8080 - protocol: TCP \ No newline at end of file diff --git a/docs/demos/dns-policy/resources/gateway_prod-web-istio.yaml b/docs/demos/dns-policy/resources/gateway_prod-web-istio.yaml deleted file mode 100644 index cf827b5d..00000000 --- a/docs/demos/dns-policy/resources/gateway_prod-web-istio.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1 -kind: Gateway -metadata: - name: prod-web-istio - namespace: multi-cluster-gateways -spec: - gatewayClassName: istio - listeners: - - allowedRoutes: - namespaces: - from: All - name: api - hostname: bfa.jm.hcpapps.net - port: 443 - protocol: HTTPS - tls: - mode: Terminate - certificateRefs: - - name: jm-hcpapps-net-tls - kind: Secret \ No newline at end of file diff --git a/docs/demos/dns-policy/resources/gateway_prod-web.yaml b/docs/demos/dns-policy/resources/gateway_prod-web.yaml deleted file mode 100644 index 24f4dc1b..00000000 --- a/docs/demos/dns-policy/resources/gateway_prod-web.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1 -kind: Gateway -metadata: - name: prod-web - namespace: multi-cluster-gateways -spec: - gatewayClassName: kuadrant-multi-cluster-gateway-instance-per-cluster - listeners: - - allowedRoutes: - namespaces: - from: All - name: api - hostname: bfa.jm.hcpapps.net - port: 443 - protocol: HTTPS - tls: - mode: Terminate - certificateRefs: - - name: jm-hcpapps-net-tls - kind: Secret \ No newline at end of file diff --git a/docs/demos/dns-policy/resources/managed-cluster-set-binding_gateway-clusters.yaml b/docs/demos/dns-policy/resources/managed-cluster-set-binding_gateway-clusters.yaml deleted file mode 100644 index e774c65f..00000000 --- a/docs/demos/dns-policy/resources/managed-cluster-set-binding_gateway-clusters.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: cluster.open-cluster-management.io/v1beta2 -kind: ManagedClusterSetBinding -metadata: - name: gateway-clusters - namespace: multi-cluster-gateways -spec: - clusterSet: gateway-clusters \ No newline at end of file diff --git a/docs/demos/dns-policy/resources/managed-cluster-set_gateway-clusters.yaml b/docs/demos/dns-policy/resources/managed-cluster-set_gateway-clusters.yaml deleted file mode 100644 index b74ca8c2..00000000 --- a/docs/demos/dns-policy/resources/managed-cluster-set_gateway-clusters.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: cluster.open-cluster-management.io/v1beta2 -kind: ManagedClusterSet -metadata: - name: gateway-clusters -spec: - clusterSelector: - labelSelector: - matchLabels: - ingress-cluster: "true" - selectorType: LabelSelector \ No newline at end of file diff --git a/docs/demos/dns-policy/resources/managedzone_jm.hcpapps.net.yaml b/docs/demos/dns-policy/resources/managedzone_jm.hcpapps.net.yaml deleted file mode 100644 index d7f63f0f..00000000 --- a/docs/demos/dns-policy/resources/managedzone_jm.hcpapps.net.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: kuadrant.io/v1alpha1 -kind: ManagedZone -metadata: - name: jm.hcpapps.net - namespace: multi-cluster-gateways -spec: - id: Z04114632NOABXYWH93QU - domainName: jm.hcpapps.net - description: "jm.hcpapps.net managed domain" - dnsProviderSecretRef: - name: mgc-aws-credentials diff --git a/docs/demos/dns-policy/resources/placement_http-gateway.yaml b/docs/demos/dns-policy/resources/placement_http-gateway.yaml deleted file mode 100644 index d952f1ff..00000000 --- a/docs/demos/dns-policy/resources/placement_http-gateway.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: cluster.open-cluster-management.io/v1beta1 -kind: Placement -metadata: - name: http-gateway - namespace: multi-cluster-gateways -spec: - numberOfClusters: 3 - clusterSets: - - gateway-clusters \ No newline at end of file diff --git a/docs/demos/dns-policy/resources/tlspolicy_prod-web.yaml b/docs/demos/dns-policy/resources/tlspolicy_prod-web.yaml deleted file mode 100644 index e680be31..00000000 --- a/docs/demos/dns-policy/resources/tlspolicy_prod-web.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: kuadrant.io/v1alpha1 -kind: TLSPolicy -metadata: - name: prod-web - namespace: multi-cluster-gateways -spec: - targetRef: - name: prod-web - group: gateway.networking.k8s.io - kind: Gateway - issuerRef: - group: cert-manager.io - kind: ClusterIssuer - name: glbc-ca \ No newline at end of file diff --git a/docs/demos/dns-policy/script.sh b/docs/demos/dns-policy/script.sh deleted file mode 100644 index 0316fd10..00000000 --- a/docs/demos/dns-policy/script.sh +++ /dev/null @@ -1,100 +0,0 @@ -# We use https://github.com/charmbracelet/vhs to record the terminal session -# For this demo, we have already setup 3 kind Kubernetes clusters. -# We used the Kuadrant quickstart script to set these up, and to install Kuadrant components and dependencies. -# You can run this too, by running the following: -# export MGC_WORKLOAD_CLUSTERS_COUNT=2; curl https://raw.githubusercontent.com/kuadrant/multicluster-gateway-controller/main/hack/quickstart-setup.sh | bash - - -kind get clusters -# We have got some local kind clusters: two workload clusters, one OCM Hub/Control Plane - -# First, let us label each of these clusters as ingress-clusters which we can place Gateways on -kubectl label managedcluster kind-mgc-control-plane ingress-cluster=true -kubectl label managedcluster kind-mgc-workload-1 ingress-cluster=true -kubectl label managedcluster kind-mgc-workload-2 ingress-cluster=true - - -# Next, create a ManagedClusterSet with OCM, specifiying a label selector to select the clusters we just labelled with ingress-cluster=true -kubectl apply -f resources/managed-cluster-set_gateway-clusters.yaml - -# Now we create a ManagedClusterSetBinding to link the ManagedClusterSet named gateway-clusters to the multi-cluster-gateways namespace -kubectl apply -f resources/managed-cluster-set-binding_gateway-clusters.yaml - -# Create a Placement for the ManagedClusterSet, for our 3 clusters -kubectl apply -f resources/placement_http-gateway.yaml - -# Create a GatewayClass resource, to specify that Gateways of this class will be managed by the Kuadrant multi-cluster gateway controller -kubectl create -f ../../../hack/ocm/gatewayclass.yaml - -# Create a Gateway, called `prod-web`, (bfa.jm.hcpapps.net) -kubectl apply -f resources/gateway_prod-web.yaml -# Associate the `prod-web` Gateway with the Placement we created earlier -kubectl label gateway prod-web "cluster.open-cluster-management.io/placement"="http-gateway" -n multi-cluster-gateways - -# We have already created several OCM resources, such as a ManagedClusterSet for our clusters a Placement for this ManagedClusterSet, and a GatewayClass resource for Kuadrant to utilise our multicluster-gateway-controller -# Create a TLSPolicy -kubectl --context kind-mgc-control-plane apply -f resources/tlspolicy_prod-web.yaml - -# Get our ManagedClusters -kubectl get managedclusters --show-labels - -# We have got an echo app, which we will deploy to each of our managed clusters -cat resources/echo-app.yaml - -# Deploy an echo app to mgc-control-plane, mgc-workload-1 and mgc-workload-2 -kubectl --context kind-mgc-control-plane apply -f resources/echo-app.yaml -kubectl --context kind-mgc-workload-1 apply -f resources/echo-app.yaml -kubectl --context kind-mgc-workload-2 apply -f resources/echo-app.yaml - -# Check the apps -curl -k -s -o /dev/null -w '%{http_code}\n' https://bfa.jm.hcpapps.net --resolve 'bfa.jm.hcpapps.net:443:172.31.200.0' -curl -k -s -o /dev/null -w '%{http_code}\n' https://bfa.jm.hcpapps.net --resolve 'bfa.jm.hcpapps.net:443:172.31.201.0' -curl -k -s -o /dev/null -w '%{http_code}\n' https://bfa.jm.hcpapps.net --resolve 'bfa.jm.hcpapps.net:443:172.31.202.0' - -# Check the Gateways -kubectl --context kind-mgc-control-plane get gateways -A -kubectl --context kind-mgc-workload-1 get gateways -A -kubectl --context kind-mgc-workload-2 get gateways -A - -# And their status -kubectl get gateway prod-web -n multi-cluster-gateways -o yaml | yq .status - -# Look at a simple, RR DNSPolicy -cat resources/dnspolicy_prod-web-default.yaml - -# Apply it -kubectl --context kind-mgc-control-plane apply -f resources/dnspolicy_prod-web-default.yaml -n multi-cluster-gateways - -# Observe records created -kubectl --context kind-mgc-control-plane get dnsrecord -n multi-cluster-gateways -kubectl get dnsrecord prod-web-api -n multi-cluster-gateways -o json | jq .spec.endpoints - -# Setup weighted DNS for specifically labeled clusters -cat resources/dnspolicy_prod-web-weighted.yaml -kubectl --context kind-mgc-control-plane apply -f resources/dnspolicy_prod-web-weighted.yaml -n multi-cluster-gateways - -# Label the managedcluster clusters -kubectl label --overwrite managedcluster kind-mgc-control-plane kuadrant.io/lb-attribute-custom-weight=AWS -kubectl label --overwrite managedcluster kind-mgc-workload-1 kuadrant.io/lb-attribute-custom-weight=AWS -kubectl label --overwrite managedcluster kind-mgc-workload-2 kuadrant.io/lb-attribute-custom-weight=GCP - -# Show our labels -kubectl get managedclusters --show-labels - -# Show AWS - -# Next: Geo + Weighted -# Label the cluster geos -kubectl label --overwrite managedcluster kind-mgc-control-plane kuadrant.io/lb-attribute-geo-code=ES -kubectl label --overwrite managedcluster kind-mgc-workload-1 kuadrant.io/lb-attribute-geo-code=DE -kubectl label --overwrite managedcluster kind-mgc-workload-2 kuadrant.io/lb-attribute-geo-code=US - -# Show the labels -kubectl get managedclusters --show-labels - -# Show & apply the Geo + Weighted policy -cat resources/dnspolicy_prod-web-weighted-geo.yaml -kubectl --context kind-mgc-control-plane apply -f resources/dnspolicy_prod-web-weighted-geo.yaml -n multi-cluster-gateways - - -# Show Geo DNS working via https://www.whatsmydns.net/#A/bfa.jm.hcpapps.net diff --git a/docs/demos/dns-policy/weighted-geo-dnschecker.png b/docs/demos/dns-policy/weighted-geo-dnschecker.png deleted file mode 100644 index 1d88294f..00000000 Binary files a/docs/demos/dns-policy/weighted-geo-dnschecker.png and /dev/null differ diff --git a/docs/demos/dns-policy/weighted-geo.png b/docs/demos/dns-policy/weighted-geo.png deleted file mode 100644 index c3cbc03a..00000000 Binary files a/docs/demos/dns-policy/weighted-geo.png and /dev/null differ diff --git a/docs/demos/dns-policy/weighted.png b/docs/demos/dns-policy/weighted.png deleted file mode 100644 index 8e6f7d80..00000000 Binary files a/docs/demos/dns-policy/weighted.png and /dev/null differ