Deploy sample apps
After you set up Gloo Gateway, deploy sample apps, such as Bookinfo and httpbin, to explore the routing and traffic management capabilities in Gloo Gateway.
The Bookinfo and httpbin app in this example are deployed without Istio sidecars. If you plan to use Gloo Gateway with Gloo Mesh to manage traffic for your service mesh, you can label the bookinfo
and httpbin
namespaces for Istio sidecar injection by running kubectl label namespace <namespace> istio-injection=enabled
.
Deploy Bookinfo
-
Create the
bookinfo
namespace.kubectl create ns bookinfo
-
Deploy the Bookinfo app.
# deploy bookinfo application components for all versions kubectl -n bookinfo apply -f https://raw.githubusercontent.com/istio/istio/1.18.3/samples/bookinfo/platform/kube/bookinfo.yaml -l 'app' # deploy an updated product page with extra container utilities such as 'curl' and 'netcat' kubectl -n bookinfo apply -f https://raw.githubusercontent.com/solo-io/gloo-mesh-use-cases/main/policy-demo/productpage-with-curl.yaml # deploy all bookinfo service accounts kubectl -n bookinfo apply -f https://raw.githubusercontent.com/istio/istio/1.18.3/samples/bookinfo/platform/kube/bookinfo.yaml -l 'account'
For more information, see the Istio on OpenShift documentation.
- Create a NetworkAttachmentDefinition custom resource for the
bookinfo
project, and elevate the permissions of thebookinfo
service account to allow the pods to use a user ID that is normally restricted by OpenShift.cat <<EOF | oc -n bookinfo create -f - apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: istio-cni EOF oc adm policy add-scc-to-group anyuid system:serviceaccounts:bookinfo
- Deploy Bookinfo.
# deploy bookinfo application components for all versions less than v3 kubectl -n bookinfo apply -f https://raw.githubusercontent.com/istio/istio/1.18.3/samples/bookinfo/platform/kube/bookinfo.yaml -l 'app,version notin (v3)' # deploy an updated product page with extra container utilities such as 'curl' and 'netcat' kubectl -n bookinfo apply -f https://raw.githubusercontent.com/solo-io/gloo-mesh-use-cases/main/policy-demo/productpage-with-curl.yaml # deploy all bookinfo service accounts kubectl -n bookinfo apply -f https://raw.githubusercontent.com/istio/istio/1.18.3/samples/bookinfo/platform/kube/bookinfo.yaml -l 'account'
- Create a NetworkAttachmentDefinition custom resource for the
-
Verify that the Bookinfo app is deployed successfully.
kubectl get pods -n bookinfo kubectl get svc -n bookinfo
Deploy httpbin
The httpbin sample app is a simple tool to test HTTP requests and responses. Unlike curl, you can see not only the response headers, but also the request headers.
-
Create an
httpbin
namespace.kubectl create ns httpbin
-
Create the
httpbin
app.kubectl -n httpbin apply -f https://raw.githubusercontent.com/solo-io/gloo-mesh-use-cases/main/policy-demo/httpbin.yaml
- Create a NetworkAttachmentDefinition custom resource for the
httpbin
project, and elevate the permissions of thehttpbin
service account to allow the pod to use a user ID that is normally restricted by OpenShift. For more information, see the Istio on OpenShift documentation.cat <<EOF | oc -n httpbin create -f - apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: istio-cni EOF oc adm policy add-scc-to-group anyuid system:serviceaccounts:httpbin
- Deploy the app to your cluster.
kubectl -n httpbin apply -f https://raw.githubusercontent.com/solo-io/gloo-mesh-use-cases/main/policy-demo/httpbin.yaml
- Create a NetworkAttachmentDefinition custom resource for the
-
Verify that the httpbin app is running.
kubectl -n httpbin get pods
Next
Create an HTTP listener on your gateway and set up routing for the sample apps.