You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -3,67 +3,88 @@ title: Enable Kubectl logs/exec to debug pods on the edge
3
3
sidebar_position: 3
4
4
---
5
5
6
-
## Prepare certs
6
+
> Note for Helm deployments:
7
+
> - Stream certificates are generated automatically and the CloudStream feature is enabled by default. Therefore, Steps 1-3 can be skipped unless customization is needed.
8
+
> - Step 4 could be finished by iptablesmanager component by default, so manual operations are not needed. Refer to the [cloudcore helm values](https://github.com/kubeedge/kubeedge/blob/master/manifests/charts/cloudcore/values.yaml#L67).
9
+
> - If CloudCore is deploy in container (by default), operations in Steps 5-6 can also be skipped.
7
10
8
-
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.
11
+
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/`directory.
9
12
10
13
```shell
11
14
ls /etc/kubernetes/pki/
12
15
```
13
16
14
-
2. Set `CLOUDCOREIPS`env. The environment variable is setto specify the IP address of cloudcore, or a VIP if you have a highly available cluster.
17
+
2. Set the `CLOUDCOREIPS` environment variable to specify the IP address of CloudCore, or a VIP if you have a highly available cluster. Set `CLOUDCORE_DOMAINS` instead if Kubernetes uses domain names to communicate with CloudCore.
15
18
16
19
```bash
17
20
export CLOUDCOREIPS="192.168.0.139"
18
21
```
22
+
19
23
(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:
24
+
20
25
```shell
21
26
echo$CLOUDCOREIPS
22
27
```
23
28
24
-
3. Generate the certificates for**CloudStream** on cloud node, however, the generation file is notin the `/etc/kubeedge/`, we need to copy it from the repository which was git cloned from GitHub.
25
-
Change user to root:
29
+
3. Generate the certificates for**CloudStream** on the cloud node. Since the generation file is not locatedin`/etc/kubeedge/`, copy it from the cloned GitHub repository.
30
+
31
+
Switch to the root user:
32
+
26
33
```shell
27
34
sudo su
28
35
```
36
+
29
37
Copy certificates generation file from original cloned repository:
4. It is needed to set iptables on the host. (This procedure should be executed on every node where an api-server is deployed. In this case, it is the control-plane node. Execute those commands as the root user.)
43
56
44
-
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.)
57
+
**Note:** First, get the configmap containing all the CloudCore IPs and tunnel ports:
45
58
46
-
Run the following command on the host on which each apiserver runs:
**Note:** Make sure `CLOUDCOREIPS` environment variable is set
71
+
Then set all the iptables for multiple CloudCore instances to every node where the api-server runs. The CloudCore IPs and tunnel ports should be obtained from the configmap above.
> Port 10003 and 10350 are the default ports for the CloudStream and edgecore,
54
-
use your own ports if you have changed them.
55
78
56
-
If you are not sure whether you have a setting of iptables, and you want to clean all of them.
57
-
(If you set up iptables wrongly, it will block you out of this feature)
79
+
If you are unsure about the current iptables settings and want to clean all of them. (If you set up iptables wrongly, it will block you out of your `kubectl logs` feature)
58
80
59
81
The following command can be used to clean up iptables:
1. Update `cloudcore` configuration to enable**cloudStream**. (The new version has this feature enabled by default in the cloud, so this configuration can be skipped.)
87
+
5. Update `cloudcore` configuration to enable**cloudStream**. (The new version has this feature enabled by default in the cloud, so this configuration can be skipped.)
67
88
68
89
If `cloudcore` is installed as binary, you can directly modify `/etc/kubeedge/config/cloudcore.yaml` with using editor.
69
90
If `cloudcore` is running as kubernetes deployment, you can use `kubectl edit cm -n kubeedge cloudcore` to update `cloudcore`'s ConfigurationMap.
@@ -81,10 +102,10 @@ sidebar_position: 3
81
102
tunnelPort: 10004
82
103
```
83
104
84
-
2. Update `edgecore` configuration to enable **edgeStream**.
105
+
Update `edgecore` configuration to enable **edgeStream**.
85
106
86
107
This modification needs to be done all edge system where `edgecore` runs to update `/etc/kubeedge/config/edgecore.yaml`.
87
-
Make sure the `server` IP address to the cloudcore IP (the same as $CLOUDCOREIPS).
108
+
Make sure the `server` IP address to the CloudCore IP (the same as $CLOUDCOREIPS).
88
109
89
110
```yaml
90
111
edgeStream:
@@ -98,22 +119,78 @@ sidebar_position: 3
98
119
writeDeadline: 15
99
120
```
100
121
101
-
## Restart
122
+
6. Restart all the CloudCore and EdgeCore to apply the **Stream** configuration.
123
+
124
+
```shell
125
+
sudo su
126
+
```
127
+
128
+
If CloudCore is running in process mode:
129
+
130
+
```shell
131
+
pkill cloudcore
132
+
nohup cloudcore > cloudcore.log 2>&1 &
133
+
```
134
+
135
+
If CloudCore is running in Kubernetes deployment mode:
If restarting EdgeCore fails, check if that is due to `kube-proxy` and kill it. **kubeedge** rejects it by default, we use a succedaneum called [edgemesh](https://github.com/kubeedge/kubeedge/blob/master/docs/proposals/edgemesh-design.md)
148
+
149
+
**Note:** It is important to avoid `kube-proxy` being deployed on edgenode and there are two methods to achieve this:
150
+
151
+
- **Method 1:** Add the following settings by calling `kubectl edit daemonsets.apps -n kube-system kube-proxy`:
102
152
103
-
1. Restart all the cloudcore and edgecore to apply the **Stream** configuration.
153
+
```yaml
154
+
spec:
155
+
template:
156
+
spec:
157
+
affinity:
158
+
nodeAffinity:
159
+
requiredDuringSchedulingIgnoredDuringExecution:
160
+
nodeSelectorTerms:
161
+
- matchExpressions:
162
+
- key: node-role.kubernetes.io/edge
163
+
operator: DoesNotExist
164
+
```
165
+
166
+
or just run the following command directly in the shell window:
104
167
105
-
If `cloudcore` is installed as binary (If the `cloudcore.yaml` has not been updated, there is no need to restart.)
or `cloudcore` is running in kubernetes deployment:
172
+
- **Method 2:** If you still want to run `kube-proxy`, instruct **edgecore** not to check the environment by adding the environment variable in `edgecore.service` :
Copy file name to clipboardExpand all lines: docs/setup/install-with-binary.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,7 +143,7 @@ make
143
143
144
144
The compiled kubeedge binaries will be put to `_output/local/bin` directory.
145
145
146
-
### Deploy demo on edge nodes
146
+
## Deploy demo on edge nodes
147
147
148
148
After you start both `cloudcore` and `edgecore` successfully, you can run `kubectl get node` to ensure whether edgecore has already registered to cloudcore successfully. The edge nodes are in `Ready` status like below.
0 commit comments