Virtual Machine Installation
Follow this guide to deploy Istio and connect a virtual machine to it.
Prerequisites
- Download the Istio release5
- Perform any necessary platform-specific setup6
- Check the requirements for Pods and Services7
- Virtual machines must have IP connectivity to the ingress gateway in the connecting mesh, and optionally every pod in the mesh via L3 networking if enhanced performance is desired.
- Learn about Virtual Machine Architecture8 to gain an understanding of the high level architecture of Istio’s virtual machine integration.
Prepare the guide environment
Create a virtual machine
Set the environment variables
VM_APP
,WORK_DIR
,VM_NAMESPACE
, andSERVICE_ACCOUNT
on your machine that you’re using to set up the cluster. (e.g.,WORK_DIR="${HOME}/vmintegration"
):Create the working directory on your machine that you’re using to set up the cluster:
Install the Istio control plane
If your cluster already has an Istio control plane, you can skip the installation steps, but will still need to expose the control plane for virtual machine access.
Install Istio and expose the control plane on cluster so that your virtual machine can access it.
Create the
IstioOperator
spec for installation.Install Istio.
Deploy the east-west gateway:
Expose services inside the cluster via the east-west gateway:
Expose the control plane:
Expose the control plane:
Expose cluster services:
Ensure to label the istio-system namespace with the defined cluster network:
Configure the VM namespace
Create the namespace that will host the virtual machine:
Create a serviceaccount for the virtual machine:
Create files to transfer to the virtual machine
First, create a template WorkloadGroup
for the VM(s):
First, create a template WorkloadGroup
for the VM(s):
Then, to allow automated WorkloadEntry
creation, push the WorkloadGroup
to the cluster:
Using the Automated WorkloadEntry
Creation feature, application health checks are also available. These share the same API and behavior as Kubernetes Readiness Probes13.
For example, to configure a probe on the /ready
endpoint of your application:
With this configuration, the automatically generated WorkloadEntry
will not be marked “Ready” until the probe succeeds.
Next, use the istioctl x workload entry
command to generate:
cluster.env
: Contains metadata that identifies what namespace, service account, network CIDR and (optionally) what inbound ports to capture.istio-token
: A Kubernetes token used to get certs from the CA.mesh.yaml
: ProvidesProxyConfig
to configurediscoveryAddress
, health-checking probes, and some authentication options.root-cert.pem
: The root certificate used to authenticate.hosts
: An addendum to/etc/hosts
that the proxy will use to reach istiod for xDS.*
Configure the virtual machine
Run the following commands on the virtual machine you want to add to the Istio mesh:
Securely transfer the files from
"${WORK_DIR}"
to the virtual machine. How you choose to securely transfer those files should be done with consideration for your information security policies. For convenience in this guide, transfer all of the required files to"${HOME}"
in the virtual machine.Install the root certificate at
/etc/certs
:Install the token at
/var/run/secrets/tokens
:Install the package containing the Istio virtual machine integration runtime:
Note: only CentOS 8 is currently supported.
Install
cluster.env
within the directory/var/lib/istio/envoy/
:Install the Mesh Config to
/etc/istio/config/mesh
:Add the istiod host to
/etc/hosts
:Transfer ownership of the files in
/etc/certs/
and/var/lib/istio/envoy/
to the Istio proxy:
Start Istio within the virtual machine
Start the Istio agent:
Verify Istio Works Successfully
Check the log in
/var/log/istio/istio.log
. You should see entries similar to the following:Create a Namespace to deploy a Pod-based Service:
Deploy the
HelloWorld
Service:Send requests from your Virtual Machine to the Service:
Next Steps
For more information about virtual machines:
- Debugging Virtual Machines15 to troubleshoot issues with virtual machines.
- Bookinfo with a Virtual Machine16 to set up an example deployment of virtual machines.
Uninstall
Stop Istio on the virtual machine:
Then, remove the Istio-sidecar package:
To uninstall Istio, run the following command:
The control plane namespace (e.g., istio-system
) is not removed by default.
If no longer needed, use the following command to remove it: