Add clearer documentation for multiple cluster ingress

Signed-off-by: chen zechun <zechun.chen@daocloud.io>
This commit is contained in:
chen zechun 2022-07-25 17:35:50 +08:00
parent bf9e4a6a96
commit 8db9cff57d
1 changed files with 11 additions and 26 deletions

View File

@ -6,13 +6,13 @@ Users can use [MultiClusterIngress API](https://github.com/karmada-io/karmada/bl
### Karmada has been installed
We can install Karmada by referring to [quick-start](https://github.com/karmada-io/karmada#quick-start), or directly run `hack/local-up-karmada.sh` script which is also used to run our E2E cases.
We can install Karmada by referring to [Quick Start](https://github.com/karmada-io/karmada#quick-start), or directly run `hack/local-up-karmada.sh` script which is also used to run our E2E cases.
### Cluster Network
Currently, we need to use the [MCS](https://github.com/karmada-io/karmada/blob/master/docs/multi-cluster-service.md#the-serviceexport-and-serviceimport-crds-have-been-installed) feature to import external traffic.
Currently, we need to use the [Multi-cluster Service](https://github.com/karmada-io/karmada/blob/master/docs/multi-cluster-service.md#the-serviceexport-and-serviceimport-crds-have-been-installed) feature to import external traffic.
So we need to ensure that the container networks between the **host cluster** and member clusters are connected. The **host cluster** indicates the cluster where the Karmada control plane is deployed.
So we need to ensure that the container networks between the **host cluster** and member clusters are connected. The **host cluster** indicates the cluster where the **Karmada Control Plane** is deployed.
- If you use the `hack/local-up-karmada.sh` script to deploy Karmada, Karmada will have three member clusters, and the container networks between the **host cluster**, `member1` and `member2` are connected.
- You can use `Submariner` or other related open source projects to connected networks between clusters.
@ -37,37 +37,22 @@ git clone git@github.com:karmada-io/multi-cluster-ingress-nginx.git
Using the existing `karmada-host` kind cluster to build and deploy the ingress controller.
```shell
export KUBECONFIG=~/.kube/karmada.config
export KIND_CLUSTER_NAME=karmada-host
kubectl config use-context karmada-host
cd multi-cluster-ingress-nginx
make dev-env
```
#### Apply kubeconfig secret
Create a Secret that contains the `karmada-apiserver` authentication credential in the following format:
```yaml
# karmada-kubeconfig-secret.yaml
apiVersion: v1
data:
kubeconfig: {data} # Base64-encoded
kind: Secret
metadata:
name: kubeconfig
namespace: ingress-nginx
type: Opaque
```
You can get the authentication credential from the `/root/.kube/karmada.config` file, or use command:
Create a secret that contains the `karmada-apiserver` authentication credential:
```shell
kubectl -n karmada-system get secret kubeconfig -oyaml | grep kubeconfig | sed -n '1p' | awk '{print $2}'
```
Then apply yaml:
```shell
kubectl apply -f karmada-kubeconfig-secret.yaml
# get the 'karmada-apiserver' kubeconfig information and direct it to file /tmp/kubeconfig.yaml
kubectl -n karmada-system get secret kubeconfig --template={{.data.kubeconfig}} | base64 -d > /tmp/kubeconfig.yaml
# create secret with name 'kubeconfig' from file /tmp/kubeconfig.yaml
kubectl -n ingress-nginx create secret generic kubeconfig --from-file=kubeconfig=/tmp/kubeconfig.yaml
```
#### Edit ingress-nginx-controller deployment
@ -284,7 +269,7 @@ spec:
</details>
```shell
kubectl --context karmada-apiserver apply -f
kubectl --context karmada-apiserver apply -f mci-web.yaml
```
### Step 4: Local testing