summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorgy95 <guoyao17@huawei.com>2022-04-22 17:00:37 +0800
committergy95 <guoyao17@huawei.com>2022-09-22 14:44:06 +0800
commitd887c7c416f3f38ec4b69241229289fe62ba1bbf (patch)
treee61fa01a5144b524861a99ed5d3dae500541e221 /common
parentMerge pull request #4125 from wackxu/fixdeletetermin (diff)
downloadkubeedge-d887c7c416f3f38ec4b69241229289fe62ba1bbf.tar.gz
support operations: upgrade edge node from cloud
Signed-off-by: gy95 <guoyao17@huawei.com>
Diffstat (limited to 'common')
-rw-r--r--common/constants/default.go13
-rw-r--r--common/types/types.go20
2 files changed, 31 insertions, 2 deletions
diff --git a/common/constants/default.go b/common/constants/default.go
index 63f35f3a7..8ef4bac13 100644
--- a/common/constants/default.go
+++ b/common/constants/default.go
@@ -29,8 +29,9 @@ const (
DefaultCertFile = "/etc/kubeedge/certs/server.crt"
DefaultKeyFile = "/etc/kubeedge/certs/server.key"
- DefaultCAURL = "/ca.crt"
- DefaultCertURL = "/edge.crt"
+ DefaultCAURL = "/ca.crt"
+ DefaultCertURL = "/edge.crt"
+ DefaultNodeUpgradeURL = "/nodeupgrade"
DefaultStreamCAFile = "/etc/kubeedge/ca/streamCA.crt"
DefaultStreamCertFile = "/etc/kubeedge/certs/stream.crt"
@@ -131,6 +132,11 @@ const (
DefaultDeviceModelEventBuffer = 1
DefaultUpdateDeviceStatusWorkers = 1
+ // NodeUpgradeJobController
+ DefaultNodeUpgradeJobStatusBuffer = 1024
+ DefaultNodeUpgradeJobEventBuffer = 1
+ DefaultNodeUpgradeJobWorkers = 1
+
// Resource sep
ResourceSep = "/"
@@ -158,4 +164,7 @@ const (
DefaultBurst = 60
// MaxRespBodyLength is the max length of http response body
MaxRespBodyLength = 1 << 20 // 1 MiB
+
+ EdgeNodeRoleKey = "node-role.kubernetes.io/edge"
+ EdgeNodeRoleValue = ""
)
diff --git a/common/types/types.go b/common/types/types.go
index 61fa79272..be5745d1f 100644
--- a/common/types/types.go
+++ b/common/types/types.go
@@ -26,3 +26,23 @@ type NodeStatusRequest struct {
Status v1.NodeStatus
ExtendResources map[v1.ResourceName][]ExtendResource
}
+
+// NodeUpgradeJobRequest is upgrade msg coming from cloud to edge
+type NodeUpgradeJobRequest struct {
+ UpgradeID string
+ HistoryID string
+ Version string
+ UpgradeTool string
+ Image string
+}
+
+// NodeUpgradeJobResponse is used to report status msg to cloudhub https service
+type NodeUpgradeJobResponse struct {
+ UpgradeID string
+ HistoryID string
+ NodeName string
+ FromVersion string
+ ToVersion string
+ Status string
+ Reason string
+}