Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
update README to add YurtAppDaemon and YurtIngress (#34)
Browse files Browse the repository at this point in the history
Signed-off-by: zhenggu1 <zhengguang.zhang@intel.com>
  • Loading branch information
zzguang authored Jan 11, 2022
1 parent aa6e57b commit 3fa127c
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 10 deletions.
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# Yurt-app-manager

This repository contains two CRD/controllers, NodePool and UnitedDeployment.
The NodePool provides a convenient management experience for a pool of nodes
within the same region or site. The UnitedDeployment defines a new edge
application management methodology of using per node pool workload. For details
of the design, please see the [document](https://github.com/openyurtio/openyurt/blob/master/docs/enhancements/20201211-nodepool_uniteddeployment.md).
This repository contains 4 CRD/controllers: NodePool, UnitedDeployment, YurtAppDaemon and YurtIngress.

The NodePool provides a convenient management experience for a pool of nodes within the same region or site.
The UnitedDeployment defines a new edge application management methodology of using per node pool workload.
The YurtAppDaemon provides a similar K8S DaemonSet support for user app workload from the NodePool level.
The YurtIngress is responsible to deploy configurable ingress controller to the user specified NodePools.

For details of the design, please see the documents below:
NodePool and UnitedDeployment: [document](https://github.com/openyurtio/openyurt/blob/master/docs/enhancements/20201211-nodepool_uniteddeployment.md).
YurtAppDaemon: [document](https://github.com/openyurtio/openyurt/blob/master/docs/enhancements/20210729-yurtappdaemon.md).
YurtIngress: [document](https://github.com/openyurtio/openyurt/blob/master/docs/proposals/20210628-nodepool-ingress-support.md).

## Getting Start

Since the OpenYurt is extended from the upstream Kubernetes using only plugins,
the NodePool and UnitedDeployment can be used with upstream Kubernetes as well.
But to make the best use of them, we recommend using them with the OpenYurt.
For a complete example, please check out the [tutorial](docs/yurt-app-manager-tutorial.md)
the NodePool, UnitedDeployment, YurtAppDaemon and YurtIngress can be used with upstream Kubernetes as well.
But to make the best use of them, we recommend using them with the OpenYurt.
For a complete example, please check out the [tutorial](docs/yurt-app-manager-tutorial.md).

## Contributing
## Contributing

Contributions are welcome, whether by creating new issues or pull requests. See
our [contributing document](https://github.com/openyurtio/openyurt/blob/master/CONTRIBUTING.md) to get started.
Expand Down
176 changes: 176 additions & 0 deletions docs/YurtAppDaemon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@


<a name="Ynuk5"></a>
# Description
<br />In edge scenarios,edge nodes from the same region are allocated to the same nodepool, generally it is necessary to deploy some system components at the nodepool level, such as CoreDNS. When a nodepool is created, we want these system components bo be created automatically without any manual actions.
<br />
<br />YurtAppDaemon ensures all or some nodepools run replicas with Deployment or StatefulSet as template. With the nodepools are created, these child Deployments or Statefulsets are added into the cluster as well, and the creation/update of the child Deployments or Statefulsets are implemented by the YurtAppDaemon controller. These child Deployments or Statefulsets will be recycled when the nodepool is removed from the cluster, and deleting the YurtAppDaemon CR will cleanup the Deployments or StatefulSets it created. The behavior of YurtAppDaemon is similar to K8S Daemonset, the difference is YurtAppDaemon creates K8S workload automatically from the nodepool level.<br />​

<a name="PGkba"></a>
## YurtAppDamon Supported Features

- Support Deployment and Statefulset as template
- Support template update and trigger sub-resources update, such as image update of the Deployment template will trigger the child Deployment image update accordingly
- Support auto distribution of the template resources from the nodepool level:
- When the nodepools match the corresponding label, sub-resources are created automatically
- When the nodepools delete the corresponding label, sub-resources are deleted automatically

​<br />
<a name="cvH4w"></a>
## YurtAppDamon & UnitedDeployment

<a name="RFvu8"></a>
### UnitedDeployment

![image.png](./images/uniteddeployment.png)

<a name="JML1n"></a>
### YurtAppDaemon
![image.png](./images/yurtappdaemon.png)

<a name="th18J"></a>
# Demo
<a name="e5xUz"></a>
## create nodepool test1
```bash
cat <<EOF | kubectl apply -f -
apiVersion: apps.openyurt.io/v1alpha1
kind: NodePool
metadata:
name: test1
spec:
selector:
matchLabels:
apps.openyurt.io/nodepool: test1
type: Edge
EOF
```
<a name="rfeAg"></a>
## create nodepool test2
```bash
cat <<EOF | kubectl apply -f -
apiVersion: apps.openyurt.io/v1alpha1
kind: NodePool
metadata:
name: test2
spec:
selector:
matchLabels:
apps.openyurt.io/nodepool: test2
type: Edge
EOF
```
<a name="ztrk6"></a>
## add node to nodepool
```bash
kubectl label node cn-beijing.172.23.142.31 apps.openyurt.io/desired-nodepool=test1
kubectl label node cn-beijing.172.23.142.32 apps.openyurt.io/desired-nodepool=test1

kubectl label node cn-beijing.172.23.142.34 apps.openyurt.io/desired-nodepool=test2
kubectl label node cn-beijing.172.23.142.35 apps.openyurt.io/desired-nodepool=test2

```

<a name="LKPk3"></a>
## create yurtappdaemon
```bash
cat <<EOF | kubectl apply -f -
apiVersion: apps.openyurt.io/v1alpha1
kind: YurtAppDaemon
metadata:
name: daemon-1
namespace: default
spec:
selector:
matchLabels:
app: daemon-1
workloadTemplate:
deploymentTemplate:
metadata:
labels:
app: daemon-1
spec:
replicas: 1
selector:
matchLabels:
app: daemon-1
template:
metadata:
labels:
app: daemon-1
spec:
containers:
- image: nginx:1.18.0
imagePullPolicy: Always
name: nginx
nodepoolSelector:
matchLabels:
yurtappdaemon.openyurt.io/type: "nginx"
EOF
```

<a name="F67pd"></a>
## label for nodepool test1
```bash
kubectl label np test1 yurtappdaemon.openyurt.io/type=nginx

# Check the Deployment
kubectl get deployments.apps

# Check the Deployment nodeselector

# Check the Pod
```

<a name="MnFOK"></a>
## label for nodepool test2
```bash
kubectl label np test2 yurtappdaemon.openyurt.io/type=nginx

# Check the Deployment
kubectl get deployments.apps

# Check the Deployment nodeselector

# Check the Pod
```

<a name="bo5kt"></a>
## change yurtAppDaemon

```bash
# Change yurtappdaemon workloadTemplate replicas to 2

# Change yurtappdaemon workloadTemplate image to nginx:1.19.0

# Check the Pod
```


<a name="UTCfl"></a>
## remove nodepool label
```bash
# Remove the nodepool test1 label
kubectl label np test1 yurtappdaemon.openyurt.io/type-

# Check the Deployment

# Check the Pod

# Remove the nodepool test2 label
kubectl label np test2 yurtappdaemon.openyurt.io/type-

# Check the Deployment

# Check the Pod

```
Binary file added docs/images/uniteddeployment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/yurtappdaemon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion docs/yurt-app-manager-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,13 @@ containers:
```
- 4 conclusion
Patch solves the problem of single attribute upgrade and full release of nodepool.


### YurtAppDaemon
For details please see the [tutorial](./YurtAppDaemon.md).

### YurtIngress
For details please see the links below:
English Version:
https://github.com/openyurtio/openyurt.io/blob/master/versioned_docs/version-v0.5.0/user-manuals/network/edge-ingress.md.
Chinese Version:
https://github.com/openyurtio/openyurt.io/blob/master/i18n/zh/docusaurus-plugin-content-docs/version-v0.5.0/user-manuals/network/edge-ingress.md.

0 comments on commit 3fa127c

Please sign in to comment.