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

KubeEdge v1.14.2 KillerCoda Scenerio #11

Closed
wants to merge 2 commits into from
Closed
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 KubeEdge v1.14.2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# killercoda
1 change: 1 addition & 0 deletions KubeEdge v1.14.2/deployment/finish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Congratulations on successful completion of KubeEdge Deployment Scenario !!!
53 changes: 53 additions & 0 deletions KubeEdge v1.14.2/deployment/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"title": "KubeEdge Deployment",
"description": "Deploying KubeEdge",
"details": {
"steps": [
{
"title": "Step 1/9",
"text": "step1.md"
},
{
"title": "Step 2/9",
"text": "step2.md"
},
{
"title": "Step 3/9",
"text": "step3.md"
},
{
"title": "Step 4/9",
"text": "step4.md"
},
{
"title": "Step 5/9",
"text": "step5.md"
},
{
"title": "Step 6/9",
"text": "step6.md"
},
{
"title": "Step 7/9",
"text": "step7.md"
},
{
"title": "Step 8/9",
"text": "step8.md"
},
{
"title": "Step 9/9",
"text": "step9.md"
}
],
"intro": {
"text": "intro.md"
},
"finish": {
"text": "finish.md"
}
},
"backend": {
"imageid": "ubuntu"
}
}
5 changes: 5 additions & 0 deletions KubeEdge v1.14.2/deployment/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Let's deploy KubeEdge in 10 mins

<br>

KubeEdge is built upon Kubernetes and extends native containerized application orchestration and device management to hosts at the Edge. It consists of cloud part and edge part, and provides core infrastructure support for networking, application deployment and metadata synchronisation between cloud and edge.
21 changes: 21 additions & 0 deletions KubeEdge v1.14.2/deployment/step1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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.14.0/kind-$(uname)-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}}
8 changes: 8 additions & 0 deletions KubeEdge v1.14.2/deployment/step2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Create cluster

Run the command below to one-click create a cluster using kind.

```
sudo kind create cluster

```{{execute}}
14 changes: 14 additions & 0 deletions KubeEdge v1.14.2/deployment/step3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Setup keadm

Keadm is used to install the cloud and edge components of KubeEdge.

Run the command below to one-click install keadm.

```
wget https://github.com/kubeedge/kubeedge/releases/download/v1.14.2/keadm-v1.14.2-linux-amd64.tar.gz
tar -zxvf keadm-v1.14.2-linux-amd64.tar.gz
sudo cp keadm-v1.14.2-linux-amd64/keadm/keadm /usr/local/bin/keadm

```{{execute}}


18 changes: 18 additions & 0 deletions KubeEdge v1.14.2/deployment/step4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Deploy cloudcore (on Master Node)

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.

```
sudo keadm deprecated init --advertise-address="CloudCore-IP" --kubeedge-version=1.14.2 --kube-config=/root/.kube/config

```{{execute}}

## check if cloudcore running successfully:

```
ps -elf | grep cloudcore

```{{execute}}

**Now you can see KubeEdge cloudcore is running.**
72 changes: 72 additions & 0 deletions KubeEdge v1.14.2/deployment/step5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Setup edgecore(on Edge Node)

In Kubernetes 1.23 and earlier, you could use Docker Engine with Kubernetes, relying on a built-in component of Kubernetes named dockershim. The dockershim component was removed in the Kubernetes 1.24 release; however, a third-party replacement, cri-dockerd, is available. The cri-dockerd adapter lets you use Docker Engine through the Container Runtime Interface.

### Setup cri-dockerd

```
wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.4/cri-dockerd-0.3.4.amd64.tgz
tar -xvf cri-dockerd-0.3.4.amd64.tgz
cd cri-dockerd/
mkdir -p /usr/local/bin
install -o root -g root -m 0755 ./cri-dockerd /usr/local/bin/cri-dockerd

```{{execute}}

### Add the files cri-docker.socker cri-docker.service

```
sudo tee /etc/systemd/system/cri-docker.service << EOF
[Unit]
Description=CRI Interface for Docker Application Container Engine
Documentation=https://docs.mirantis.com
After=network-online.target firewalld.service docker.service
Wants=network-online.target
Requires=cri-docker.socket
[Service]
Type=notify
ExecStart=/usr/local/bin/cri-dockerd --container-runtime-endpoint fd:// --network-plugin=
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always
StartLimitBurst=3
StartLimitInterval=60s
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
Delegate=yes
KillMode=process
[Install]
WantedBy=multi-user.target
EOF

sudo tee /etc/systemd/system/cri-docker.socket << EOF
[Unit]
Description=CRI Docker Socket for the API
PartOf=cri-docker.service
[Socket]
ListenStream=%t/cri-dockerd.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
[Install]
WantedBy=sockets.target
EOF


```{{execute}}

### Daemon reload

```
systemctl daemon-reload
systemctl enable cri-docker.service
systemctl enable --now cri-docker.socket
systemctl start cri-docker.service

```{{execute}}



11 changes: 11 additions & 0 deletions KubeEdge v1.14.2/deployment/step6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Installing CNI plugin

```
wget https://github.com/containernetworking/plugins/releases/download/v1.3.0/cni-plugins-linux-amd64-v1.3.0.tgz

mkdir -p /opt/cni/bin

tar Cxzvf /opt/cni/bin cni-plugins-linux-amd64-v1.3.0.tgz

```{{execute}}

11 changes: 11 additions & 0 deletions KubeEdge v1.14.2/deployment/step7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Setup keadm

```
wget https://github.com/kubeedge/kubeedge/releases/download/v1.14.2/keadm-v1.14.2-linux-amd64.tar.gz

tar -zxvf keadm-v1.14.2-linux-amd64.tar.gz

cp keadm-v1.14.2-linux-amd64/keadm/keadm /usr/local/bin/

```{{execute}}

18 changes: 18 additions & 0 deletions KubeEdge v1.14.2/deployment/step8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### Get token from cloud side (on Master Node)
```
sudo keadm gettoken
```{{execute}}

# On Edge
<br>
<br>
Next, run keadm join to join edge node.

```
sudo keadm join --cloudcore-ipport="Cloudcore-IP:10000" --token={token} --kubeedge-version=v1.14.2 --runtimetype=remote --remote-runtime-endpoint=unix:///var/run/cri-dockerd.sock

```{{execute}}

keadm join will install edgecore and mqtt, and --cloudcore-ipport flag is a mandatory flag.

**Now you can see KubeEdge edgecore is running.**
12 changes: 12 additions & 0 deletions KubeEdge v1.14.2/deployment/step9.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Check deloyment

Check the state of nodes at the cloud machine:

```
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!**