How can GKE's Istio be configured to restrict egress?

7/22/2019

I'd like to use Istio to restrict egress out of my GKE Kubernetes cluster.

I'm attempting to change to the blocking-by-default policy by running the following command to change the global.outboundTrafficPolicy.mode option to REGISTRY_ONLY:

$ kubectl get configmap istio -n istio-system -o yaml | sed 's/mode: ALLOW_ANY/mode: REGISTRY_ONLY/g' | kubectl replace -n istio-system -f -

That works temporarily, however because GKE has installed Istio as an add-on, the setting is quickly reconciled back to ALLOW_ANY.

Is there any other way to apply this setting to GKE's Istio or is there some other approach I can take to accomplish the same result?

-- Chris Pick
google-kubernetes-engine
istio
kubernetes

2 Answers

7/23/2019

Specifically for the managed version of Istio on GKE, they recommend installing your own egress controller to avoid having your changes rolled back due to the reconciliation mode.

-- yyyyahir
Source: StackOverflow

7/23/2019

You may try to block by egress service. kubectl get svc -n istio-system |grep egress & edit it as per your requirement.

-- Dhevasenapathi S
Source: StackOverflow