PageSourceSearch

https://kubeedge.io/assets/js/4a2b4ef3.5ce6f986.js

js kubeedge.io collected 2026-10-02 16:40:14 UTC 8,661 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkmy_website=globalThis.webpackChunkmy_website||[]).push([[1122],{15680(e,t,n){n.d(t,{xA:()=>u,yg:()=>h});var o=n(96540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=o.createContext({}),c=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=c(e.components);return o.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},g=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,s=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),g=c(n),h=r,p=g["".concat(s,".").concat(h)]||g[h]||d[h]||a;return n?o.createElement(p,l(l({ref:t},u),{},{components:n})):o.createElement(p,l({ref:t},u))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,l=new Array(a);l[0]=g;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i.mdxType="string"==typeof e?e:r,l[1]=i;for(var c=2;c<a;c++)l[c]=n[c];return o.createElement.apply(null,l)}return o.createElement.apply(null,n)}g.displayName="MDXCreateElement"},53892(e,t,n){n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>d,frontMatter:()=>a,metadata:()=>i,toc:()=>c});var o=n(58168),r=(n(96540),n(15680));const a={title:"CloudHub",sidebar_position:1},l=void 0,i={unversionedId:"architecture/cloud/cloudhub",id:"architecture/cloud/cloudhub",title:"CloudHub",description:"CloudHub Overview",source:"@site/docs/architecture/cloud/cloudhub.md",sourceDirName:"architecture/cloud",slug:"/architecture/cloud/cloudhub",permalink:"/docs/architecture/cloud/cloudhub",draft:!1,editUrl:"https://github.com/kubeedge/website/blob/master/docs/architecture/cloud/cloudhub.md",tags:[],version:"current",lastUpdatedBy:"yaphixf",lastUpdatedAt:1689162916,formattedLastUpdatedAt:"Jul 12, 2023",sidebarPosition:1,frontMatter:{title:"CloudHub",sidebar_position:1},sidebar:"documentationSideBar",previous:{title:"Cloud Components",permalink:"/docs/category/cloud-components"},next:{title:"Edge Controller",permalink:"/docs/architecture/cloud/edge_controller"}},s={},c=[{value:"CloudHub Overview",id:"cloudhub-overview",level:2},{value:"Get message context and create ChannelQ for events:",id:"get-message-context-and-create-channelq-for-events",level:3},{value:"Create http connection over websocket:",id:"create-http-connection-over-websocket",level:3},{value:"Read message from edge:",id:"read-message-from-edge",level:3},{value:"Write Message to Edge:",id:"write-message-to-edge",level:3},{value:"Publish Message to Controllers:",id:"publish-message-to-controllers",level:3},{value:"Usage",id:"usage",level:2}],u={toc:c};function d(e){let{components:t,...n}=e;return(0,r.yg)("wrapper",(0,o.A)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h2",{id:"cloudhub-overview"},"CloudHub Overview"),(0,r.yg)("p",null,"CloudHub is one module of cloudcore and is the mediator between Controllers and the Edge side. It supports both web-socket based connection as well as a ",(0,r.yg)("a",{parentName:"p",href:"https://quicwg.org/ops-drafts/draft-ietf-quic-applicability.html"},"QUIC")," protocol access at the same time.\nThe edgehub can choose one of the protocols to access to the cloudhub. CloudHub's function is to enable the communication between edge and the Controllers."),(0,r.yg)("p",null,"The connection to the edge(through EdgeHub module) is done through the HTTP over websocket connection.\nFor internal 
1communication it directly communicates with the Controllers.\nAll the request send to CloudHub are of context object which are stored in channelQ along with the\nmapped channels of event object marked to its nodeID."),(0,r.yg)("p",null,"The main functions performed by CloudHub are:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Get message context and create ChannelQ for events"),(0,r.yg)("li",{parentName:"ul"},"Create http connection over websocket"),(0,r.yg)("li",{parentName:"ul"},"Serve websocket connection"),(0,r.yg)("li",{parentName:"ul"},"Read message from edge"),(0,r.yg)("li",{parentName:"ul"},"Write message to edge"),(0,r.yg)("li",{parentName:"ul"},"Publish message to Controller")),(0,r.yg)("h3",{id:"get-message-context-and-create-channelq-for-events"},"Get message context and create ChannelQ for events:"),(0,r.yg)("p",null,"The context object is stored in a channelQ.\nFor all nodeID channel is created and the message is converted to event object\nEvent object is then passed through the channel."),(0,r.yg)("h3",{id:"create-http-connection-over-websocket"},"Create http connection over websocket:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"TLS certificates are loaded through the path provided in the context object"),(0,r.yg)("li",{parentName:"ul"},"HTTP server is started with TLS configurations"),(0,r.yg)("li",{parentName:"ul"},"Then HTTP connection is upgraded to websocket connection receiving conn object."),(0,r.yg)("li",{parentName:"ul"},"ServeConn function is responsible for serving all incoming connections")),(0,r.yg)("h3",{id:"read-message-from-edge"},"Read message from edge:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"First a deadline is set for keepalive interval"),(0,r.yg)("li",{parentName:"ul"},"Then the JSON message from connection is read"),(0,r.yg)("li",{parentName:"ul"},"After the details of Message Router are all set"),(0,r.yg)("li",{parentName:"ul"},"Message is then converted to event object for cloud internal communication"),(0,r.yg)("li",{parentName:"ul"},"In the end the event is published to Controllers")),(0,r.yg)("h3",{id:"write-message-to-edge"},"Write Message to Edge:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"First all event objects are received with the given nodeID"),(0,r.yg)("li",{parentName:"ul"},"The existence of same request and the liveness of the node need to be checked"),(0,r.yg)("li",{parentName:"ul"},"The event object is converted to message structure"),(0,r.yg)("li",{parentName:"ul"},"Write deadline is set. Then the message is passed to the websocket connection")),(0,r.yg)("h3",{id:"publish-message-to-controllers"},"Publish Message to Controllers:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"A default message with timestamp, clientID and event type is sent to controller\nevery time a request is made to websocket connection"),(0,r.yg)("li",{parentName:"ul"},"If the node gets disconnected then error is thrown and an event of describing\nnode failure is published to the controller.")),(0,r.yg)("h2",{id:"usage"},"Usage"),(0,r.yg)("p",null,"The CloudHub can be configured in three ways as mentioned below :"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Start the websocket server only"),": Click ",(0,r.yg)("a",{parentName:"li",href:"https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#start-the-websocket-server-only"},"here")," to see the details."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Start the quic server only"),": Click ",(0,r.yg)("a",{parentName:"li",href:"https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#start-the-quic-server-only"},"here")," to see the details."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Start the websocket and quic server at the same time"),": Click ",(0,r.yg)("a",{parentName:"li",href:"https://github.com/kubeedge/kubeedge/tree/master/docs/proposals/quic-design.md#start-the-websocket-and-quic-server-at-the-same-time"},"here")," to see the details")))}d.isMDXComponent=!0}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.