Skip to content

Commit

Permalink
update the zh of debug
Browse files Browse the repository at this point in the history
Signed-off-by: lingyu <[email protected]>
  • Loading branch information
Catherine-monk committed Aug 16, 2024
1 parent c7b0775 commit ec93641
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions i18n/zh/docusaurus-plugin-content-docs/current/advanced/debug.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,70 @@
---
title: 启用Kubectl logs/exec/attach等能力
title: 启用 Kubectl logs/exec/attach 等能力
sidebar_position: 3
---

## Prepare certs
## 准备证书

1. Make sure you can find the kubernetes `ca.crt` and `ca.key` files. If you set up your kubernetes cluster by `kubeadm` , those files will be in `/etc/kubernetes/pki/` dir.
1. 请确保可以找到 `ca.crt` `ca.key` 两个 Kubernetes 证书文件。 如果您使用 `kubeadm`进行 Kubernetes 集群安装,这两个文件将位于 `/etc/kubernetes/pki/` 路径下。

``` shell
ls /etc/kubernetes/pki/
```

2. Set `CLOUDCOREIPS` env. The environment variable is set to specify the IP address of cloudcore, or a VIP if you have a highly available cluster.
2. 设置 `CLOUDCOREIPS` 变量。 这个环境变量设置为指定 cloudcore 的 IP 地址,如果您的集群是以高可用方式部署,请设置为分配给负载均衡器的虚拟 IP 地址。

```bash
export CLOUDCOREIPS="192.168.0.139"
```
(Warning: the same **terminal** is essential to continue the work, or it is necessary to type this command again.) Checking the environment variable with the following command:
(注: 必须使用同一 **终端** 才能使设置生效, 如果更换了终端,必须再次执行该指令。)可以通过使用以下命令检查该环境变量:
``` shell
echo $CLOUDCOREIPS
```

3. Generate the certificates for **CloudStream** on cloud node, however, the generation file is not in the `/etc/kubeedge/`, we need to copy it from the repository which was git cloned from GitHub.
Change user to root:
3. 接下来,需要给云节点上为 **CloudStream** 生成证书,然而,相关生成脚本不在 `/etc/kubeedge/` 中, 我们需要从 GitHub 的 git 仓库中获取。
改变权限至 root 权限:
```shell
sudo su
```
Copy certificates generation file from original cloned repository:
从 git 仓库中 clone 证书生成文件:
```shell
cp $GOPATH/src/github.com/kubeedge/kubeedge/build/tools/certgen.sh /etc/kubeedge/
```
Change directory to the kubeedge directory:
切换到 kubeedge 路径下:
```shell
cd /etc/kubeedge/
```
Generate certificates from **certgen.sh**
使用 **certgen.sh** 生成证书:
```bash
/etc/kubeedge/certgen.sh stream
```

## Set Iptables Rule
## 设置 Iptables 规则

1. Set iptables on the host. This command should be executed on every node which deployed apiserver.(In this case, it is the master node, and execute this command by root.)
1. 在主机上设置iptables。注意这个命令需要在部署了 apiserver 的每个节点上执行。(在本例中,是在主节点,运用通过 root 用户执行命令。)

Run the following command on the host on which each apiserver runs:
在每个运行有 apiserver 的主机上运行以下命令:

**Note:** You need to set the cloudcoreips variable first
**:** 请先确保 CLOUDCOREIPS 环境变量设置正确

```bash
iptables -t nat -A OUTPUT -p tcp --dport 10350 -j DNAT --to $CLOUDCOREIPS:10003
```
> Port 10003 and 10350 are the default ports for the CloudStream and edgecore,
use your own ports if you have changed them.
> 端口 10003 和 10350 是 CloudStream 和 edgecore 的默认端口,如果您对它们做过修改,请使用您设置的端口。

If you are not sure whether you have a setting of iptables, and you want to clean all of them.
(If you set up iptables wrongly, it will block you out of this feature)
如果您不确定是够有 iptables 设置,并且想清理所有 iptables。
(如果您设置了错误的 iptables,它会阻止您使用此功能)

The following command can be used to clean up iptables:
以下命令用于清除 iptables 规则:
``` shell
iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
```

## Update Configurations
## 更新配置

1. Modify **both** `/etc/kubeedge/config/cloudcore.yaml` and `/etc/kubeedge/config/edgecore.yaml` on cloudcore and edgecore. Set up **cloudStream** and **edgeStream** to `enable: true`. Change the server IP to the cloudcore IP (the same as $CLOUDCOREIPS).
1. 分别调整 cloudcore 上的 `/etc/kubeedge/config/cloudcore.yaml` 和 edgecore 上的 `/etc/kubeedge/config/edgecore.yaml` 。调整 **cloudStream** **edgeStream** `enable: true`,并且改变server IP cloudcore IP ($CLOUDCOREIPS 相同)。

Modify `/etc/kubeedge/config/cloudcore.yaml`:
cloudcore调整 `/etc/kubeedge/config/cloudcore.yaml`:
```yaml
cloudStream:
enable: true
Expand All @@ -79,7 +78,7 @@ sidebar_position: 3
tunnelPort: 10004
```

Modify `/etc/kubeedge/config/edgecore.yaml`:
edgecore调整 `/etc/kubeedge/config/edgecore.yaml`:
``` yaml
edgeStream:
enable: true
Expand All @@ -92,16 +91,17 @@ sidebar_position: 3
writeDeadline: 15
```

## Restart
## 重新启动

1. Restart all the cloudcore and edgecore.
1. 重新启动 cloudcore edgecore 让配置生效。

At the cloud side:
在云端:
``` shell
sudo systemctl restart cloudcore.service
```

At the edge side:
在边缘端:
``` shell
sudo systemctl restart edgecore.service
```

0 comments on commit ec93641

Please sign in to comment.