Install Primary-Remote
Before proceeding, be sure to complete the steps under before you begin.
If you are testing multicluster setup on kind
you can use to make use of EXTERNAL-IP
for LoadBalancer
services.
In this configuration, cluster cluster1
will observe the API Servers in both clusters for endpoints. In this way, the control plane will be able to provide service discovery for workloads in both clusters.
Service workloads communicate directly (pod-to-pod) across cluster boundaries.
Services in cluster2
will reach the control plane in cluster1
via a dedicated gateway for east-west traffic.
Primary and remote clusters on the same network
Create the Istio configuration for cluster1
:
Apply the configuration to cluster1
:
$ istioctl install --set values.pilot.env.EXTERNAL_ISTIOD=true --context="${CTX_CLUSTER1}" -f cluster1.yaml
Install the east-west gateway in
Install a gateway in cluster1
that is dedicated to east-west traffic. By default, this gateway will be public on the Internet. Production systems may require additional access restrictions (e.g. via firewall rules) to prevent external attacks. Check with your cloud vendor to see what options are available.
$ @samples/multicluster/gen-eastwest-gateway.sh@ \
istioctl --context="${CTX_CLUSTER1}" install -y -f -
If the control-plane was installed with a revision, add the --revision rev
flag to the gen-eastwest-gateway.sh
command.
Wait for the east-west gateway to be assigned an external IP address:
Before we can install on cluster2
, we need to first expose the control plane in cluster1
so that services in cluster2
will be able to access service discovery:
$ kubectl apply --context="${CTX_CLUSTER1}" -n istio-system -f \
@samples/multicluster/expose-istiod.yaml@
Set the control plane cluster for cluster2
We need identify the external control plane cluster that should manage cluster2
by annotating the istio-system namespace:
$ kubectl --context="${CTX_CLUSTER2}" create namespace istio-system
$ kubectl --context="${CTX_CLUSTER2}" annotate namespace istio-system topology.istio.io/controlPlaneClusters=cluster1
Setting the topology.istio.io/controlPlaneClusters
namespace annotation to cluster1
instructs the istiod
running in the same namespace (istio-system in this case) on cluster1
to manage cluster2
when it is .
Save the address of cluster1
’s east-west gateway.
$ cat <<EOF > cluster2.yaml
kind: IstioOperator
spec:
values:
istiodRemote:
injectionPath: /inject/cluster/cluster2/net/network1
global:
remotePilotAddress: ${DISCOVERY_ADDRESS}
EOF
Here we’re configuring the location of the control plane using the injectionPath
and remotePilotAddress
parameters. Although convenient for demonstration, in a production environment it is recommended to instead configure the injectionURL
parameter using properly signed DNS certs similar to the configuration shown in the .
Apply the configuration to cluster2
:
$ istioctl install --context="${CTX_CLUSTER2}" -f cluster2.yaml
Attach cluster2
as a remote cluster of cluster1
To attach the remote cluster to its control plane, we give the control plane in cluster1
access to the API Server in cluster2
. This will do the following:
Enables the control plane to authenticate connection requests from workloads running in
cluster2
. Without API Server access, the control plane will reject the requests.Enables discovery of service endpoints running in
cluster2
.
Because it has been included in the topology.istio.io/controlPlaneClusters
namespace annotation, the control plane on cluster1
will also:
Start the namespace controller which writes configmaps in namespaces in
cluster2
.
To provide API Server access to cluster2
, we generate a remote secret and apply it to :
You can now verify the installation.