pke

package
v0.0.0-...-e7c744b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(
	clusterGetter common.ClusterGetter,
	errorHandler emperror.Handler,
	tokenGenerator TokenGenerator,
	externalBaseURL string,
	workflowClient client.Client,
	leaderRepository LeaderRepository,
) *API

func (*API) DeleteLeaderElection

func (a *API) DeleteLeaderElection(c *gin.Context)

DeleteLeaderElection -

func (*API) GetLeaderElection

func (a *API) GetLeaderElection(c *gin.Context)

GetLeaderElection -

func (*API) GetReady

func (a *API) GetReady(c *gin.Context)

GetReady responds to requests with information about the specified cluster's readiness

func (*API) ListCommands

func (a *API) ListCommands(c *gin.Context)

ListCommands Lists the commands for installing nodes in each nodePool

func (*API) PostLeaderElection

func (a *API) PostLeaderElection(c *gin.Context)

PostLeaderElection handles leader applications

func (*API) PostReady

func (a *API) PostReady(c *gin.Context)

func (*API) RegisterRoutes

func (a *API) RegisterRoutes(r gin.IRouter)

type LeaderInfo

type LeaderInfo struct {
	Hostname string
	IP       string
}

type LeaderRepository

type LeaderRepository interface {
	GetLeader(organizationID, clusterID uint) (LeaderInfo, error)
	SetLeader(organizationID, clusterID uint, leaderInfo LeaderInfo) error
	DeleteLeader(organizationID, clusterID uint) error
}

type ReadyRequest

type ReadyRequest struct {
	Config   string `json:"config,omitempty"` // kubeconfig in base64 or empty if not a master
	Name     string `json:"name,required"`    // name of node
	NodePool string `json:"nodePool"`         // name of nodepool the new node belongs to
	IP       string `json:"ip,omitempty"`     // ip address of node (where the other nodes can reach it)
	Master   bool
	Worker   bool
}

type TokenGenerator

type TokenGenerator interface {
	GenerateClusterToken(orgID uint, clusterID uint) (string, string, error)
}

type VaultLeaderRepository

type VaultLeaderRepository struct {
	// contains filtered or unexported fields
}

VaultLeaderRepository implements a LeaderRepository over Vault secret store

func NewVaultLeaderRepository

func NewVaultLeaderRepository() (VaultLeaderRepository, error)

NewVaultLeaderRepository returns a new VaultLeaderRepository

func NewVaultLeaderRepositoryFromClient

func NewVaultLeaderRepositoryFromClient(client *vault.Client) VaultLeaderRepository

NewVaultLeaderRepositoryFromClient returns a new VaultLeaderRepository

func (VaultLeaderRepository) DeleteLeader

func (r VaultLeaderRepository) DeleteLeader(organizationID, clusterID uint) error

func (VaultLeaderRepository) GetLeader

func (r VaultLeaderRepository) GetLeader(organizationID, clusterID uint) (leaderInfo LeaderInfo, err error)

GetLeader returns information about the leader of the specified cluster

func (VaultLeaderRepository) SetLeader

func (r VaultLeaderRepository) SetLeader(organizationID, clusterID uint, leaderInfo LeaderInfo) error

SetLeader writes the given leader info for the specified cluster to the repository if it's not set yet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL