# Use Istio on Karmada
This document uses an example to demonstrate how to use [Istio](https://istio.io/) on Karmada.
Follow this guide to install the Istio control plane on `karmada-host` (the primary cluster) and configure `member1` and `member2` (the remote cluster) to use the control plane in `karmada-host`. All clusters reside on the network1 network, meaning there is direct connectivity between the pods in both clusters.
## Install Karmada
### Install karmada control plane
Following the steps [Install karmada control plane](https://github.com/karmada-io/karmada#install-karmada-control-plane) in Quick Start, you can get a Karmada.
## Deploy Istio
***
If you are testing multicluster setup on `kind` you can use [MetalLB](https://metallb.universe.tf/installation/) to make use of `EXTERNAL-IP` for `LoadBalancer` services.
***
### Install istioctl
Please refer to the [istioctl](https://istio.io/latest/docs/setup/getting-started/#download) Installation.
### Prepare CA certificates
Following the steps [plug-in-certificates-and-key-into-the-cluster](https://istio.io/latest/docs/tasks/security/cert-management/plugin-ca-cert/#plug-in-certificates-and-key-into-the-cluster) to configure Istio CA.
Replace the cluster name `cluster1` with `primary`, the output will looks like as follwing:
```bash
root@karmada-demo istio-on-karmada# tree certs
certs
├── primary
│ ├── ca-cert.pem
│ ├── ca-key.pem
│ ├── cert-chain.pem
│ └── root-cert.pem
├── root-ca.conf
├── root-cert.csr
├── root-cert.pem
├── root-cert.srl
└── root-key.pem
```
### Install Istio on karmada-apiserver
Export `KUBECONFIG` and switch to `karmada apiserver`:
```
# export KUBECONFIG=$HOME/.kube/karmada.config
# kubectl config use-context karmada-apiserver
```
Create a secret `cacerts` in `istio-system` namespace:
```bash
kubectl create namespace istio-system
kubectl create secret generic cacerts -n istio-system \
--from-file=certs/primary/ca-cert.pem \
--from-file=certs/primary/ca-key.pem \
--from-file=certs/primary/root-cert.pem \
--from-file=certs/primary/cert-chain.pem
```
Create a propagation policy for `cacert` secret:
```bash
cat < kind-karmada.yaml
```
```bash
kubectl create secret generic istio-kubeconfig --from-file=config=kind-karmada.yaml -nistio-system
```
3. Install istio control plane
```bash
cat < istio-remote-secret-member1.yaml
```
### Prepare member2 cluster secret
1. Export `KUBECONFIG` and switch to `karmada member2`:
```bash
export KUBECONFIG="$HOME/.kube/members.config"
kubectl config use-context member2
```
2. Create istio remote secret for member1:
```bash
istioctl x create-remote-secret --name=member2 > istio-remote-secret-member2.yaml
```
### Apply istio remote secret
Export `KUBECONFIG` and switch to `karmada apiserver`:
```
# export KUBECONFIG=$HOME/.kube/karmada.config
# kubectl config use-context karmada-apiserver
```
Apply istio remote secret:
```bash
kubectl apply -f istio-remote-secret-member1.yaml
kubectl apply -f istio-remote-secret-member2.yaml
```
### Install istio remote
1. Install istio remote member1
Export `KUBECONFIG` and switch to `karmada member1`:
```bash
export KUBECONFIG="$HOME/.kube/members.config"
kubectl config use-context member1
```
```bash
cat <