Deploy sample apps
Deploy the Bookinfo, httpbin, and hello world sample apps.
These sample apps are used throughout the documentation to help test connectivity, such as in the traffic management, security, and resiliency policy guides.
Bookinfo
For testing purposes, you can deploy Bookinfo, the Istio sample app, and add it to your service mesh.
Save the revision that you used for your istiod installation in an environment variable. Typically, this is
mainfor a Helm installation, orgloofor a Gloo Operator installation.- Gloo Operator:
export REVISION=gloo - Helm:
export REVISION=main
- Gloo Operator:
Create the
bookinfonamespace and label it so that the services become part of the service mesh.kubectl create ns bookinfo kubectl label ns bookinfo istio.io/rev=${REVISION} --overwriteDeploy the Bookinfo app.
# deploy bookinfo application components for all versions less than v3 kubectl -n bookinfo apply -f https://raw.githubusercontent.com/istio/istio/1.25.2/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.25.2/samples/bookinfo/platform/kube/bookinfo.yaml -l 'account'Verify that the Bookinfo app deployed successfully.
kubectl get pods,svc -n bookinfo
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
httpbinnamespace and label the namespace for Istio injection so that the services in the namespace become part of the service mesh.kubectl create ns httpbin kubectl label ns httpbin istio.io/rev=main --overwrite=trueDeploy the httpbin app.
kubectl -n httpbin apply -f https://raw.githubusercontent.com/solo-io/gloo-mesh-use-cases/main/policy-demo/httpbin.yamlVerify that the httpbin app is running.
kubectl -n httpbin get pods
hello world
The hello world sample app is a simple way to test responses for different app versions. The following examples install four versions of hello world in your cluster.
Create the
helloworldnamespace and label it for Istio injection so that the services become part of the service mesh.kubectl create ns helloworld kubectl label ns helloworld istio.io/rev=main --overwrite=trueDeploy hello world v1, v2, v3, and v4 to your cluster.
kubectl -n helloworld apply -f https://raw.githubusercontent.com/solo-io/gloo-mesh-use-cases/main/policy-demo/helloworld.yamlVerify that the hello world apps are running.
kubectl -n helloworld get pods
Other service namespaces
Now that Istio is up and running, you can create service namespaces for your teams to run app workloads in. For any namespaces that you want to deploy apps to, be sure to follow these steps to include your services in the service mesh.
Save the revision that you used for your istiod installation in an environment variable. Typically, this is
mainfor a Helm installation, orgloofor a Gloo Operator installation.- Gloo Operator:
export REVISION=gloo - Helm:
export REVISION=main
- Gloo Operator:
Label the service namespace for Istio sidecar injection with the revision label.
kubectl label namespace <namespace> istio.io/rev=${REVISION} --overwriteIf you already deployed app pods to the namespace, restart the workloads so that sidecars are injected into the pods. For example, you might roll out a restart to each deployment by using a command similar to the following.
kubectl rollout restart deployment -n <namespace> <deployment>
Next
Verify routing to the sample apps and apply a fault injection policy to the reviews service to delay requests and simulate network issues or an overloaded service.