How to customize and deploy Istio using an IstioOperator manifest, validate and upgrade with istioctl, customize gateways and resources, and enable automatic sidecar injection
Use this file to discover all available pages before exploring further.
This guide shows how to customize an Istio installation using the Istio Operator (IstioOperator CR). It covers creating an operator manifest, validating it with istioctl, installing/upgrading Istio, customizing gateway names and resource overrides, verifying changes, and enabling automatic sidecar injection for namespaces.Key workflow:
Create an IstioOperator YAML (demo.yaml).
Validate it with istioctl.
Install or upgrade Istio using the file.
Inspect and verify changed resources (for example, gateway resource requests/limits).
Enable namespace injection and redeploy workloads.
Prerequisites
A Kubernetes cluster with application workloads already deployed (Bookinfo or similar).
istioctl available locally.
Istio is not yet installed in the cluster for this demo.
Initial state — workloads present and Istio client only:
root@controlplane ~ ➜ kubectl get podsNAME READY STATUS RESTARTS AGEdetails-v1-65599dcf88-qjhsw 1/1 Running 0 12mproductpage-v1-9487c9c5b-2k9mf 1/1 Running 0 12mratings-v1-59b99c644-7w27z 1/1 Running 0 12mreviews-v1-5985998544-gms7g 1/1 Running 0 12mreviews-v2-86d6cc668-l2pvr 1/1 Running 0 12mreviews-v3-dbb5fb5dd-b2xt4 1/1 Running 0 12mroot@controlplane ~ ➜ istioctl versionIstio is not present in the cluster: no running Istio pods in namespace "istio-system"client version: 1.26.3
Create the IstioOperator file (demo.yaml)Create a minimal IstioOperator manifest. The minimal fields required are apiVersion, kind, and a spec with a profile. For this demo we use the demo profile.Commands:
root@controlplane ~ ➜ touch demo.yamlroot@controlplane ~ ➜ vim demo.yaml
Validate and install Istio using this fileValidate the operator configuration and then install Istio with your manifest. Avoid the deprecated interactive istioctl profile workflow and use -f to supply your file.
Inspecting the ingress gateway podUse kubectl describe on the ingress gateway Deployment/Pod to view defaults for resource requests/limits, readiness probes, and environment variables. Example trimmed output:
Deployments cannot be renamed in Kubernetes. To change a built-in gateway name you must disable the original and create a new gateway entry (the upgrade will delete the old deployment and create the new one).
Customize gateways and resource overridesTo change gateway names (for example add a -gateway suffix) and set specific resource requests/limits, edit demo.yaml to add the components section. The common pattern is:
Disable the built-in egress/ingress gateway entries (set enabled: false) so the operator will remove the original Deployments.
Add new egress/ingress entries with your desired name, enabled: true, and k8s.resources overrides.
For ingress gateways you can also set k8s.service.ports to configure exposed ports.
Example IstioOperator excerpt (trimmed for clarity):
apiVersion: install.istio.io/v1alpha1kind: IstioOperatorspec: profile: demo components: egressGateways: - name: istio-egress-gateway # new name for the egress gateway enabled: true k8s: resources: requests: cpu: 20m memory: 40Mi limits: cpu: 40m memory: 80Mi ingressGateways: - name: istio-ingress-gateway # new name for the ingress gateway enabled: true k8s: service: ports: - name: http2 port: 80 targetPort: 8080 - name: https port: 443 targetPort: 8443 resources: requests: cpu: 20m memory: 40Mi limits: cpu: 40m memory: 80Mi
Note: Include the original built-in gateway entries with enabled: false if you want the operator to explicitly remove them before creating the replacements.Validate and upgradeAfter updating demo.yaml, validate and run an upgrade to apply changes. istioctl upgrade will reconcile resources and perform replacement of gateway Deployments.
root@controlplane ~ ➜ istioctl validate -f demo.yaml"demo.yaml" is validroot@controlplane ~ ➜ istioctl upgrade -f demo.yamlThis will install the Istio 1.26.3 profile "demo" into the cluster. Proceed? (y/N) y✔ Istio core installed 🎉✔ Istiod installed 🧠Processing resources for Egress gateways, Ingress gateways. Waiting for Deployment/istio-system/istio-egress-gateway, Deployment/istio-system/istio-ingress-gateway...
Watch the rollout: the operator will delete the old gateway Deployments and create the new ones named according to your manifest. Use kubectl get pods -n istio-system to observe the old pods terminating and the new -gateway pods starting.After upgrade — verify the new resource settingsOnce new gateway pods are running, describe a gateway pod to confirm your resource overrides were applied:
Enable sidecar injection and redeploy workloadsEnable automatic sidecar injection for a namespace (the example uses default). Run istioctl analyze to get guidance, then label the namespace and redeploy your workloads so the Envoy sidecar init containers inject the proxy.
root@controlplane ~ ➜ istioctl analyze -n defaultInfo [IST0102] (Namespace default) The namespace is not enabled for Istio injection. Run 'kubectl label namespace default istio-injection=enabled' to enable it, or 'kubectl label namespace default istio-injection=disabled' to explicitly mark it as not needing injection.root@controlplane ~ ➜ kubectl label namespace default istio-injection=enablednamespace/default labeled
If applications (e.g., Bookinfo) are already deployed, delete and reapply them so pods are recreated with the sidecar injected:
Reference: IstioOperator fields and examplesStudy the Istio Operator reference to learn available fields and allowed values. Commonly-tested and useful fields include:
Prefer an IstioOperator CR (demo.yaml) for full configuration of an Istio control plane and gateways instead of interactive istioctl profile commands.
Always validate operator manifests with istioctl validate -f demo.yaml before installing or upgrading.
Apply changes with istioctl install -f demo.yaml -y or istioctl upgrade -f demo.yaml.
To rename built-in gateways: disable the original (set enabled: false) and add a new gateway entry with the desired name and k8s overrides — the operator will delete the old Deployment and create the new one during upgrade.
Label namespaces for injection and redeploy workloads to ensure Envoy proxies are injected.
Note: The istioctl profile subcommand has been removed from newer istioctl versions. See the istioctl documentation and the IstioOperator API reference for the complete list of configurable fields and examples.