Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more detailed instruction for global search #577

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 40 additions & 20 deletions docs/userguide/globalview/proxy-global-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,27 @@ title: Proxy Global Resources

## Introduce

The newly introduced [proxy](https://github.com/karmada-io/karmada/blob/master/docs/proposals/resource-aggregation-proxy/README.md) feature allows users to access all the resources both in karmada controller panel and member clusters. With it, users can:
The newly introduced [proxy](https://github.com/karmada-io/karmada/blob/master/docs/proposals/resource-aggregation-proxy/README.md) feature allows users to access all the resources both in karmada control plane and member clusters. With it, users can:

- create, update, patch, get, list, watch and delete resources in controller panel, such as deployments and jobs. All the request behaviors are supported, just like using `karmada-apiserver`.
- create, update, patch, get, list, watch and delete resources in karmada control plane, such as deployments and jobs. All the request behaviors are supported, just like using `karmada-apiserver`.
- update, patch, get, list, watch and delete resources in member clusters, such as pods, nodes, and customer resources.
- access subresources, such as pods' `log` and `exec`.

## Quick start

To quickly experience this feature, we experimented with karmada-apiserver certificate.

### Step1: Obtain the karmada-apiserver Certificate

For Karmada deployed using `hack/local-up-karmada.sh`, you can directly copy it from the `$HOME/.kube/` directory.

```shell
cp $HOME/.kube/karmada.config $HOME/karmada-proxy.config
```

### Step2: Access by proxy

Append `/apis/search.karmada.io/v1alpha1/proxying/karmada/proxy` to the server address of `karmada-proxy.config`. Then set this file as default config:

```shell
export KUBECONFIG=$HOME/karmada-proxy.config
```

### Step3: Define Resource To be Proxied

Define which member cluster resource you want to be proxied with [`ResourceRegistry`](https://github.com/karmada-io/karmada/tree/master/docs/proposals/caching#define-the-scope-of-the-cached-resource).
### Step1: Define Resource To be Proxied

For example:
Define which member cluster resource you want to be proxied with [`ResourceRegistry`](https://github.com/karmada-io/karmada/tree/master/docs/proposals/caching#define-the-scope-of-the-cached-resource) by applying the following Yaml file in the karmada-apiserver:

```yaml
apiVersion: search.karmada.io/v1alpha1
kind: ResourceRegistry
kind: ResourceRegistry
metadata:
name: proxy-sample
spec:
Expand All @@ -51,7 +37,41 @@ spec:
kind: Node
```

After applying it, you can access pods and nodes with kubectl. Enjoy it!
```shell
$ kubectl --context karmada-apiserver apply -f resourceregistry.yaml
```

Based on the ResourceRegistry above, you can access pods and nodes with proxy function.

### Step2: Obtain the karmada-apiserver Certificate

For Karmada deployed using `hack/local-up-karmada.sh`, you can directly copy it from the `$HOME/.kube/` directory.

### Step3: Access by proxy

Append `/apis/search.karmada.io/v1alpha1/proxying/karmada/proxy` to the server address of `karmada-proxy.config`. Then set this file as default config:

```shell
export KUBECONFIG=$HOME/karmada-proxy.config
```

After processing the above steps, you can access pods and nodes with kubectl.

Taking getting the pod log as an example, you can use the following command:

```shell
$ kubectl logs <pod-name> -n <namespace-name>
```

Specifying `--raw` as following has the same effect:

```shell
$ kubectl get --raw /apis/search.karmada.io/v1alpha1/proxying/karmada/proxy/api/v1/namespaces/<ns>/pods/<pod-name>/log
```

Enjoy it!

> Note: Use the current ability to rely on the Cluster's impersonator Secret. Please ensure that the correct `impersonatorSecretRef` is set in the Cluster object.

## FAQ

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,27 @@ title: Proxy Global Resources

## Introduce

The newly introduced [proxy](https://github.com/karmada-io/karmada/blob/master/docs/proposals/resource-aggregation-proxy/README.md) feature allows users to access all the resources both in karmada controller panel and member clusters. With it, users can:
The newly introduced [proxy](https://github.com/karmada-io/karmada/blob/master/docs/proposals/resource-aggregation-proxy/README.md) feature allows users to access all the resources both in karmada control plane and member clusters. With it, users can:

- create, update, patch, get, list, watch and delete resources in controller panel, such as deployments and jobs. All the request behaviors are supported, just like using `karmada-apiserver`.
- create, update, patch, get, list, watch and delete resources in karmada control plane, such as deployments and jobs. All the request behaviors are supported, just like using `karmada-apiserver`.
- update, patch, get, list, watch and delete resources in member clusters, such as pods, nodes, and customer resources.
- access subresources, such as pods' `log` and `exec`.

## Quick start

To quickly experience this feature, we experimented with karmada-apiserver certificate.

### Step1: Obtain the karmada-apiserver Certificate

For Karmada deployed using `hack/local-up-karmada.sh`, you can directly copy it from the `$HOME/.kube/` directory.

```shell
cp $HOME/.kube/karmada.config $HOME/karmada-proxy.config
```

### Step2: Access by proxy

Append `/apis/search.karmada.io/v1alpha1/proxying/karmada/proxy` to the server address of `karmada-proxy.config`. Then set this file as default config:

```shell
export KUBECONFIG=$HOME/karmada-proxy.config
```

### Step3: Define Resource To be Proxied

Define which member cluster resource you want to be proxied with [`ResourceRegistry`](https://github.com/karmada-io/karmada/tree/master/docs/proposals/caching#define-the-scope-of-the-cached-resource).
### Step1: Define Resource To be Proxied

For example:
Define which member cluster resource you want to be proxied with [`ResourceRegistry`](https://github.com/karmada-io/karmada/tree/master/docs/proposals/caching#define-the-scope-of-the-cached-resource) by applying the following Yaml file in the karmada-apiserver:

```yaml
apiVersion: search.karmada.io/v1alpha1
kind: ResourceRegistry
kind: ResourceRegistry
metadata:
name: proxy-sample
spec:
Expand All @@ -51,7 +37,41 @@ spec:
kind: Node
```

After applying it, you can access pods and nodes with kubectl. Enjoy it!
```shell
$ kubectl --context karmada-apiserver apply -f resourceregistry.yaml
```

Based on the ResourceRegistry above, you can access pods and nodes with proxy function.

### Step2: Obtain the karmada-apiserver Certificate

For Karmada deployed using `hack/local-up-karmada.sh`, you can directly copy it from the `$HOME/.kube/` directory.

### Step3: Access by proxy

Append `/apis/search.karmada.io/v1alpha1/proxying/karmada/proxy` to the server address of `karmada-proxy.config`. Then set this file as default config:

```shell
export KUBECONFIG=$HOME/karmada-proxy.config
```

After processing the above steps, you can access pods and nodes with kubectl.

Taking getting the pod log as an example, you can use the following command:

```shell
$ kubectl logs <pod-name> -n <namespace-name>
```

Specifying `--raw` as following has the same effect:

```shell
$ kubectl get --raw /apis/search.karmada.io/v1alpha1/proxying/karmada/proxy/api/v1/namespaces/<ns>/pods/<pod-name>/log
```

Enjoy it!

> Note: Use the current ability to rely on the Cluster's impersonator Secret. Please ensure that the correct `impersonatorSecretRef` is set in the Cluster object.

## FAQ

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Proxy Global Resources

## Introduce

The newly introduced [proxy](https://github.com/karmada-io/karmada/blob/master/docs/proposals/resource-aggregation-proxy/README.md) feature allows users to access all the resources both in karmada controller panel and member clusters. With it, users can:
The newly introduced [proxy](https://github.com/karmada-io/karmada/blob/master/docs/proposals/resource-aggregation-proxy/README.md) feature allows users to access all the resources both in karmada control plane and member clusters. With it, users can:

- create, update, patch, get, list, watch and delete resources in controller panel, such as deployments and jobs. All the request behaviors are supported, just like using `karmada-apiserver`.
- create, update, patch, get, list, watch and delete resources in karmada control plane, such as deployments and jobs. All the request behaviors are supported, just like using `karmada-apiserver`.
- update, patch, get, list, watch and delete resources in member clusters, such as pods, nodes, and customer resources.
- access subresources, such as pods' `log` and `exec`.

Expand All @@ -22,23 +22,13 @@ For Karmada deployed using `hack/local-up-karmada.sh`, you can directly copy it
cp $HOME/.kube/karmada.config $HOME/karmada-proxy.config
```

### Step2: Access by proxy

Append `/apis/search.karmada.io/v1alpha1/proxying/karmada/proxy` to the server address of `karmada-proxy.config`. Then set this file as default config:

```shell
export KUBECONFIG=$HOME/karmada-proxy.config
```

### Step3: Define Resource To be Proxied
### Step2: Define Resource To be Proxied

Define which member cluster resource you want to be proxied with [`ResourceRegistry`](https://github.com/karmada-io/karmada/tree/master/docs/proposals/caching#define-the-scope-of-the-cached-resource).

For example:
Define which member cluster resource you want to be proxied with [`ResourceRegistry`](https://github.com/karmada-io/karmada/tree/master/docs/proposals/caching#define-the-scope-of-the-cached-resource) by applying the following Yaml file in the karmada-apiserver:

```yaml
apiVersion: search.karmada.io/v1alpha1
kind: ResourceRegistry
kind: ResourceRegistry
metadata:
name: proxy-sample
spec:
Expand All @@ -51,7 +41,37 @@ spec:
kind: Node
```

After applying it, you can access pods and nodes with kubectl. Enjoy it!
```shell
$ kubectl --context karmada-apiserver apply -f resourceregistry.yaml
```

Based on the ResourceRegistry above, you can access pods and nodes with proxy function.

### Step2: Access by proxy

Append `/apis/search.karmada.io/v1alpha1/proxying/karmada/proxy` to the server address of `karmada-proxy.config`. Then set this file as default config:

```shell
export KUBECONFIG=$HOME/karmada-proxy.config
```

After processing the above steps, you can access pods and nodes with kubectl.

Taking getting the pod log as an example, you can use the following command:

```shell
$ kubectl get --raw /apis/search.karmada.io/v1alpha1/proxying/karmada/proxy/api/v1/namespaces/<ns>/pods/<pod-name>/log
```

or:

```shell
$ kubectl logs <pod-name> -n <namespace-name>
```

Enjoy it!

> Note: Use the current ability to rely on the Cluster's impersonator Secret. Please ensure that the correct `impersonatorSecretRef` is set in the Cluster object.

## FAQ

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Proxy Global Resources

## Introduce

The newly introduced [proxy](https://github.com/karmada-io/karmada/blob/master/docs/proposals/resource-aggregation-proxy/README.md) feature allows users to access all the resources both in karmada controller panel and member clusters. With it, users can:
The newly introduced [proxy](https://github.com/karmada-io/karmada/blob/master/docs/proposals/resource-aggregation-proxy/README.md) feature allows users to access all the resources both in karmada control plane and member clusters. With it, users can:

- create, update, patch, get, list, watch and delete resources in controller panel, such as deployments and jobs. All the request behaviors are supported, just like using `karmada-apiserver`.
- create, update, patch, get, list, watch and delete resources in karmada control plane, such as deployments and jobs. All the request behaviors are supported, just like using `karmada-apiserver`.
- update, patch, get, list, watch and delete resources in member clusters, such as pods, nodes, and customer resources.
- access subresources, such as pods' `log` and `exec`.

Expand All @@ -22,23 +22,13 @@ For Karmada deployed using `hack/local-up-karmada.sh`, you can directly copy it
cp $HOME/.kube/karmada.config $HOME/karmada-proxy.config
```

### Step2: Access by proxy

Append `/apis/search.karmada.io/v1alpha1/proxying/karmada/proxy` to the server address of `karmada-proxy.config`. Then set this file as default config:

```shell
export KUBECONFIG=$HOME/karmada-proxy.config
```

### Step3: Define Resource To be Proxied
### Step2: Define Resource To be Proxied

Define which member cluster resource you want to be proxied with [`ResourceRegistry`](https://github.com/karmada-io/karmada/tree/master/docs/proposals/caching#define-the-scope-of-the-cached-resource).

For example:
Define which member cluster resource you want to be proxied with [`ResourceRegistry`](https://github.com/karmada-io/karmada/tree/master/docs/proposals/caching#define-the-scope-of-the-cached-resource) by applying the following Yaml file in the karmada-apiserver:

```yaml
apiVersion: search.karmada.io/v1alpha1
kind: ResourceRegistry
kind: ResourceRegistry
metadata:
name: proxy-sample
spec:
Expand All @@ -51,7 +41,37 @@ spec:
kind: Node
```

After applying it, you can access pods and nodes with kubectl. Enjoy it!
```shell
$ kubectl --context karmada-apiserver apply -f resourceregistry.yaml
```

Based on the ResourceRegistry above, you can access pods and nodes with proxy function.

### Step2: Access by proxy

Append `/apis/search.karmada.io/v1alpha1/proxying/karmada/proxy` to the server address of `karmada-proxy.config`. Then set this file as default config:

```shell
export KUBECONFIG=$HOME/karmada-proxy.config
```

After processing the above steps, you can access pods and nodes with kubectl.

Taking getting the pod log as an example, you can use the following command:

```shell
$ kubectl get --raw /apis/search.karmada.io/v1alpha1/proxying/karmada/proxy/api/v1/namespaces/<ns>/pods/<pod-name>/log
```

or:

```shell
$ kubectl logs <pod-name> -n <namespace-name>
```

Enjoy it!

> Note: Use the current ability to rely on the Cluster's impersonator Secret. Please ensure that the correct `impersonatorSecretRef` is set in the Cluster object.

## FAQ

Expand Down