Documentation ¶
Index ¶
- Constants
- func NewStatusMetricsCollector(db *sqlx.DB) prometheus.Collector
- type HandleNATSMessageFunc
- type MetadataReader
- type PodStatuses
- type Server
- func (s *Server) CreateVizierCluster(ctx context.Context, req *vzmgrpb.CreateVizierClusterRequest) (*uuidpb.UUID, error)
- func (s *Server) GetOrgFromVizier(ctx context.Context, id *uuidpb.UUID) (*vzmgrpb.GetOrgFromVizierResponse, error)
- func (s *Server) GetVizierConnectionInfo(ctx context.Context, req *uuidpb.UUID) (*cvmsgspb.VizierConnectionInfo, error)
- func (s *Server) GetVizierInfo(ctx context.Context, req *uuidpb.UUID) (*cvmsgspb.VizierInfo, error)
- func (s *Server) GetVizierInfos(ctx context.Context, req *vzmgrpb.GetVizierInfosRequest) (*vzmgrpb.GetVizierInfosResponse, error)
- func (s *Server) GetViziersByOrg(ctx context.Context, orgID *uuidpb.UUID) (*vzmgrpb.GetViziersByOrgResponse, error)
- func (s *Server) GetViziersByShard(ctx context.Context, req *vzmgrpb.GetViziersByShardRequest) (*vzmgrpb.GetViziersByShardResponse, error)
- func (s *Server) HandleVizierHeartbeat(v2cMsg *cvmsgspb.V2CMessage)
- func (s *Server) ProvisionOrClaimVizier(ctx context.Context, orgID uuid.UUID, userID uuid.UUID, clusterUID string, ...) (uuid.UUID, string, error)
- func (s *Server) Stop()
- func (s *Server) UpdateOrInstallVizier(ctx context.Context, req *cvmsgspb.UpdateOrInstallVizierRequest) (*cvmsgspb.UpdateOrInstallVizierResponse, error)
- func (s *Server) UpdateVizierConfig(ctx context.Context, req *cvmsgspb.UpdateVizierConfigRequest) (*cvmsgspb.UpdateVizierConfigResponse, error)
- func (s *Server) VizierConnected(ctx context.Context, req *cvmsgspb.RegisterVizierRequest) (*cvmsgspb.RegisterVizierAck, error)
- type StatusMonitor
- type Updater
- func (u *Updater) AddToUpdateQueue(vizierID uuid.UUID) bool
- func (u *Updater) ProcessUpdateQueue()
- func (u *Updater) Stop()
- func (u *Updater) UpdateOrInstallVizier(vizierID uuid.UUID, version string, redeployEtcd bool) (*cvmsgspb.V2CMessage, error)
- func (u *Updater) VersionUpToDate(version string) bool
- type VizierInfo
- type VizierState
- type VzUpdater
Constants ¶
const DefaultProjectName = "default"
DefaultProjectName is the default project name to use for a vizier cluster that is created if none if provided.
const SaltLength int = 10
SaltLength is the length of the salt used when encrypting the jwt signing key.
Variables ¶
This section is empty.
Functions ¶
func NewStatusMetricsCollector ¶
func NewStatusMetricsCollector(db *sqlx.DB) prometheus.Collector
NewStatusMetricsCollector creats a new vizier status metrics prometheus collector.
Types ¶
type HandleNATSMessageFunc ¶
type HandleNATSMessageFunc func(*cvmsgspb.V2CMessage)
HandleNATSMessageFunc is the signature for a NATS message handler.
type MetadataReader ¶
type MetadataReader struct {
// contains filtered or unexported fields
}
MetadataReader reads updates from the NATS durable queue and sends updates to the indexer.
func NewMetadataReader ¶
NewMetadataReader creates a new MetadataReader.
func (*MetadataReader) Stop ¶
func (m *MetadataReader) Stop()
Stop shuts down the metadata reader and all relevant goroutines.
type PodStatuses ¶
PodStatuses Type to use in sqlx for the map of pod statuses.
func (*PodStatuses) Scan ¶
func (p *PodStatuses) Scan(src interface{}) error
Scan Scans the sqlx database type ([]bytes) into the PodStatuses type.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a bridge implementation of evzmgr.
func (*Server) CreateVizierCluster ¶
func (s *Server) CreateVizierCluster(ctx context.Context, req *vzmgrpb.CreateVizierClusterRequest) (*uuidpb.UUID, error)
CreateVizierCluster creates a new tracked vizier cluster.
func (*Server) GetOrgFromVizier ¶
func (s *Server) GetOrgFromVizier(ctx context.Context, id *uuidpb.UUID) (*vzmgrpb.GetOrgFromVizierResponse, error)
GetOrgFromVizier fetches the org to which a Vizier belongs. This is intended to be for internal use only.
func (*Server) GetVizierConnectionInfo ¶
func (s *Server) GetVizierConnectionInfo(ctx context.Context, req *uuidpb.UUID) (*cvmsgspb.VizierConnectionInfo, error)
GetVizierConnectionInfo gets a viziers connection info,
func (*Server) GetVizierInfo ¶
GetVizierInfo returns info for the specified Vizier.
func (*Server) GetVizierInfos ¶
func (s *Server) GetVizierInfos(ctx context.Context, req *vzmgrpb.GetVizierInfosRequest) (*vzmgrpb.GetVizierInfosResponse, error)
GetVizierInfos gets the vizier info for multiple viziers.
func (*Server) GetViziersByOrg ¶
func (s *Server) GetViziersByOrg(ctx context.Context, orgID *uuidpb.UUID) (*vzmgrpb.GetViziersByOrgResponse, error)
GetViziersByOrg gets a list of viziers by organization.
func (*Server) GetViziersByShard ¶
func (s *Server) GetViziersByShard(ctx context.Context, req *vzmgrpb.GetViziersByShardRequest) (*vzmgrpb.GetViziersByShardResponse, error)
GetViziersByShard returns the list of connected Viziers for a given shardID.
func (*Server) HandleVizierHeartbeat ¶
func (s *Server) HandleVizierHeartbeat(v2cMsg *cvmsgspb.V2CMessage)
HandleVizierHeartbeat handles the heartbeat from connected viziers.
func (*Server) ProvisionOrClaimVizier ¶
func (s *Server) ProvisionOrClaimVizier(ctx context.Context, orgID uuid.UUID, userID uuid.UUID, clusterUID string, clusterName string) (uuid.UUID, string, error)
ProvisionOrClaimVizier provisions a given cluster or returns the ID if it already exists,
func (*Server) UpdateOrInstallVizier ¶
func (s *Server) UpdateOrInstallVizier(ctx context.Context, req *cvmsgspb.UpdateOrInstallVizierRequest) (*cvmsgspb.UpdateOrInstallVizierResponse, error)
UpdateOrInstallVizier updates or installs the given vizier cluster to the specified version.
func (*Server) UpdateVizierConfig ¶
func (s *Server) UpdateVizierConfig(ctx context.Context, req *cvmsgspb.UpdateVizierConfigRequest) (*cvmsgspb.UpdateVizierConfigResponse, error)
UpdateVizierConfig supports updating of the Vizier config.
func (*Server) VizierConnected ¶
func (s *Server) VizierConnected(ctx context.Context, req *cvmsgspb.RegisterVizierRequest) (*cvmsgspb.RegisterVizierAck, error)
VizierConnected is an the request made to the mgr to handle new Vizier connections.
type StatusMonitor ¶
type StatusMonitor struct {
// contains filtered or unexported fields
}
StatusMonitor is responsible for maintaining status information of vizier clusters. It has a routine that is periodically invoked.
func NewStatusMonitor ¶
func NewStatusMonitor(db *sqlx.DB) *StatusMonitor
NewStatusMonitor creates a new StatusMonitor operating on the passed in DB and starts it.
func (*StatusMonitor) UpdateDBEntries ¶
func (s *StatusMonitor) UpdateDBEntries()
UpdateDBEntries updates the database status.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater is responsible for tracking and updating Viziers.
func NewUpdater ¶
func NewUpdater(db *sqlx.DB, atClient artifacttrackerpb.ArtifactTrackerClient, nc *nats.Conn) (*Updater, error)
NewUpdater creates a new Vizier updater.
func (*Updater) AddToUpdateQueue ¶
AddToUpdateQueue queues the given Vizier for an update to the latest version.
func (*Updater) ProcessUpdateQueue ¶
func (u *Updater) ProcessUpdateQueue()
ProcessUpdateQueue updates the Viziers in the update queue.
func (*Updater) UpdateOrInstallVizier ¶
func (u *Updater) UpdateOrInstallVizier(vizierID uuid.UUID, version string, redeployEtcd bool) (*cvmsgspb.V2CMessage, error)
UpdateOrInstallVizier immediately updates or installs the Vizier instance. This should be used in cases where the user is bootstrapping Vizier for the first time, or has manually sent an update request.
func (*Updater) VersionUpToDate ¶
VersionUpToDate checks if the given version string is up to date with the current vizier version.
type VizierInfo ¶
type VizierInfo struct { ID uuid.UUID `db:"vizier_cluster_id"` Status vizierStatus `db:"status"` LastHeartbeat *int64 `db:"last_heartbeat"` ClusterUID *string `db:"cluster_uid"` ClusterName *string `db:"cluster_name"` ClusterVersion *string `db:"cluster_version"` OperatorVersion *string `db:"operator_version"` VizierVersion *string `db:"vizier_version"` StatusMessage *string `db:"status_message"` ControlPlanePodStatuses PodStatuses `db:"control_plane_pod_statuses"` UnhealthyDataPlanePodStatuses PodStatuses `db:"unhealthy_data_plane_pod_statuses"` NumNodes int32 `db:"num_nodes"` NumInstrumentedNodes int32 `db:"num_instrumented_nodes"` OrgID uuid.UUID `db:"org_id"` PrevStatus *vizierStatus `db:"prev_status"` PrevStatusTime *time.Time `db:"prev_status_time"` }
VizierInfo represents all info we want to fetch about a Vizier.
type VizierState ¶
type VizierState struct {
// contains filtered or unexported fields
}
VizierState contains all state necessary to process metadata updates for the given vizier.
type VzUpdater ¶
type VzUpdater interface { UpdateOrInstallVizier(vizierID uuid.UUID, version string, redeployEtcd bool) (*cvmsgspb.V2CMessage, error) VersionUpToDate(version string) bool // AddToUpdateQueue must be idempotent since we Queue based on heartbeats and reported version. AddToUpdateQueue(vizierID uuid.UUID) bool }
VzUpdater is the interface for the module responsible for updating Vizier.