Use Istio
EXPERIMENTAL
Learn how to integrate microservices managed by Istio into a DKP cluster
Istio helps you manage cloud-based deployments by providing an open-source service mesh to connect, secure, control, and observe microservices.
This topic describes how to expose an application running on the DKP cluster using the LoadBalancer (layer-4) service type.
Usage and installation of Istio on DKP is currently a self-service feature.
Before you begin
Before you begin, verify the following:
You must have access to a Linux, macOS, or Windows computer with a supported operating system version.
You must have a properly deployed and running cluster.
Determine the name of the workspace where you wish to perform the deployment. You can use the
dkp get workspacescommand to see the list of workspace names and their corresponding namespaces.Set the
WORKSPACE_NAMEenvironment variable to the name of the workspace where the cluster is attached:CODEexport WORKSPACE_NAME=<workspace_name>
Deploy Istio using DKP
Review the list of available applications to obtain the current ‘APP NAME’ for the Istio application, as you will need this name later in this procedure.
Enable the deployment of Istio to your managed or attached cluster with an AppDeployment resource. Provide the application reference name, version, and the target workspace:
dkp create appdeployment istio --app istio-1.14.1 --workspace ${WORKSPACE_NAME}
The
appRef.namemust match the appnamefrom the list of available catalog applications.Create the resource in the workspace you just created, which instructs Kommander to deploy the
AppDeploymentto theKommanderClusters in the same workspace.Observe that the
dkp createcommand must be run with theWORKSPACE_NAMEinstead of theWORKSPACE_NAMESPACEflag.
Download the Istio command line utility
Store a local environment variable containing the current Istio version running in your cluster:
CODEexport KONVOY_ISTIO_VERSION="$(kubectl get clusteraddons istio -o go-template='{{ .spec.chartReference.version }}')"Pull a copy of the corresponding Istio command line to your system:
CODEcurl -L https://istio.io/downloadIstio | ISTIO_VERSION=${KONVOY_ISTIO_VERSION} sh -Change to the Istio directory and set your PATH environment variable by running the following commands:
CODEcd istio* export PATH=$PWD/bin:$PATHYou should now be able to run the following
istioctlcommand and view the subsequent output:CODEistioctl versionCODEclient version: <your istio version here> control plane version: <your istio version here> data plane version: <your istio version here> (1 proxies)
Deploy a sample application on Istio
The Istio BookInfo sample application is composed of four separate microservices that demonstrate various Istio features.
Deploy the sample
bookinfoapplication on the Kubernetes cluster by running the following commands:IMPORTANT: Ensure your
dkpconfiguration references the cluster where you deployed Istio by setting theKUBECONFIGenvironment variable, or using the--kubeconfigflag, in accordance with Kubernetes conventions.CODEkubectl apply -f <(istioctl kube-inject -f samples/bookinfo/platform/kube/bookinfo.yaml) kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yamlGet the URL of the load balancer created on AWS for this service by running the following command:
CODEkubectl get svc istio-ingressgateway -n istio-systemThe command displays output similar to the following:
CODENAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE istio-ingressgateway LoadBalancer 10.0.29.241 a682d13086ccf11e982140acb7ee21b7-2083182676.us-west-2.elb.amazonaws.com 15020:30380/TCP,80:31380/TCP,443:31390/TCP,31400:31400/TCP,15029:30756/TCP,15030:31420/TCP,15031:31948/TCP,15032:32061/TCP,15443:31232/TCP 110sOpen a web browser and navigate to the external IP address for the load balancer to access the application.
For example, the external IP address in the sample output is
a682d13086ccf11e982140acb7ee21b7-2083182676.us-west-2.elb.amazonaws.com, enabling you to access the application using the following URL:http://a682d13086ccf11e982140acb7ee21b7-2083182676.us-west-2.elb.amazonaws.com/productpageFollow the steps in the Istio BookInfo Application documentation to understand the different Istio features.