Documentation
¶
Index ¶
- Constants
- func CreateOrUpdateWithStatus[T client.Object](ctx context.Context, cli client.Client, obj T, fun func(obj T) error) error
- func EncodeToX509Pair(in tls.Certificate) ([]byte, []byte)
- func RenderManifets(uid string, image string, edgehubaddress string, certs v1beta1.Certs) []client.Object
- func SignCertificate(caPEMBlock, certPEMBlock, keyPEMBlock []byte, options CertOptions) ([]byte, []byte, error)
- type CertOptions
- type CreateClusterRequest
- type CreateClusterResponse
- type EdgeClusterAPI
- func (a *EdgeClusterAPI) GetEdgeCluster(req *restful.Request, resp *restful.Response)
- func (a *EdgeClusterAPI) GetEdgeHub(req *restful.Request, resp *restful.Response)
- func (a *EdgeClusterAPI) InstallAgentTemplate(req *restful.Request, resp *restful.Response)
- func (a *EdgeClusterAPI) ListEdgeClusters(req *restful.Request, resp *restful.Response)
- func (a *EdgeClusterAPI) ListEdgeHubs(req *restful.Request, resp *restful.Response)
- func (a *EdgeClusterAPI) PreCreateEdgeCluster(req *restful.Request, resp *restful.Response)
- func (a *EdgeClusterAPI) Proxy(req *restful.Request, resp *restful.Response)
- func (a *EdgeClusterAPI) RegisterRoute(r *route.Group)
- func (a *EdgeClusterAPI) RemoveEdgeCluster(req *restful.Request, resp *restful.Response)
- func (a *EdgeClusterAPI) UpdateEdgeCluster(req *restful.Request, resp *restful.Response)
- type EdgeClusterK8sStore
- func (s EdgeClusterK8sStore[T]) Delete(ctx context.Context, name string) (T, error)
- func (s EdgeClusterK8sStore[T]) Get(ctx context.Context, name string) (T, error)
- func (s EdgeClusterK8sStore[T]) List(ctx context.Context, options ListOptions) (int, []T, error)
- func (s EdgeClusterK8sStore[T]) Update(ctx context.Context, name string, fun func(cluster T) error) (T, error)
- type EdgeHubItem
- type EdgeManager
- func (m *EdgeManager) ListPage(ctx context.Context, page, size int, search string, labels labels.Selector) (response.TypedPage[*v1beta1.EdgeCluster], error)
- func (m *EdgeManager) OnTunnelConnectedStatusChange(ctx context.Context, connected bool, isrefresh bool, fromname string, ...) error
- func (m *EdgeManager) PreCreate(ctx context.Context, example *v1beta1.EdgeCluster) (*v1beta1.EdgeCluster, error)
- func (m *EdgeManager) RenderInstallManifests(ctx context.Context, uid, token string) ([]byte, error)
- func (s *EdgeManager) SyncTunnelStatusFrom(ctx context.Context, server *tunnel.TunnelServer) error
- type EdgeStore
- type InstallerTemplateValues
- type ListOptions
- type PrecreateOptions
Constants ¶
View Source
const ( AnnotationKeyEdgeHubAddress = "edge.kubegems.io/edge-hub-address" AnnotationKeyEdgeHubCert = "edge.kubegems.io/edge-hub-key" AnnotationKeyEdgeHubCA = "edge.kubegems.io/edge-hub-ca" AnnotationKeyEdgeHubKey = "edge.kubegems.io/edge-hub-cert" LabelKeIsyEdgeHub = "edge.kubegems.io/is-edge-hub" AnnotationKeyEdgeAgentAddress = "edge.kubegems.io/edge-agent-address" AnnotationKeyEdgeAgentKeepaliveInterval = "edge.kubegems.io/edge-agent-keepalive-interval" AnnotationKeyEdgeAgentRegisterAddress = "edge.kubegems.io/edge-agent-register-address" AnnotationKeyKubernetesVersion = "edge.kubegems.io/kubernetes-version" AnnotationKeyAPIserverAddress = "edge.kubegems.io/apiserver-address" AnnotationKeyNodesCount = "edge.kubegems.io/nodes-count" // temporary connection do not write to database AnnotationIsTemporaryConnect = "edge.kubegems.io/temporary-connect" )
View Source
const DefaultAgentAddress = "http://127.0.0.1:8080"
View Source
const DefaultEdgeAgentImage = "docker.io/kubegems/kubegems-edge-agent:latest"
View Source
const (
DurationYear = time.Hour * 24 * 365
)
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateWithStatus ¶
func CreateOrUpdateWithStatus[T client.Object](ctx context.Context, cli client.Client, obj T, fun func(obj T) error) error
nolint: nestif,funlen,gocognit,forcetypeassert
func EncodeToX509Pair ¶
func EncodeToX509Pair(in tls.Certificate) ([]byte, []byte)
func RenderManifets ¶
func RenderManifets(uid string, image string, edgehubaddress string, certs v1beta1.Certs) []client.Object
nolint: gomnd,funlen
func SignCertificate ¶
func SignCertificate(caPEMBlock, certPEMBlock, keyPEMBlock []byte, options CertOptions) ([]byte, []byte, error)
nolint: gomnd,funlen
Types ¶
type CreateClusterRequest ¶
type CreateClusterRequest struct {
PrecreateOptions
}
type CreateClusterResponse ¶
type EdgeClusterAPI ¶
type EdgeClusterAPI struct { Cluster *EdgeManager Tunnel *tunnel.TunnelServer }
func (*EdgeClusterAPI) GetEdgeCluster ¶
func (a *EdgeClusterAPI) GetEdgeCluster(req *restful.Request, resp *restful.Response)
func (*EdgeClusterAPI) GetEdgeHub ¶
func (a *EdgeClusterAPI) GetEdgeHub(req *restful.Request, resp *restful.Response)
func (*EdgeClusterAPI) InstallAgentTemplate ¶
func (a *EdgeClusterAPI) InstallAgentTemplate(req *restful.Request, resp *restful.Response)
func (*EdgeClusterAPI) ListEdgeClusters ¶
func (a *EdgeClusterAPI) ListEdgeClusters(req *restful.Request, resp *restful.Response)
func (*EdgeClusterAPI) ListEdgeHubs ¶
func (a *EdgeClusterAPI) ListEdgeHubs(req *restful.Request, resp *restful.Response)
func (*EdgeClusterAPI) PreCreateEdgeCluster ¶
func (a *EdgeClusterAPI) PreCreateEdgeCluster(req *restful.Request, resp *restful.Response)
func (*EdgeClusterAPI) Proxy ¶
func (a *EdgeClusterAPI) Proxy(req *restful.Request, resp *restful.Response)
func (*EdgeClusterAPI) RegisterRoute ¶
func (a *EdgeClusterAPI) RegisterRoute(r *route.Group)
func (*EdgeClusterAPI) RemoveEdgeCluster ¶
func (a *EdgeClusterAPI) RemoveEdgeCluster(req *restful.Request, resp *restful.Response)
func (*EdgeClusterAPI) UpdateEdgeCluster ¶
func (a *EdgeClusterAPI) UpdateEdgeCluster(req *restful.Request, resp *restful.Response)
type EdgeClusterK8sStore ¶
func (EdgeClusterK8sStore[T]) Delete ¶
func (s EdgeClusterK8sStore[T]) Delete(ctx context.Context, name string) (T, error)
func (EdgeClusterK8sStore[T]) Get ¶
func (s EdgeClusterK8sStore[T]) Get(ctx context.Context, name string) (T, error)
func (EdgeClusterK8sStore[T]) List ¶
func (s EdgeClusterK8sStore[T]) List(ctx context.Context, options ListOptions) (int, []T, error)
type EdgeHubItem ¶
type EdgeManager ¶
type EdgeManager struct { SelfAddress string ClusterStore EdgeStore[*v1beta1.EdgeCluster] HubStore EdgeStore[*v1beta1.EdgeHub] }
func NewClusterManager ¶
func NewClusterManager(namespace string, selfhost string) (*EdgeManager, error)
func (*EdgeManager) OnTunnelConnectedStatusChange ¶
func (*EdgeManager) PreCreate ¶
func (m *EdgeManager) PreCreate(ctx context.Context, example *v1beta1.EdgeCluster) (*v1beta1.EdgeCluster, error)
return a register address
func (*EdgeManager) RenderInstallManifests ¶
func (*EdgeManager) SyncTunnelStatusFrom ¶
func (s *EdgeManager) SyncTunnelStatusFrom(ctx context.Context, server *tunnel.TunnelServer) error
type InstallerTemplateValues ¶
type ListOptions ¶
type PrecreateOptions ¶
type PrecreateOptions struct { UID string `json:"uid,omitempty"` HubName string `json:"hubName,omitempty"` // hub name edge cluster registered to Annotations map[string]string `json:"annotations,omitempty"` // edge annotations Labels map[string]string `json:"labels,omitempty"` // edge labels AgentImage string `json:"agentImage,omitempty"` // agent image edge cluster used to register CreateCert bool `json:"createCert,omitempty"` // pre generated edge certificate CertExpireAt *time.Time `json:"certExpireAt,omitempty"` // the expiration of the certificate }
Click to show internal directories.
Click to hide internal directories.