provisioner

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTarGzArchive

func CreateTarGzArchive(archive RemoteFileSpec, bundle []RemoteFileSpec, loader *RemoteFileLoader) error

Types

type Content

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

func NewBinaryContent

func NewBinaryContent(bytes []byte) Content

func NewStringContent

func NewStringContent(str string) Content

func (Content) GzippedBase64Content

func (c Content) GzippedBase64Content() string

func (Content) MarshalYAML

func (c Content) MarshalYAML() (interface{}, error)

func (Content) String

func (c Content) String() string

func (Content) ToBase64

func (c Content) ToBase64() Content

func (Content) ToGzip

func (c Content) ToGzip() Content

func (*Content) UnmarshalYAML

func (c *Content) UnmarshalYAML(unmarshal func(interface{}) error) error

type Provisioner

type Provisioner struct {
	// Name is the name of the provisioner
	Name string `yaml:"name"`

	// EntrypointLocalPath is an executable file that is executed on the node after the bundle is transferred.
	// EntrypointLocalPath can either be one of bundled files that are transferred, or an already existing file on the remote node.
	EntrypointLocalPath string `yaml:"entrypoint"`

	// Bundle is the bundle the provisioner uses to provision nodes
	Bundle []RemoteFileSpec `yaml:"bundle,inline"`

	S3DirURI      string
	LocalCacheDir string
}

func NewTarballingProvisioner

func NewTarballingProvisioner(name string, bundle []RemoteFileSpec, entrypointLocalFilePath, s3DirURI string, pkgCacheDir string) *Provisioner

func (*Provisioner) CreateTransferredFile

func (p *Provisioner) CreateTransferredFile(loader *RemoteFileLoader) (*TransferredFile, error)

func (*Provisioner) EntrypointRemotePath

func (p *Provisioner) EntrypointRemotePath() string

func (*Provisioner) GetTransferredFile

func (p *Provisioner) GetTransferredFile() TransferredFile

func (*Provisioner) RemoteCommand

func (p *Provisioner) RemoteCommand() (string, error)

func (*Provisioner) Send

func (p *Provisioner) Send(s3Client S3ObjectPutter) error

type RemoteFile

type RemoteFile struct {
	Path string `yaml:"path"`

	// Content is the content of this file
	// Either Content or Source can be specified
	Content Content `yaml:"content,omitempty"`

	// Permissions is the desired file mode of the file at `Path`, that looks like 0755
	//
	// kube-aws runs chmod on the file towards the desired file mode.
	//
	// This is optional. When omitted, kube-aws doesn't run chmod
	Permissions uint `yaml:"permissions"`

	// Type, when specified to binary, omits diff for this file
	Type string `yaml:"type"`

	// Encrypted should be set to true when the content is encrypted with AWS KMS
	Encrypted bool `yaml:"encrypted"`
}

RemoteFile is an instantiation of RemoteFileSpec

func NewRemoteFile

func NewRemoteFile(spec RemoteFileSpec) *RemoteFile

func NewRemoteFileAtPath

func NewRemoteFileAtPath(path string, content []byte) *RemoteFile

func NewRemoteFileWithContent

func NewRemoteFileWithContent(spec RemoteFileSpec, content []byte) *RemoteFile

func (RemoteFile) GzippedBase64Content

func (c RemoteFile) GzippedBase64Content() string

func (RemoteFile) PermissionsString

func (c RemoteFile) PermissionsString() string

func (RemoteFile) RenderContent

func (c RemoteFile) RenderContent(ctx interface{}) (string, error)

func (RemoteFile) RenderGzippedBase64Content

func (c RemoteFile) RenderGzippedBase64Content(ctx interface{}) (string, error)

type RemoteFileLoader

type RemoteFileLoader struct {
}

func (*RemoteFileLoader) Load

func (loader *RemoteFileLoader) Load(f RemoteFileSpec) (*RemoteFile, error)

type RemoteFileSpec

type RemoteFileSpec struct {
	Path string `yaml:"path"`

	// Content is the content of this file
	// Either Content or Source can be specified
	Content Content `yaml:"content,omitempty"`

	// Template is the template for the content of this file
	// that exists for backward-compatibility with CustomFile
	Template string `yaml:"template,omitempty"`

	// Permissions is the desired file mode of the file at `Path`, that looks like 0755
	//
	// kube-aws runs chmod on the file towards the desired file mode.
	//
	// This is optional. When omitted, kube-aws doesn't run chmod
	Permissions uint `yaml:"permissions"`

	// Source specifies how and from where the content of this file is loaded
	// Either Content or Source can be specified
	Source `yaml:"source"`

	// Type, when specified to binary, omits diff for this file
	Type string `yaml:"type"`

	// CachePath specifies where this file should be cached locally
	CachePath string
}

RemoteFileSpec represents a file that is restored on remote nodes

func (RemoteFileSpec) BaseName

func (f RemoteFileSpec) BaseName() string

func (RemoteFileSpec) FileMode

func (f RemoteFileSpec) FileMode() *os.FileMode

func (RemoteFileSpec) IsBinary

func (f RemoteFileSpec) IsBinary() bool

func (RemoteFileSpec) Load

func (f RemoteFileSpec) Load(loader *RemoteFileLoader) (*RemoteFile, error)

type S3ObjectPutter

type S3ObjectPutter interface {
	PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error)
}

type Source

type Source struct {
	// Path is from where kube-aws loads the content of this `RemoteFileSpec`.
	Path string `yaml:"path"`

	// URL, when specified, instruct kube-aws to download the resource into `Path`.
	URL string `yaml:"url"`

	// Cert is the name of the keypair from which load the x509 cert
	Cert string `yaml:"cert"`

	// Cert is the name of the keypair from which load the x509 key
	Key string `yaml:"key"`
}

type TarGzArchiver

type TarGzArchiver struct {
	File RemoteFileSpec `yaml:",inline"`
	// Bundle is a set of files necessary for node provisioning, that is composed of multiple source files
	Bundle []RemoteFileSpec `yaml:"files"`
}

TarGzArchiver is a archived bundle. TarGzArchiver is created, transferred, and then extracted to the etcd, controller and worker nodes to provide necessary files for node provisioning.

func (TarGzArchiver) Name

func (p TarGzArchiver) Name() string

type TransferredFile

type TransferredFile struct {
	RemoteFileSpec
	// contains filtered or unexported fields
}

func (TransferredFile) ReceiveCommand

func (t TransferredFile) ReceiveCommand() string

func (TransferredFile) S3URI

func (t TransferredFile) S3URI() string

func (TransferredFile) Send

func (t TransferredFile) Send(client S3ObjectPutter) error

Jump to

Keyboard shortcuts

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