diff options
| author | shouhong <shouhong.zhang@outlook.com> | 2019-05-22 20:13:16 +0800 |
|---|---|---|
| committer | shouhong <shouhong.zhang@outlook.com> | 2019-05-22 20:13:16 +0800 |
| commit | 690fd9d5f016a704745faf11256030a91f5d82a4 (patch) | |
| tree | 7c3cb1ebc3b196799f1b0bbd423c10ea5646ba4d /common/types | |
| parent | Check node limit for quic protocol (#540) (diff) | |
| download | kubeedge-690fd9d5f016a704745faf11256030a91f5d82a4.tar.gz | |
Consolidate the kube config at controller
Diffstat (limited to 'common/types')
| -rw-r--r-- | common/types/types.go | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/common/types/types.go b/common/types/types.go index 7ac2d054c..fb6e7faab 100644 --- a/common/types/types.go +++ b/common/types/types.go @@ -1,6 +1,9 @@ package types import ( + "time" + + "github.com/kubeedge/kubeedge/common/constants" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/types" @@ -26,3 +29,44 @@ type NodeStatusRequest struct { Status v1.NodeStatus ExtendResources map[v1.ResourceName][]ExtendResource } + +// KubeInfo contains Kubernetes related configuration +type KubeInfo struct { + // KubeMaster is the url of edge master(kube api server) + KubeMaster string + + // KubeConfig is the config used connect to edge master + KubeConfig string + + // KubeNamespace is the namespace to watch(default is NamespaceAll) + KubeNamespace string + + // KubeContentType is the content type communicate with edge master(default is "application/vnd.kubernetes.protobuf") + KubeContentType string + + // KubeQPS is the QPS communicate with edge master(default is 1024) + KubeQPS float32 + + // KubeBurst default is 10 + KubeBurst int + + // NodeID for the current node + KubeNodeID string + + // NodeName for the current node + KubeNodeName string + + // KubeUpdateNodeFrequency is the time duration for update node status(default is 20s) + KubeUpdateNodeFrequency time.Duration +} + +// NewKubeInfo create KubeInfo struct with default values +func NewKubeInfo() *KubeInfo { + return &KubeInfo{ + KubeNamespace: constants.DefaultKubeNamespace, + KubeContentType: constants.DefaultKubeContentType, + KubeQPS: constants.DefaultKubeQPS, + KubeBurst: constants.DefaultKubeBurst, + KubeUpdateNodeFrequency: constants.DefaultKubeUpdateNodeFrequency * time.Second, + } +} |
