Skip to content

Commit

Permalink
Merge pull request #192 from llhuii/allinone-script
Browse files Browse the repository at this point in the history
Add all-in-one installation script/docs
  • Loading branch information
kubeedge-bot authored Sep 18, 2021
2 parents 2f39423 + cc4952c commit 3b75368
Show file tree
Hide file tree
Showing 7 changed files with 748 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Documentation is located on [readthedoc.io](https://sedna.readthedocs.io/). Thes


### Installation
Follow the [Sedna installation document](docs/setup/install.md) to install Sedna.
Follow the [Sedna installation document](docs/setup/quick-start.md) to install Sedna.

### Examples
Example1:[Using Joint Inference Service in Helmet Detection Scenario](/examples/joint_inference/helmet_detection_inference/README.md).
Expand Down
38 changes: 38 additions & 0 deletions docs/setup/all-in-one.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
### Deploy All In One Sedna
The [all-in-one script](/scripts/installation/all-in-one.sh) is used to install Sedna along with a mini Kubernetes environment locally, including:
- A Kubernetes v1.21 cluster with multi worker nodes, default zero worker node.
- KubeEdge with multi edge nodes, default is latest KubeEdge and one edge node.
- Sedna, default is the latest version.

It requires you:
- 2 CPUs or more
- 2GB+ free memory, depends on node number setting
- 10GB+ free disk space
- Internet connection(docker hub, github etc.)
- Linux platform, such as ubuntu/centos
- Docker 17.06+

For example:

```bash
curl https://raw.githubusercontent.com/kubeedge/sedna/master/scripts/installation/all-in-one.sh | NUM_EDGE_NODES=2 bash -
```

Above command installs a mini Sedna environment, including:
- A Kubernetes v1.21 cluster with only one master node.
- KubeEdge with two edge nodes.
- The latest Sedna.

You can play it online on [katacoda](https://www.katacoda.com/kubeedge-sedna/scenarios/all-in-one).

Advanced options:
| Env Variable | Description| Default Value|
| --- | --- | --- |
|NUM_EDGE_NODES | Number of KubeEdge nodes| 1 |
|NUM_CLOUD_WORKER_NODES | Number of cloud **worker** nodes, not master node| 0|
|SEDNA_VERSION | The Sedna version to be installed. |The latest version|
|KUBEEDGE_VERSION | The KubeEdge version to be installed. |The latest version|
|CLUSTER_NAME | The all-in-one cluster name| sedna-mini|
|FORCE_INSTALL_SEDNA | If 'true', force to reinstall Sedna|false|
|NODE_IMAGE | Custom node image| kubeedge/sedna-allinone-node:v1.21.1|
|REUSE_EDGE_CONTAINER | Whether reuse edge node containers or not|true|
8 changes: 7 additions & 1 deletion docs/setup/install.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
This guide covers how to install Sedna on existing KubeEdge environment, i.e. its two main components: [GM(GlobalManager)](/README.md#globalmanager) and [LC(LocalController)](/README.md#localcontroller).
This guide covers how to install Sedna on an existing Kubernetes environment.

For interested readers, Sedna also has two important components that would be mentioned below, i.e., [GM(GlobalManager)](/README.md#globalmanager) and [LC(LocalController)](/README.md#localcontroller) for workerload generation and maintenance.

If you don't have an existing Kubernetes, you can:
1) Install Kubernetes by following the [Kubernetes website](https://kubernetes.io/docs/setup/).
2) Or follow [quick start](quick-start.md) for other options.

### Prerequisites
- [Kubectl][kubectl] with right kubeconfig
Expand Down
38 changes: 30 additions & 8 deletions docs/setup/local-up.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,48 @@
### Deploy local Sedna clusters
### Deploy Local Sedna Cluster

Once you have docker running, you can create a local Sedna cluster with:
The [local-up script](/hack/local-up.sh) boots a local Kubernetes cluster, installs latest KubeEdge, and deploys Sedna based on the Sedna local repository.

#### Use Case
When one is contributing new features for Sedna, codes like AI algorithms under testing can be frequently changed before final deployment.
When coding in that case, s/he would suffer from tortured re-installations and frequent failures of the whole complicated system.
To get rid of the torments, one can use the local-up installation, embraced the single-machine simulation for agiler development and testing.

#### Setup

It requires:
- 2 CPUs or more
- 1GB+ free memory
- 5GB+ free disk space
- Internet connection(docker hub, github etc.)
- Linux platform, such as ubuntu/centos
- Docker 17.06+
- A local Sedna code repository


Then you can enter Sedna local code repository, and create a local Sedna cluster with:
```
bash hack/local-up.sh
```
This script uses [kind](https://kind.sigs.k8s.io/docs/user/quick-start/) to create a
local k8s cluster with one master node, and boots one edge node by running KubeEdge.
You can see them by using `kubectl get nodes -o wide`:

In more details, this local-up script uses [kind](https://kind.sigs.k8s.io/docs/user/quick-start/) to create a
local K8S cluster with one master node, and joins the K8S cluster by running KubeEdge.

In another terminal, you can see them by using `kubectl get nodes -o wide`:
```shell
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
edge-node Ready agent,edge 3d21h v1.19.3-kubeedge-v1.6.1 192.168.0.233 <none> Ubuntu 18.04.5 LTS 4.15.0-128-generic docker://20.10.2
sedna-control-plane Ready control-plane,master 3d21h v1.20.2 172.18.0.2 <none> Ubuntu 20.10 4.15.0-128-generic containerd://1.5.0-beta.3-24-g95513021e
```

You can access master node with:
You can login the master node with:
```
docker exec -it --detach-keys=ctrl-@ sedna-control-plane bash
# since the master node just uses containerd CRI runtime, you can alias the CRI cli 'crictl' as 'docker'
alias docker=crictl
```

Docker images can be loaded into the cluster nodes with:
After you have done developing, built worker image and want to run your worker into master node, your worker image should be loaded into the cluster nodes with:
```
kind load docker-image my-custom-image --name sedna
kind load docker-image --name sedna <your-custom-worker-image>
```

10 changes: 10 additions & 0 deletions docs/setup/quick-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
There are some ways to set up Sedna, depends on your use case:
- If you have none Kubernetes environment and don't want to install Kubernetes manually, you can follow [the instruction](./all-in-one.md) to install all-in-one Sedna environment.

- Otherwise, when Kubernetes is ready, you can follow [this instruction](./install.md) to install Sedna on the existing Kubernetes cluster.

- One more thing: we also have a local-up install script available for easier Sedna development. The local-up version boots a local Kubernetes cluster and installs Sedna based on a local repository. The use case and setup procedures are available [here](./local-up.md).


After set up Sedna, you can try out [examples](/examples).

Loading

0 comments on commit 3b75368

Please sign in to comment.