Istio Operator Install
Instead of manually installing, upgrading, and uninstalling Istio in a production environment,
you can instead let the Istio operator5
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
API6 is used
to install Istio with the operator as when using the istioctl install instructions7.
In both cases, configuration is validated against a schema and the same correctness
checks are performed.
Prerequisites
Perform any necessary platform-specific setup8.
Check the Requirements for Pods and Services9.
Install the istioctl command10.
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
To install the Istio demo
configuration profile11
using the operator, run the following command:
istio-system
needs to be created before installing the operator. As of Istio 1.10.0, this is no longer required.The controller will detect the IstioOperator
resource and then install the Istio
components corresponding to the specified (demo
) configuration.
--watchedNamespaces
when you initialized the Istio operator, apply the IstioOperator
resource in one of the watched namespaces, instead of in istio-system
.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:
IstioOperator
resource. The Istio installation completes within 120
seconds.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
12.
For example, to upgrade the revision of Istio installed in the previous section, first 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.8.1):
You can alternatively use Helm to deploy another operator with a different revision setting:
--set global.hub="docker.io/istio"
and --set global.tag="1.8.2"
. As of Istio
1.9.0 these are no longer required.Note that you need to download the Istio release to run the above command.
Make a copy of the example-istiocontrolplane
CR and save it in a file named example-istiocontrolplane-1-8-1.yaml
.
Change the name to example-istiocontrolplane-1-8-1
and add revision: 1-8-1
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-8-1
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: