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

killercoda-scenarios #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions deployment-CN/finish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## 祝贺你成功完成KubeEdge的部署!!!
45 changes: 45 additions & 0 deletions deployment-CN/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"title": "KubeEdge部署体验",
"description": "10分钟部署KubeEdge",
"details": {
"steps": [
{
"title": "Step 1/7",
"text": "step1.md"
},
{
"title": "Step 2/7",
"text": "step2.md"
},
{
"title": "Step 3/7",
"text": "step3.md"
},
{
"title": "Step 4/7",
"text": "step4.md"
},
{
"title": "Step 5/7",
"text": "step5.md"
},
{
"title": "Step 6/7",
"text": "step6.md"
},
{
"title": "Step 7/7",
"text": "step7.md"
}
],
"intro": {
"text": "intro.md"
},
"finish": {
"text": "finish.md"
}
},
"backend": {
"imageid": "ubuntu"
}
}
1 change: 1 addition & 0 deletions deployment-CN/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10分钟部署KubeEdge,现在开始吧!
21 changes: 21 additions & 0 deletions deployment-CN/step1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 安装kind
<br>
kind 即 Kubernetes In Docker,将 k8s 所需要的所有组件全部部署在一个docker容器中,是一套开箱即用的 k8s 环境搭建方案,可以让我们快速的搭建k8s测试平台。

执行以下命令安装kind:
```
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.11.1/kind-linux-amd64
chmod +x ./kind
mv ./kind /usr/local/bin/kind
```{{execute}}

<br>
<br>

为了后续用命令行管理集群,我们需要安装Kubectl:
```
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.6/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
```{{execute}}

6 changes: 6 additions & 0 deletions deployment-CN/step2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 创建集群
<br>
仅需一条指令,就能创建一个集群。

`kind create cluster --name my-cluster`{{execute}}

7 changes: 7 additions & 0 deletions deployment-CN/step3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 安装keadm
<br>
Keadm用于安装KubeEdge的云和边缘组件。

执行以下命令即可安装keadm。

` docker run --rm kubeedge/installation-package:v1.10.0 cat /usr/local/bin/keadm > /usr/local/bin/keadm && chmod +x /usr/local/bin/keadm`{{execute}}
9 changes: 9 additions & 0 deletions deployment-CN/step4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 创建云端节点
<br>
使用下方的命令安装cloudcore。

--advertise-address是非必选参数,为云端暴露的地址(将添加到CloudCore证书的SAN中),默认值为本地IP。

`keadm init --advertise-address=172.30.1.2`{{execute}}

**现在你可以看到KubeEdge的cloudcore已被成功创建。**
17 changes: 17 additions & 0 deletions deployment-CN/step5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 创建边缘节点
<br>
执行keadm gettoken命令,返回的token值将在下一步中用到。将返回值保存在变量token_value中。

`token_value=$(keadm gettoken)`{{execute}}
<br>
<br>
接下来, 使用keadm join命令安装边缘节点,并通过参数设置将边缘节点纳入cloudcore的管理。

`keadm join --cloudcore-ipport=172.30.1.2:10000 --token=${token_value}`{{execute}}

--cloudcore-ipport是必选参数,应与cloudcore的advertise-address保持一致;
--token值为上一步的返回值。
<br>
<br>
**现在你可以看到KubeEdge的edgecore已被成功创建。**

36 changes: 36 additions & 0 deletions deployment-CN/step6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 修改部分配置
<br>
在此步骤中,我们将修改部分配置。

<br>
<br>
使用提供的命令行打开文件, 并增加注释行。

`vi /etc/systemd/system/edgecore.service`{{execute}}

```
[Service]
Environment=CHECK_EDGECORE_ENVIRONMENT='false' # add this line
Type=simple
ExecStart=/usr/local/bin/edgecore
Restart=always
RestartSec=10
```{{}}
<br>

使用提供的命令行打开文件, 并修改注释行。

`vi /etc/kubeedge/config/edgecore.yaml`{{execute}}

```
edged:
cgroupDriver: systemd # change from 'cgroupf' to 'systemd'
cgroupRoot: ""
cgroupsPerQOS: true
```{{}}
<br>
<br>

重新加载edgecore。

`systemctl daemon-reload && sudo systemctl enable edgecore && sudo systemctl start edgecore`{{execute}}
9 changes: 9 additions & 0 deletions deployment-CN/step7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 查看部署结果
<br>
查看节点状态:

`kubectl get node`{{execute}}

注意节点的role属性,一个节点承担管理节点的角色,另一个承担边缘节点的角色,这说明边缘节点已被纳入云端的管理范围。

**恭喜你!KubeEdge已部署完成!**
1 change: 1 addition & 0 deletions deployment-EN/finish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Congratulations on successful completion of KubeEdge Deployment Scenario !!!
45 changes: 45 additions & 0 deletions deployment-EN/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"title": "KubeEdge Deployment",
"description": "Deploying KubeEdge",
"details": {
"steps": [
{
"title": "Step 1/7",
"text": "step1.md"
},
{
"title": "Step 2/7",
"text": "step2.md"
},
{
"title": "Step 3/7",
"text": "step3.md"
},
{
"title": "Step 4/7",
"text": "step4.md"
},
{
"title": "Step 5/7",
"text": "step5.md"
},
{
"title": "Step 6/7",
"text": "step6.md"
},
{
"title": "Step 7/7",
"text": "step7.md"
}
],
"intro": {
"text": "intro.md"
},
"finish": {
"text": "finish.md"
}
},
"backend": {
"imageid": "ubuntu"
}
}
1 change: 1 addition & 0 deletions deployment-EN/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Let's deploy KubeEdge within 10 minutes!
22 changes: 22 additions & 0 deletions deployment-EN/step1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Install kind
<br>
Kind is a tool for running local Kubernetes clusters using Docker container “nodes”.

Run the command below to intsall kind:
```
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.11.1/kind-linux-amd64
chmod +x ./kind
mv ./kind /usr/local/bin/kind
```{{execute}}

<br>
<br>

In order to manage the cluster later using the CLI, install Kubectl:
```
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.6/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
```{{execute}}


5 changes: 5 additions & 0 deletions deployment-EN/step2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Create cluster
<br>
Run the command below to one-click create a cluster using kind.

`kind create cluster --name my-cluster`{{execute}}
11 changes: 11 additions & 0 deletions deployment-EN/step3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Install keadm
<br>
Keadm is used to install the cloud and edge components of KubeEdge.

Run the command below to one-click install keadm.

` docker run --rm kubeedge/installation-package:v1.10.0 cat /usr/local/bin/keadm > /usr/local/bin/keadm && chmod +x /usr/local/bin/keadm`{{execute}}




10 changes: 10 additions & 0 deletions deployment-EN/step4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Setup Cloud Side (KubeEdge Master Node)
<br>
keadm init will install cloudcore, generate the certs and install the CRDs.

--advertise-address (non-mandatory flag) is the address exposed by the cloud side (will be added to the SANs of the CloudCore certificate), the default value is the local IP.

`keadm init --advertise-address=172.30.1.2`{{execute}}


**Now you can see KubeEdge cloudcore is running.**
18 changes: 18 additions & 0 deletions deployment-EN/step5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Setup Edge Side (KubeEdge Worker Node)
<br>
Run keadm gettoken will return the token, which will be used when joining edge nodes. Save the returned value to the variable token_value.

`token_value=$(keadm gettoken)`{{execute}}
<br>
<br>
Next, run keadm join to join edge node.

`keadm join --cloudcore-ipport=172.30.1.2:10000 --token=${token_value}`{{execute}}


keadm join will install edgecore and mqtt, and --cloudcore-ipport flag is a mandatory flag.
<br>
<br>
**Now you can see KubeEdge edgecore is running.**


36 changes: 36 additions & 0 deletions deployment-EN/step6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Change some configs
<br>
In this step, we are going to change some config.

<br>
<br>
Open the file using following command, and add the comment line.

`vi /etc/systemd/system/edgecore.service`{{execute}}

```
[Service]
Environment=CHECK_EDGECORE_ENVIRONMENT='false' # add this line
Type=simple
ExecStart=/usr/local/bin/edgecore
Restart=always
RestartSec=10
```{{}}
<br>

Open the file using following command, and modify the comment line.

`vi /etc/kubeedge/config/edgecore.yaml`{{execute}}

```
edged:
cgroupDriver: systemd # change from 'cgroupf' to 'systemd'
cgroupRoot: ""
cgroupsPerQOS: true
```{{}}
<br>
<br>

Reload the edgecore.

`systemctl daemon-reload && sudo systemctl enable edgecore && sudo systemctl start edgecore`{{execute}}
9 changes: 9 additions & 0 deletions deployment-EN/step7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Check deloyment
<br>
Check the state of nodes:

`kubectl get node`{{execute}}

There are two nodes, one assumes the master role and the other assumes the edge role, indicating that the edge side has been managed and controlled by the cloud side as a node.

**Congratulations!KubeEdge has been deployed!**