Istio Operator Install
Instead of manually installing, upgrading, and uninstalling Istio,
you can instead let the Istio operator7
manage the installation for you.
This relieves you of the burden of managing different istioctl
versions.
Simply update the operator custom resource (CR) and the
operator controller will apply the corresponding configuration changes for you.
The same IstioOperator
API8 is used
to install Istio with the operator as when using the istioctl install instructions5.
In both cases, configuration is validated against a schema and the same correctness
checks are performed.
Prerequisites
Perform any necessary platform-specific setup9.
Check the Requirements for Pods and Services10.
Install the istioctl command11.
Install
Deploy the Istio operator
The istioctl
command can be used to automatically deploy the Istio operator:
This command runs the operator by creating the following resources in the istio-operator
namespace:
- The operator custom resource definition
- The operator controller deployment
- A service to access operator metrics
- Necessary Istio operator RBAC rules
You can configure which namespace the operator controller is installed in, the namespace(s) the operator watches, the installed Istio image sources and versions, and more. For example, you can pass one or more namespaces to watch using the --watchedNamespaces
flag:
See the istioctl operator init
command reference for details.
Install Istio with the operator
With the operator installed, you can now create a mesh by deploying an IstioOperator
resource.
To install the Istio demo
configuration profile12
using the operator, run the following command:
The controller will detect the IstioOperator
resource and then install the Istio
components corresponding to the specified (demo
) configuration.
The Istio control plane (istiod) will be installed in the istio-system
namespace by default. To install it in a different location, specify the namespace using the values.global.istioNamespace
field as follows:
You can confirm the Istio control plane services have been deployed with the following commands:
Update
Now, with the controller running, you can change the Istio configuration by editing or replacing
the IstioOperator
resource. The controller will detect the change and respond by updating
the Istio installation correspondingly.
For example, you can switch the installation to the default
profile with the following command:
You can also enable or disable components and modify resource settings.
For example, to enable the istio-egressgateway
component and increase pilot memory requests:
You can observe the changes that the controller makes in the cluster in response to IstioOperator
CR updates by
checking the operator controller logs:
Refer to the IstioOperator
API
for the complete set of configuration settings.
In-place Upgrade
Download and extract the istioctl
corresponding to the version of Istio you wish to upgrade to. Reinstall the operator
at the target Istio version:
You should see that the istio-operator
pod has restarted and its version has changed to the target version:
After a minute or two, the Istio control plane components should also be restarted at the new version:
Canary Upgrade
The process for canary upgrade is similar to the canary upgrade with istioctl
13.
For example, to upgrade Istio 1.20.0 to 1.21.0, first install 1.20.0 :
Deploy the operator using Istio version 1.20.0:
Install Istio control plane demo profile:
Verify that the IstioOperator
CR named example-istiocontrolplane
exists in your cluster:
Download and extract the istioctl
corresponding to the version of Istio you wish to upgrade to.
Then, run the following command to install the new target revision of the Istio control plane based on the in-cluster
IstioOperator
CR (here, we assume the target revision is 1-21-0):
Make a copy of the example-istiocontrolplane
CR and save it in a file named example-istiocontrolplane-1-21-0.yaml
.
Change the name to example-istiocontrolplane-1-21-0
and add revision: 1-21-0
to the CR.
Your updated IstioOperator
CR should look something like this:
Apply the updated IstioOperator
CR to the cluster. After that, you will have two control plane deployments and services running side-by-side:
To complete the upgrade, label the workload namespaces with istio.io/rev=1-21-0
and restart the workloads, as
explained in the Data plane upgrade documentation.
Uninstall
If you used the operator to perform a canary upgrade of the control plane, you can uninstall the old control plane and keep the new one by deleting the old in-cluster IstioOperator
CR, which will uninstall the old revision of Istio:
Wait until Istio is uninstalled - this may take some time.
Then you can remove the Istio operator for the old revision by running the following command:
If you omit the revision
flag, then all revisions of Istio operator will be removed.
Note that deleting the operator before the IstioOperator
CR and corresponding Istio revision are fully removed may result in leftover Istio resources.
To clean up anything not removed by the operator: