Istio Operator Install

Instead of manually installing, upgrading, and uninstalling Istio in a production environment, you can instead let the Istio operator 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 API is used to install Istio with the operator as when using the istioctl install instructions. In both cases, configuration is validated against a schema and the same correctness checks are performed.

Using an operator does have a security implication. With the istioctl install command, the operation will run in the admin user’s security context, whereas with an operator, an in-cluster pod will run the operation in its security context. To avoid a vulnerability, ensure that the operator deployment is sufficiently secured.

Prerequisites

  1. Perform any necessary platform-specific setup.

  2. Check the Requirements for Pods and Services.

  3. Install the istioctl command.

  4. Deploy the Istio operator:

    1. $ istioctl operator init

    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:

    1. $ istioctl operator init --watchedNamespaces=istio-namespace1,istio-namespace2

    See the istioctl operator init command reference for details.

    You can alternatively deploy the operator using Helm:

    1. $ helm template manifests/charts/istio-operator/ \
    2. --set hub=docker.io/istio \
    3. --set tag=1.7.0 \
    4. --set operatorNamespace=istio-operator \
    5. --set watchedNamespaces=istio-system | kubectl apply -f -

    Note that you need to download the Istio release to run the above command.

Install

To install the Istio demo configuration profile using the operator, run the following command:

  1. $ kubectl create ns istio-system
  2. $ kubectl apply -f - <<EOF
  3. apiVersion: install.istio.io/v1alpha1
  4. kind: IstioOperator
  5. metadata:
  6. namespace: istio-system
  7. name: example-istiocontrolplane
  8. spec:
  9. profile: demo
  10. EOF

The controller will detect the IstioOperator resource and then install the Istio components corresponding to the specified (demo) configuration.

The Istio operator controller begins the process of installing Istio within 90 seconds of the creation of the IstioOperator resource. The Istio installation completes within 120 seconds.

You can confirm the Istio control plane services have been deployed with the following commands:

  1. $ kubectl get svc -n istio-system
  2. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
  3. istio-egressgateway ClusterIP 10.103.243.113 <none> 80/TCP,443/TCP,15443/TCP 17s
  4. istio-ingressgateway LoadBalancer 10.101.204.227 <pending> 15020:31077/TCP,80:30689/TCP,443:32419/TCP,31400:31411/TCP,15443:30176/TCP 17s
  5. istiod ClusterIP 10.96.237.249 <none> 15010/TCP,15012/TCP,443/TCP,15014/TCP,53/UDP,853/TCP 30s 13s
  1. $ kubectl get pods -n istio-system
  2. NAME READY STATUS RESTARTS AGE
  3. istio-egressgateway-5444c68db8-9h6dz 1/1 Running 0 87s
  4. istio-ingressgateway-5c68cb968-x7qv9 1/1 Running 0 87s
  5. istiod-598984548d-wjq9j 1/1 Running 0 99s

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:

  1. $ kubectl apply -f - <<EOF
  2. apiVersion: install.istio.io/v1alpha1
  3. kind: IstioOperator
  4. metadata:
  5. namespace: istio-system
  6. name: example-istiocontrolplane
  7. spec:
  8. profile: default
  9. EOF

You can also enable or disable components and modify resource settings. For example, to enable the istio-egressgateway component and increase pilot memory requests:

  1. $ kubectl apply -f - <<EOF
  2. apiVersion: install.istio.io/v1alpha1
  3. kind: IstioOperator
  4. metadata:
  5. namespace: istio-system
  6. name: example-istiocontrolplane
  7. spec:
  8. profile: default
  9. components:
  10. pilot:
  11. k8s:
  12. resources:
  13. requests:
  14. memory: 3072Mi
  15. egressGateways:
  16. - name: istio-egressgateway
  17. enabled: true
  18. EOF

You can observe the changes that the controller makes in the cluster in response to IstioOperator CR updates by checking the operator controller logs:

  1. $ kubectl logs -f -n istio-operator $(kubectl get pods -n istio-operator -lname=istio-operator -o jsonpath='{.items[0].metadata.name}')

Refer to the IstioOperator API for the complete set of configuration settings.

Canary Upgrade

You can use the operator to do a canary upgrade of an Istio control plane, the process is similar to the canary upgrade with istioctl.

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:

  1. $ kubectl get iop --all-namespaces
  2. NAMESPACE NAME REVISION STATUS AGE
  3. istio-system example-istiocontrolplane HEALTHY 11m

Then run the following command to install the new revision of the Istio control plane based on the in-cluster IstioOperator CR:

  1. $ istioctl operator init --revision 1-7-0

You can alternatively use Helm to deploy another operator with a different revision setting:

  1. $ helm template manifests/charts/istio-operator/ \
  2. --set hub=docker.io/istio \
  3. --set tag=1.7.0 \
  4. --set operatorNamespace=istio-operator \
  5. --set revision=1-7-0 \
  6. --set watchedNamespaces=istio-system | kubectl apply -f -

Note that you need to download the Istio release to run the above command.

After running the command, you will have two control plane deployments and services running side-by-side:

  1. $ kubectl get pods -n istio-system -l app=istiod
  2. NAME READY STATUS RESTARTS AGE
  3. istiod-5f4f9dd5fc-4xc8p 1/1 Running 0 10m
  4. istiod-1-7-0-55887f699c-t8bh8 1/1 Running 0 8m13s
  1. $ kubectl -n istio-system get svc -l app=istiod
  2. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
  3. istiod ClusterIP 10.87.7.69 <none> 15010/TCP,15012/TCP,443/TCP,15014/TCP,853/TCP 10m
  4. istiod-1-7-0 ClusterIP 10.87.4.92 <none> 15010/TCP,15012/TCP,443/TCP,15014/TCP,853/TCP 7m55s

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 running the following command:

  1. $ istioctl operator remove --revision <revision>

Otherwise, delete the in-cluster IstioOperator CR, which will uninstall all revisions of Istio that may be running:

  1. $ kubectl delete istiooperators.install.istio.io -n istio-system example-istiocontrolplane

Wait until Istio is uninstalled - this may take some time. Delete the Istio operator:

  1. $ istioctl operator remove

Or:

  1. $ kubectl delete ns istio-operator --grace-period=0 --force

Note that deleting the operator before Istio is fully removed may result in leftover Istio resources. To clean up anything not removed by the operator:

  1. $ istioctl manifest generate | kubectl delete -f -
  2. $ kubectl delete ns istio-system --grace-period=0 --force

See also

Extended and Improved WebAssemblyHub to Bring the Power of WebAssembly to Envoy and Istio

Community partner tooling of Wasm for Istio by Solo.io.

Introducing istiod: simplifying the control plane

Istiod consolidates the Istio control plane components into a single binary.

Declarative WebAssembly deployment for Istio

Configuring Wasm extensions for Envoy and Istio declaratively.

Redefining extensibility in proxies - introducing WebAssembly to Envoy and Istio

The future of Istio extensibility using WASM.

Istio in 2020 - Following the Trade Winds

A vision statement and roadmap for Istio in 2020.

DNS Certificate Management

Provision and manage DNS certificates in Istio.