Refactor: integrate edgeruntime && support kubeedge v1.8.2
Created by: zhu733756
Signed-off-by: zhu733756 zhu733756@kubesphere.io
/kind feature
Backgrounds
Since Kubeedge v1.8+, the iptables-manager component has been integrated into the internal of the Kubeedge Cloudcore. Our former work by integrating automated operation and maintenance with the component of edge-watcher-controller will be officially removed. Because these two components have the same ability, and the former is more light, and no need to add extra CRDs like Iptables and IptalbesRules.
What's changed?
This pr brings big changes.
Firstly, a new component named Edgeservice will be separated from the former component edge-watcher-controller which will serve for the KubeSphere backend instead.
Secondly, the ansible-playbook role of Kubeedge will be replaced as EdgeRuntime. That is to say that we will support more edge frameworks as optional. After the installation is finished, will see the below endpoint in kubesphere-config configmap of the namespace kubesphere-system:
edgeruntime:
endpoint: http://edgeservice.kubeedge.svc/api/
At last, the previous configuration will be optimized, the useless configurations will be removed. See below:
edgeruntime: # Add edge nodes to your cluster and deploy workloads on edge nodes.
enabled: false
kubeedge: # kubeedge configurations
enabled: false
cloudCore:
# resources: {}
cloudHub:
advertiseAddress: # At least a public IP address or an IP address that can be accessed by edge nodes must be provided.
- ""
service:
cloudhubNodePort: "30000"
cloudhubQuicNodePort: "30001"
cloudhubHttpsNodePort: "30002"
cloudstreamNodePort: "30003"
tunnelNodePort: "30004"
# edgeService:
# resources: {}
How to run the ansible playbook ?
At first, you need to enable edgeruntime component and kubeedge framework by executing the cmd kubectl -n kubesphere-system edit cc
:
edgeruntime: # Add edge nodes to your cluster and deploy workloads on edge nodes.
enabled: true
kubeedge: # kubeedge configurations
enabled: true
cloudCore:
# resources: {}
cloudHub:
advertiseAddress: # At least a public IP address or an IP address which can be accessed by edge nodes must be provided.
- "192.168.88.6"
service:
cloudhubNodePort: "30000"
cloudhubQuicNodePort: "30001"
cloudhubHttpsNodePort: "30002"
cloudstreamNodePort: "30003"
tunnelNodePort: "30004"
# edgeService:
# resources: {}
After fetching this pr, you can do the following for testing the installation process:
export ANSIBLE_ROLES_PATH=<your code basedir>/roles
ansible-playbook ./playbooks/edgeruntime.yaml -e @./results/ks-config.json -e @./results/ks-status.json
Outputs:
DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]. This feature will be removed
from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [localhost] ***************************************************************************************************************************************************************************************************
TASK [download : Generating images list] ***************************************************************************************************************************************************************************
skipping: [localhost]
TASK [download : Synchronizing images] *****************************************************************************************************************************************************************************
TASK [kubesphere-defaults : KubeSphere | Setting images' namespace override] ***************************************************************************************************************************************
skipping: [localhost]
TASK [kubesphere-defaults : KubeSphere | Configuring defaults] *****************************************************************************************************************************************************
ok: [localhost] => {
"msg": "Check roles/kubesphere-defaults/defaults/main.yml"
}
TASK [edgeruntime : KubeEdge | Getting KubeEdge installation files] ************************************************************************************************************************************************
ok: [localhost]
TASK [edgeruntime : KubeEdge | Getting NodeIp] *********************************************************************************************************************************************************************
changed: [localhost]
TASK [edgeruntime : KubeEdge | Getting NodeName] *******************************************************************************************************************************************************************
changed: [localhost]
TASK [edgeruntime : KubeEdge | Creating manifests] *****************************************************************************************************************************************************************
ok: [localhost] => (item={'name': 'custom-values-kubeedge', 'file': 'custom-values-kubeedge.yaml'})
TASK [edgeruntime : KubeEdge | Installing CloudCore] ***************************************************************************************************************************************************************
changed: [localhost]
TASK [edgeruntime : KubeEdge | Labeling kubeedge namespace] ********************************************************************************************************************************************************
changed: [localhost]
TASK [edgeruntime : KubeEdge | Importing kubeEdge status] **********************************************************************************************************************************************************
changed: [localhost]
PLAY RECAP *********************************************************************************************************************************************************************************************************
localhost : ok=8 changed=5 unreachable=0 failed=0 skipped=3 rescued=0 ignored=0
/cc