Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetValueFromConfig ¶
GetValueFromConfig returns specific value from object given a string path
Types ¶
type Cluster ¶
type Cluster struct { // Name is the cluster name. Defaults to "cluster". Name string `json:"name"` // PrivateKey is the path to the private SSH key used to login into the cluster // machines. Can be expanded to user homedir if ~ is found. Ex. ~/.ssh/id_rsa. // // This field is optional. If absent, machines are expected to have a public // key defined. PrivateKey string `json:"privateKey,omitempty"` }
Cluster is a set of Machines.
type Config ¶
type Config struct { // Cluster describes cluster-wide configuration. Cluster Cluster `json:"cluster"` // Machines describe the machines we want created for this cluster. Machines []MachineReplicas `json:"machines"` }
Config is the top level config object.
func DefaultConfig ¶
func DefaultConfig() Config
func NewConfigFromFile ¶
func NewConfigFromYAML ¶
type Machine ¶
type Machine struct { // Name is the machine name. // // When used in a MachineReplicas object, eg. in bootloose.yaml config files, // this field a format string. This format string needs to have a '%d', which // is populated by the machine index, a number between 0 and N-1, N being the // Count field of MachineReplicas. Name will default to "node%d" // // This name will also be used as the machine hostname. Name string `json:"name"` // Image is the container image to use for this machine. Image string `json:"image"` // Privileged controls whether to start the Machine as a privileged container // or not. Defaults to false. Privileged bool `json:"privileged,omitempty"` // Volumes is the list of volumes attached to this machine. Volumes []Volume `json:"volumes,omitempty"` // Networks is the list of user-defined docker networks this machine is // attached to. These networks have to be created manually before creating the // containers via "docker network create mynetwork" Networks []string `json:"networks,omitempty"` // PortMappings is the list of ports to expose to the host. PortMappings []PortMapping `json:"portMappings,omitempty"` // Cmd is a cmd which will be run in the container. Cmd string `json:"cmd,omitempty"` // PublicKey is the name of the public key to upload onto the machine for root // SSH access. PublicKey string `json:"publicKey,omitempty"` }
Machine is the machine configuration.
type MachineReplicas ¶
MachineReplicas are a number of machine following the same specification.
type PortMapping ¶
type PortMapping struct { // Protocol is the layer 4 protocol for this mapping. One of "tcp" or "udp". // Defaults to "tcp". Protocol string `json:"protocol,omitempty"` // Address is the host address to bind to. Defaults to "0.0.0.0". Address string `json:"address,omitempty"` // HostPort is the base host port to map the containers ports to. As we // configure a number of machine replicas, each machine will use HostPort+i // where i is between 0 and N-1, N being the number of machine replicas. If 0, // a local port will be automatically allocated. HostPort uint16 `json:"hostPort,omitempty"` // ContainerPort is the container port to map. ContainerPort uint16 `json:"containerPort"` }
PortMapping describes mapping a port from the machine onto the host.
type PublicKey ¶
type PublicKey struct { Name string `json:"name"` // Key is the public key textual representation. Begins with Begins with // 'ssh-rsa', 'ssh-dss', 'ssh-ed25519', 'ecdsa-sha2-nistp256', // 'ecdsa-sha2-nistp384', or 'ecdsa-sha2-nistp521'. Key string `json:"key"` }
PublicKey is a public SSH key.
type Volume ¶
type Volume struct { // Type is the volume type. One of "bind" or "volume". Type string `json:"type"` // Source is the volume source. // With type=bind, the volume source is a directory or a file in the host // filesystem. // With type=volume, source is either the name of a docker volume or "" for // anonymous volumes. Source string `json:"source"` // Destination is the mount point inside the container. Destination string `json:"destination"` // ReadOnly specifies if the volume should be read-only or not. ReadOnly bool `json:"readOnly"` }
Volume is a volume that can be attached to a Machine.
Click to show internal directories.
Click to hide internal directories.