diff --git a/README.md b/README.md index 10225f5..8477779 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ See end-to-end examples for: * [Cilium](examples/cilium) * [EnvoyGateway](examples/envoygateway) +* [Gloo Gateway](examples/gloo-gateway/) * [Google Cloud](examples/google-cloud) * [Kong](examples/kong) * [NGINX Kubernetes Gateway](examples/nginx/) diff --git a/examples/gloo-gateway/README.md b/examples/gloo-gateway/README.md new file mode 100644 index 0000000..fbba3ec --- /dev/null +++ b/examples/gloo-gateway/README.md @@ -0,0 +1,285 @@ +# Using Gloo Gateway with Argo Rollouts + +[Gloo Gateway](https://docs.solo.io/gloo-gateway/v2/) is an open-source project which provides API gateway functionality based on the [Kubernetes Gateway API](https://gateway-api.sigs.k8s.io/). +Integration with Argo Rollouts is simple with the Gateway API traffic router plugin. + +## Prerequisites + +* Kubernetes cluster with minimum version 1.23 + +## Step 1: Install the Kubernetes Gateway API and Gloo Gateway + +1. Install the Kubernetes Gateway API CRDs. + ```shell + kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml + ``` + +2. Install Gloo Gateway. + ```shell + helm install default -n gloo-system --create-namespace \ + oci://ghcr.io/solo-io/helm-charts/gloo-gateway \ + --version 2.0.0-beta1 \ + --wait --timeout 1m + ``` + +3. Verify that the Gloo Gateway control plane is up and running. + ```shell + kubectl get pods -n gloo-system + ``` + +4. Verify that the default `GatewayClass` resource is created. + ```shell + kubectl wait --timeout=1m -n gloo-system gatewayclass/gloo-gateway --for=condition=Accepted + ``` + + During the Helm installation, a `GatewayClass` resource is automatically created for you with the following configuration + ```yaml + apiVersion: gateway.networking.k8s.io/v1beta1 + kind: GatewayClass + metadata: + name: gloo-gateway + spec: + controllerName: solo.io/gloo-gateway + ``` + + You can use this `GatewayClass` to define `Gateway` resources that dynamically provision and configure Envoy proxies to handle incoming traffic. + + +## Step 2: Set up Argo Rollouts + +1. Install Argo Rollouts. + ```shell + kubectl create namespace argo-rollouts + kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml + ``` + + See the [installation docs](https://argo-rollouts.readthedocs.io/en/stable/installation) for more detail. + +2. Change the Argo Rollouts config map to install the Argo Rollout Gateway API Plugin. For more information, see the [project README](/README.md#installing-the-plugin). + ```yaml + cat < ver: 1.0 + % + ``` + +3. Change the pod spec in the `Rollout` to use the `v2` tag, which will start a rollout of your app. Argo Rollouts automatically starts splitting traffic between version 1 and version 2 of the app for the duration of the rollout. + ```shell + kubectl patch rollout rollouts-demo -n default \ + --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"kostiscodefresh/summer-of-k8s-app:v2"}]' + ``` + +4. Send requests to the app while the rollout is underway. As traffic is progressively split between v1 and v2 of the app, you will see responses from both versions until the rollout is completed. + ```shell + while true; do curl -H "host: demo.example.com" $GATEWAY_IP/callme; sleep 2; done + ``` + + Example output: + ``` +
ver: 2.0 +
ver: 2.0 +
ver: 1.0 +
ver: 1.0 +
ver: 2.0 + ```