From e97eb95862294dde24e9ee634c534ecebb62568e Mon Sep 17 00:00:00 2001 From: sarthaksarthak9 Date: Wed, 11 Oct 2023 14:51:41 +0530 Subject: [PATCH 1/2] KubeEdge v1.14.2 --- KubeEdge v1.14.2/deployment/finish.md | 1 + KubeEdge v1.14.2/deployment/index.json | 53 +++++++++++++++++++ KubeEdge v1.14.2/deployment/intro.md | 5 ++ KubeEdge v1.14.2/deployment/step1.md | 21 ++++++++ KubeEdge v1.14.2/deployment/step2.md | 8 +++ KubeEdge v1.14.2/deployment/step3.md | 14 +++++ KubeEdge v1.14.2/deployment/step4.md | 18 +++++++ KubeEdge v1.14.2/deployment/step5.md | 72 ++++++++++++++++++++++++++ KubeEdge v1.14.2/deployment/step6.md | 11 ++++ KubeEdge v1.14.2/deployment/step7.md | 11 ++++ KubeEdge v1.14.2/deployment/step8.md | 18 +++++++ KubeEdge v1.14.2/deployment/step9.md | 12 +++++ 12 files changed, 244 insertions(+) create mode 100644 KubeEdge v1.14.2/deployment/finish.md create mode 100644 KubeEdge v1.14.2/deployment/index.json create mode 100644 KubeEdge v1.14.2/deployment/intro.md create mode 100644 KubeEdge v1.14.2/deployment/step1.md create mode 100644 KubeEdge v1.14.2/deployment/step2.md create mode 100644 KubeEdge v1.14.2/deployment/step3.md create mode 100644 KubeEdge v1.14.2/deployment/step4.md create mode 100644 KubeEdge v1.14.2/deployment/step5.md create mode 100644 KubeEdge v1.14.2/deployment/step6.md create mode 100644 KubeEdge v1.14.2/deployment/step7.md create mode 100644 KubeEdge v1.14.2/deployment/step8.md create mode 100644 KubeEdge v1.14.2/deployment/step9.md diff --git a/KubeEdge v1.14.2/deployment/finish.md b/KubeEdge v1.14.2/deployment/finish.md new file mode 100644 index 0000000..efcb640 --- /dev/null +++ b/KubeEdge v1.14.2/deployment/finish.md @@ -0,0 +1 @@ +## Congratulations on successful completion of KubeEdge Deployment Scenario !!! \ No newline at end of file diff --git a/KubeEdge v1.14.2/deployment/index.json b/KubeEdge v1.14.2/deployment/index.json new file mode 100644 index 0000000..1598b5c --- /dev/null +++ b/KubeEdge v1.14.2/deployment/index.json @@ -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" + } +} \ No newline at end of file diff --git a/KubeEdge v1.14.2/deployment/intro.md b/KubeEdge v1.14.2/deployment/intro.md new file mode 100644 index 0000000..0bc340a --- /dev/null +++ b/KubeEdge v1.14.2/deployment/intro.md @@ -0,0 +1,5 @@ +### Let's deploy KubeEdge in 10 mins + +
+ + 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. \ No newline at end of file diff --git a/KubeEdge v1.14.2/deployment/step1.md b/KubeEdge v1.14.2/deployment/step1.md new file mode 100644 index 0000000..284747a --- /dev/null +++ b/KubeEdge v1.14.2/deployment/step1.md @@ -0,0 +1,21 @@ +# Install kind +
+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}} + +
+
+ +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}} \ No newline at end of file diff --git a/KubeEdge v1.14.2/deployment/step2.md b/KubeEdge v1.14.2/deployment/step2.md new file mode 100644 index 0000000..4893b4b --- /dev/null +++ b/KubeEdge v1.14.2/deployment/step2.md @@ -0,0 +1,8 @@ +# Create cluster + +Run the command below to one-click create a cluster using kind. + +``` +sudo kind create cluster + +```{{execute}} \ No newline at end of file diff --git a/KubeEdge v1.14.2/deployment/step3.md b/KubeEdge v1.14.2/deployment/step3.md new file mode 100644 index 0000000..d7a238e --- /dev/null +++ b/KubeEdge v1.14.2/deployment/step3.md @@ -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}} + + diff --git a/KubeEdge v1.14.2/deployment/step4.md b/KubeEdge v1.14.2/deployment/step4.md new file mode 100644 index 0000000..5b2ef1a --- /dev/null +++ b/KubeEdge v1.14.2/deployment/step4.md @@ -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.** \ No newline at end of file diff --git a/KubeEdge v1.14.2/deployment/step5.md b/KubeEdge v1.14.2/deployment/step5.md new file mode 100644 index 0000000..ca9c2fd --- /dev/null +++ b/KubeEdge v1.14.2/deployment/step5.md @@ -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}} + + + diff --git a/KubeEdge v1.14.2/deployment/step6.md b/KubeEdge v1.14.2/deployment/step6.md new file mode 100644 index 0000000..e71fae0 --- /dev/null +++ b/KubeEdge v1.14.2/deployment/step6.md @@ -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}} + diff --git a/KubeEdge v1.14.2/deployment/step7.md b/KubeEdge v1.14.2/deployment/step7.md new file mode 100644 index 0000000..b606141 --- /dev/null +++ b/KubeEdge v1.14.2/deployment/step7.md @@ -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}} + diff --git a/KubeEdge v1.14.2/deployment/step8.md b/KubeEdge v1.14.2/deployment/step8.md new file mode 100644 index 0000000..fc4273c --- /dev/null +++ b/KubeEdge v1.14.2/deployment/step8.md @@ -0,0 +1,18 @@ +### Get token from cloud side (on Master Node) +``` +sudo keadm gettoken +```{{execute}} + +# On Edge +
+
+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.** \ No newline at end of file diff --git a/KubeEdge v1.14.2/deployment/step9.md b/KubeEdge v1.14.2/deployment/step9.md new file mode 100644 index 0000000..aee3b6d --- /dev/null +++ b/KubeEdge v1.14.2/deployment/step9.md @@ -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!** \ No newline at end of file From e4cfe4797e43205275c88b83356b5f43addead99 Mon Sep 17 00:00:00 2001 From: sarthaksarthak9 Date: Wed, 11 Oct 2023 14:56:35 +0530 Subject: [PATCH 2/2] Readme.md Signed-off-by: sarthaksarthak9 --- KubeEdge v1.14.2/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 KubeEdge v1.14.2/README.md diff --git a/KubeEdge v1.14.2/README.md b/KubeEdge v1.14.2/README.md new file mode 100644 index 0000000..ba6604c --- /dev/null +++ b/KubeEdge v1.14.2/README.md @@ -0,0 +1 @@ +# killercoda