What Will You Do¶
In this exercise,
- You will be deploying a sample application with istio proxy
- You have already provisioned or imported a Kubernetes cluster using Rafay.
- You have successfully published a istio addon based cluster blueprint to your cluster.
For this example, we will use a bookinfo application.
Step 1: Download Bookinfo sample application¶
curl -o bookinfo.yaml https://raw.githubusercontent.com/istio/istio/release-1.8/samples/bookinfo/platform/kube/bookinfo.yaml curl -s https://raw.githubusercontent.com/istio/istio/release-1.8/samples/bookinfo/networking/bookinfo-gateway.yaml >> bookinfo.yaml
Step 2: Customize the manifest to enable istio injection¶
In this step, we will be modifying the bookinfo manifest we downloaded in the previous step in enable istio injection on the namespace where we are going to deploy this application. In this example, we will be using "demo" namespace.
echo "--- > apiVersion: v1 > kind: Namespace > metadata: > name: demo > labels: > istio-injection: enabled" >> bookinfo.yaml
Step 3: Create Workload¶
- Login into the Rafay Console and navigate to your Project as an Org Admin or Project Admin
- Under Infrastructure (or Applications if accessed with Project Admin role), select "Namespaces" and create a new namespace called "demo"
- Go to Applications > Workloads
- Select "New Workload" to create a new workload called "bookinfo"
- Ensure that you select "k8s YAML" for Package Type and select the namespace as "demo"
- Click CONTINUE to next step
- Select Choose File and upload bookinfo.yaml file
- Save and Go to Placement
- In the Placement step, select the cluster(s) that you would like to deploy bookinfo application
- Publish the bookinfo workload to the selected cluster(s)
Step 4: Verify Deployment¶
You can optionally verify whether the correct resources have been created on the cluster.
- First, we will verify the pod status
kubectl get po -n demo NAME READY STATUS RESTARTS AGE details-v1-548dc9cbdc-zrbms 2/2 Running 0 111s productpage-v1-6469799585-jcrbf 2/2 Running 0 111s ratings-v1-c79d58547-m27ql 2/2 Running 0 111s reviews-v1-5bb5947dc-fkl6t 2/2 Running 0 111s reviews-v2-cf4f69b7c-c8ptf 2/2 Running 0 111s reviews-v3-767987c9f5-nl9pn 2/2 Running 0 111s
- Then, we will verify the gateway and virtualservice.
kubectl get gateway NAME AGE bookinfo-gateway 108s kubectl get virtualservice NAME GATEWAYS HOSTS AGE bookinfo [bookinfo-gateway] [*] 112s
Below picture also confirms istio injection worked as we can see istio proxy running as sidecar to all the containers.
Congratulations! You successfully deployed an application with istio sidecar injection.