Documentation
¶
Overview ¶
Package userdata renders cloud-init userdata scripts for Podplane VMs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClusterData ¶
type InstanceData ¶
type LocalData ¶
type LocalData struct {
VMForwardPortToLocalServerHTTPS int
LocalServerHostFromVM string
LocalServerHTTPSPort string
}
LocalData contains values only rendered for local VMs.
type Options ¶
type Options struct {
DepsMirrorURL string
ProviderKind string
AWSAccountID string
GoogleProjectID string
ImmutableSSHAuthorizedKeys string
EnableSSM bool
}
Options contains values used to render Podplane userdata.
type ProviderData ¶
type ServerData ¶
type TemplateVars ¶
type TemplateVars struct {
// Manifest is the resolved vmconfig manifest for this VM.
Manifest *deps.Manifest `validate:"required"`
// DepsMirrorURL, when set, overrides all upstream dependency URLs with
// mirror-relative paths (<base>/<name>/<version>/<filename>). Used for
// local development and air-gapped installs.
DepsMirrorURL string `validate:"omitempty,url"`
// The following fields map to the same structure nstance-server uses
// in production for interpolating data into production userdata
Cluster ClusterData
Provider ProviderData
Instance InstanceData
Server ServerData
// ImmutableSSHAuthorizedKeys is written only by user-data and changing it
// changes the Nstance instance configuration hash.
ImmutableSSHAuthorizedKeys string
// EnableSSM controls whether user-data installs and starts AWS SSM Agent.
EnableSSM bool
// AWSAccountID and GoogleProjectID are dedicated fields because they are
// provider inputs, not Nstance mutable env vars.
AWSAccountID string
GoogleProjectID string
// Nonce is a dedicated field because it is Nstance first-boot bootstrap data,
// not a value vmconfig should receive later through mutable.env.
Nonce string
// The following fields are only used for local VMs and is not used
// when rendering user-data for real clusters
Local LocalData
}
TemplateVars are the template variables consumed by user-data.sh.
func (*TemplateVars) ManifestFilter ¶
func (v *TemplateVars) ManifestFilter() deps.ItemFilter
ManifestFilter selects dependencies that apply to this VM's provider.
func (*TemplateVars) Render ¶
func (v *TemplateVars) Render() (string, error)
Render validates the template variables and renders the user-data script.
func (*TemplateVars) Validate ¶
func (v *TemplateVars) Validate() error
Validate checks the TemplateVars are populated correctly enough to render.
Click to show internal directories.
Click to hide internal directories.