Documentation
¶
Overview ¶
Package fleet reconciles admitted Workspace demand with a bounded cloud fleet.
Index ¶
- func AWSFleetIdentityEndpoint(region string) (endpointURL, partition string, err error)
- func EnrollmentBinding(request EnrollmentRequest) string
- func LoadEnrollmentSigner(certificatePEM, keyPEM []byte) (*x509.Certificate, crypto.Signer, error)
- func ValidEnrollmentEndpoint(raw string) bool
- type AWSCloud
- type AWSIdentityVerifier
- type AutoScalingAPI
- type Cloud
- type ControlPlane
- type EC2API
- type EnrollmentAuthority
- type EnrollmentRequest
- type EnrollmentResponse
- type EnrollmentVerifier
- type GatewayIssuer
- type HTTPControlPlane
- func (control HTTPControlPlane) Archive(ctx context.Context, workspace contracts.FleetWorkspace) error
- func (control HTTPControlPlane) Evacuate(ctx context.Context, runner contracts.FleetRunner) error
- func (control HTTPControlPlane) Observe(ctx context.Context) (contracts.FleetPoolObservation, error)
- func (control HTTPControlPlane) Retire(ctx context.Context, runner contracts.FleetRunner) error
- type HTTPGatewayIssuer
- type Manager
- type ManagerConfig
- type Node
- type ReconcileResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AWSFleetIdentityEndpoint ¶
AWSFleetIdentityEndpoint keeps proof signing and verification on the same regional STS endpoint and ARN partition from the SDK's endpoint metadata.
func EnrollmentBinding ¶
func EnrollmentBinding(request EnrollmentRequest) string
func LoadEnrollmentSigner ¶
func ValidEnrollmentEndpoint ¶
Types ¶
type AWSCloud ¶
type AWSCloud struct {
AutoScaling AutoScalingAPI
EC2 EC2API
GroupName string
MaximumNodes int
FleetRef string
Database *pgxpool.Pool
Pool string
}
func (AWSCloud) CleanupRetiredVolumes ¶
type AWSIdentityVerifier ¶
type AWSIdentityVerifier struct {
AccountID string
RoleName string
Region string
Cloud Cloud
Client *http.Client
Now func() time.Time
EnrollmentWindow time.Duration
}
func (AWSIdentityVerifier) Verify ¶
func (verifier AWSIdentityVerifier) Verify(ctx context.Context, enrollment EnrollmentRequest, binding string, existingKeyBound bool) error
existingKeyBound is supplied only after the authority has verified the instance's stored key binding. A request's renewal flag alone grants nothing.
type AutoScalingAPI ¶
type AutoScalingAPI interface {
DescribeAutoScalingGroups(context.Context, *autoscaling.DescribeAutoScalingGroupsInput, ...func(*autoscaling.Options)) (*autoscaling.DescribeAutoScalingGroupsOutput, error)
SetDesiredCapacity(context.Context, *autoscaling.SetDesiredCapacityInput, ...func(*autoscaling.Options)) (*autoscaling.SetDesiredCapacityOutput, error)
TerminateInstanceInAutoScalingGroup(context.Context, *autoscaling.TerminateInstanceInAutoScalingGroupInput, ...func(*autoscaling.Options)) (*autoscaling.TerminateInstanceInAutoScalingGroupOutput, error)
}
type ControlPlane ¶
type ControlPlane interface {
Observe(context.Context) (contracts.FleetPoolObservation, error)
Evacuate(context.Context, contracts.FleetRunner) error
Archive(context.Context, contracts.FleetWorkspace) error
Retire(context.Context, contracts.FleetRunner) error
}
type EC2API ¶
type EC2API interface {
DescribeInstances(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)
DescribeVolumes(context.Context, *ec2.DescribeVolumesInput, ...func(*ec2.Options)) (*ec2.DescribeVolumesOutput, error)
DeleteVolume(context.Context, *ec2.DeleteVolumeInput, ...func(*ec2.Options)) (*ec2.DeleteVolumeOutput, error)
}
type EnrollmentAuthority ¶
type EnrollmentAuthority struct {
Database *pgxpool.Pool
Pool string
Verifier EnrollmentVerifier
Gateway GatewayIssuer
CACertificate *x509.Certificate
CAKey crypto.Signer
CAPEM string
Lifetime time.Duration
RunnerEnvironment string
GatewayEnvironment string
EgressContexts string
RegistryFiles map[string]string
Now func() time.Time
}
func (EnrollmentAuthority) Enroll ¶
func (authority EnrollmentAuthority) Enroll(ctx context.Context, request EnrollmentRequest) (EnrollmentResponse, error)
func (EnrollmentAuthority) ServeHTTP ¶
func (authority EnrollmentAuthority) ServeHTTP(writer http.ResponseWriter, request *http.Request)
type EnrollmentRequest ¶
type EnrollmentResponse ¶
type EnrollmentResponse struct {
RunnerID string `json:"runnerId"`
RunnerCertificate string `json:"runnerCertificatePem"`
RunnerCA string `json:"runnerCertificateAuthorityPem"`
GatewayCertificate string `json:"gatewayCertificatePem"`
GatewayCA string `json:"gatewayCertificateAuthorityPem"`
ExpiresAt time.Time `json:"expiresAt"`
RunnerEnvironment string `json:"runnerEnvironment"`
GatewayEnvironment string `json:"gatewayEnvironment"`
EgressContexts string `json:"egressContexts"`
RegistryFiles map[string]string `json:"registryFiles"`
}
type EnrollmentVerifier ¶
type GatewayIssuer ¶
type HTTPControlPlane ¶
type HTTPControlPlane struct {
BaseURL string
Token string
Pool string
Client *http.Client
Gateway GatewayIssuer
}
func (HTTPControlPlane) Archive ¶
func (control HTTPControlPlane) Archive(ctx context.Context, workspace contracts.FleetWorkspace) error
func (HTTPControlPlane) Evacuate ¶
func (control HTTPControlPlane) Evacuate(ctx context.Context, runner contracts.FleetRunner) error
func (HTTPControlPlane) Observe ¶
func (control HTTPControlPlane) Observe(ctx context.Context) (contracts.FleetPoolObservation, error)
func (HTTPControlPlane) Retire ¶
func (control HTTPControlPlane) Retire(ctx context.Context, runner contracts.FleetRunner) error
type HTTPGatewayIssuer ¶
type Manager ¶
type Manager struct {
Config ManagerConfig
Cloud Cloud
Control ControlPlane
}