 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- type CompatibilityIssue
- type CompatibilityState
- type CompatibilityStatus
- type CreateNodeRequest
- type CreateNodeResponse
- type GatewayClientGetter
- type GatewayClientsChangesNotifier
- type GatewayInstance
- type GatewayInstanceGetter
- type IngressControllerState
- type KongResource
- type ListNodeResponse
- type NodeAPIClient
- func (c *NodeAPIClient) CreateNode(ctx context.Context, req *CreateNodeRequest) (*CreateNodeResponse, error)
- func (c *NodeAPIClient) DeleteNode(ctx context.Context, nodeID string) error
- func (c *NodeAPIClient) ListAllNodes(ctx context.Context) ([]*NodeItem, error)
- func (c *NodeAPIClient) ListNodes(ctx context.Context, pageNumber int) (*ListNodeResponse, error)
- func (c *NodeAPIClient) UpdateNode(ctx context.Context, nodeID string, req *UpdateNodeRequest) (*UpdateNodeResponse, error)
 
- type NodeAgent
- type NodeItem
- type PaginationInfo
- type UpdateNodeRequest
- type UpdateNodeResponse
Constants ¶
const ( MinRefreshNodePeriod = 30 * time.Second DefaultRefreshNodePeriod = 60 * time.Second )
const ( // NodeTypeIngressController is the type of nodes representing KIC instances. NodeTypeIngressController = "ingress-controller" // NodeTypeKongProxy is the type of nodes representing kong gateway instances. NodeTypeKongProxy = "kong-proxy" )
Variables ¶
var KicNodeAPIPathPattern = "%s/kic/api/runtime_groups/%s/v1/kic-nodes"
    KicNodeAPIPathPattern is the path pattern for KIC node operations.
Functions ¶
This section is empty.
Types ¶
type CompatibilityIssue ¶
type CompatibilityIssue struct {
	Code              string          `json:"code"`
	Severity          string          `json:"severity"`
	Description       string          `json:"description"`
	Resolution        string          `json:"resolution"`
	AffectedResources []*KongResource `json:"affected_resources"`
}
    type CompatibilityState ¶
type CompatibilityState string
const ( CompatibilityStateUnspecified CompatibilityState = "COMPATIBILITY_STATE_UNSPECIFIED" CompatibilityStateFullyCompatible CompatibilityState = "COMPATIBILITY_STATE_FULLY_COMPATIBLE" CompatibilityStateInconpatible CompatibilityState = "COMPATIBILITY_STATE_INCOMPATIBLE" CompatibilityStateUnknown CompatibilityState = "COMPATIBILITY_STATE_UNKNOWN" )
type CompatibilityStatus ¶
type CompatibilityStatus struct {
	State  CompatibilityState    `json:"state"`
	Issues []*CompatibilityIssue `json:"issues,omitempty"`
}
    type CreateNodeRequest ¶
type CreateNodeRequest struct {
	ID                  string               `json:"id,omitempty"`
	Hostname            string               `json:"hostname"`
	Type                string               `json:"type"`
	LastPing            int64                `json:"last_ping"`
	Version             string               `json:"version"`
	CompatabilityStatus *CompatibilityStatus `json:"compatibility_status,omitempty"`
	Status              string               `json:"status,omitempty"`
	ConfigHash          string               `json:"config_hash,omitempty"`
}
    type CreateNodeResponse ¶
type CreateNodeResponse struct {
	Item *NodeItem `json:"item"`
}
    type GatewayClientGetter ¶
type GatewayClientGetter struct {
	// contains filtered or unexported fields
}
    GatewayClientGetter gets gateway instances from admin API clients.
func NewGatewayClientGetter ¶
func NewGatewayClientGetter(logger logr.Logger, clientsProvider dataplane.AdminAPIClientsProvider) *GatewayClientGetter
NewGatewayClientGetter creates a GatewayClientGetter to get gateway instances from client provider.
func (*GatewayClientGetter) GetGatewayInstances ¶
func (p *GatewayClientGetter) GetGatewayInstances() ([]GatewayInstance, error)
GetGatewayInstances gets gateway instances from currently available gateway API clients.
type GatewayClientsChangesNotifier ¶
type GatewayClientsChangesNotifier interface {
	SubscribeToGatewayClientsChanges() (<-chan struct{}, bool)
}
    type GatewayInstance ¶
GatewayInstance is a controlled kong gateway instance. its hostname and version will be used to update status of nodes corresponding to the instance in konnect.
type GatewayInstanceGetter ¶
type GatewayInstanceGetter interface {
	GetGatewayInstances() ([]GatewayInstance, error)
}
    GatewayInstanceGetter is the interface to get currently running gateway instances in the kubernetes cluster.
type IngressControllerState ¶
type IngressControllerState string
const ( IngressControllerStateUnspecified IngressControllerState = "INGRESS_CONTROLLER_STATE_UNSPECIFIED" IngressControllerStateOperational IngressControllerState = "INGRESS_CONTROLLER_STATE_OPERATIONAL" IngressControllerStatePartialConfigFail IngressControllerState = "INGRESS_CONTROLLER_STATE_PARTIAL_CONFIG_FAIL" IngressControllerStateInoperable IngressControllerState = "INGRESS_CONTROLLER_STATE_INOPERABLE" IngressControllerStateUnknown IngressControllerState = "INGRESS_CONTROLLER_STATE_UNKNOWN" )
type KongResource ¶
type ListNodeResponse ¶
type ListNodeResponse struct {
	Items []*NodeItem     `json:"items"`
	Page  *PaginationInfo `json:"page"`
}
    type NodeAPIClient ¶
NodeAPIClient is used for sending requests to Konnect Node API. It can be used to register Nodes in Konnect's Runtime Groups.
func NewNodeAPIClient ¶
func NewNodeAPIClient(cfg adminapi.KonnectConfig) (*NodeAPIClient, error)
NewNodeAPIClient creates a Konnect client.
func (*NodeAPIClient) CreateNode ¶
func (c *NodeAPIClient) CreateNode(ctx context.Context, req *CreateNodeRequest) (*CreateNodeResponse, error)
func (*NodeAPIClient) DeleteNode ¶
func (c *NodeAPIClient) DeleteNode(ctx context.Context, nodeID string) error
func (*NodeAPIClient) ListAllNodes ¶
func (c *NodeAPIClient) ListAllNodes(ctx context.Context) ([]*NodeItem, error)
ListAllNodes call ListNodes() repeatedly to get all nodes in a runtime group.
func (*NodeAPIClient) ListNodes ¶
func (c *NodeAPIClient) ListNodes(ctx context.Context, pageNumber int) (*ListNodeResponse, error)
func (*NodeAPIClient) UpdateNode ¶
func (c *NodeAPIClient) UpdateNode(ctx context.Context, nodeID string, req *UpdateNodeRequest) (*UpdateNodeResponse, error)
type NodeAgent ¶
type NodeAgent struct {
	Hostname string
	Version  string
	Logger logr.Logger
	// contains filtered or unexported fields
}
    NodeAgent gets the running status of KIC node and controlled kong gateway nodes, and update their statuses to konnect.
func NewNodeAgent ¶
func NewNodeAgent( hostname string, version string, refreshPeriod time.Duration, logger logr.Logger, client *NodeAPIClient, configStatusSubscriber dataplane.ConfigStatusSubscriber, gatewayGetter GatewayInstanceGetter, gatewayClientsChangesNotifier GatewayClientsChangesNotifier, ) *NodeAgent
NewNodeAgent creates a new node agent. hostname and version are hostname and version of KIC.
func (*NodeAgent) NeedLeaderElection ¶
NeedLeaderElection implements LeaderElectionRunnable interface to ensure that the node agent is run only when the KIC instance is elected a leader.
type NodeItem ¶
type NodeItem struct {
	ID                  string               `json:"id"`
	Version             string               `json:"version"`
	Hostname            string               `json:"hostname"`
	LastPing            int64                `json:"last_ping"`
	Type                string               `json:"type"`
	CreatedAt           int64                `json:"created_at"`
	UpdatedAt           int64                `json:"updated_at"`
	ConfigHash          string               `json:"config_hash"`
	CompatibilityStatus *CompatibilityStatus `json:"compatibility_status,omitempty"`
	Status              string               `json:"status,omitempty"`
}
    type PaginationInfo ¶
type UpdateNodeRequest ¶
type UpdateNodeRequest struct {
	Hostname            string               `json:"hostname"`
	Type                string               `json:"type"`
	LastPing            int64                `json:"last_ping"`
	Version             string               `json:"version"`
	ConfigHash          string               `json:"config_hash,omitempty"`
	CompatabilityStatus *CompatibilityStatus `json:"compatibility_status,omitempty"`
	Status              string               `json:"status,omitempty"`
}
    type UpdateNodeResponse ¶
type UpdateNodeResponse struct {
	Item *NodeItem `json:"item"`
}
    
       Directories
      ¶
      Directories
      ¶
    
    | Path | Synopsis | 
|---|---|
| Package runtimegroups provides primitives to interact with the openapi HTTP API. | Package runtimegroups provides primitives to interact with the openapi HTTP API. | 
| Package runtimegroupsconfig provides primitives to interact with the openapi HTTP API. | Package runtimegroupsconfig provides primitives to interact with the openapi HTTP API. |