nodeup

package
v0.0.0-...-d54b621 Latest Latest
Warning

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

Go to latest
Published: May 13, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

README

NodeUp Tasks

Within a model, we recognize a few well-known task names:

  • files
  • packages
  • services
  • options

When a directory is found with one of these well-known names, the items in the subtree build tasks of the corresponding types.

(TODO: Should we just prefer extensions everywhere?)

Directories which start with an underscore are tags: we only descend into those directories if the relevant tag is present.

All other directory names can be used for organization.

Alongside each task file, a file with the same name with a .meta extension will be recognized as well. It contains additional JSON options to parameterize the task. This is useful for files or templates, which otherwise have no place to put metadata.

files

The contents of the filesystem tree will be created, mirroring what exists under the files directory.

Directories will be created as needed. Created directories will be set to mode 0755.

Files will be created 0644 (change with meta 'fileMode')

Owner & group will be root:root

Two special extensions are recognized:

  • .asset will be sourced from assets. Assets are binaries that are made available to the installer, e.g. from a .tar.gz distributino
  • .template is a go template

packages

Any files found will be considered packages.

The name of the file will be the package to be installed.

services

Any files found will be considered services.

The name of the file will be the service to be managed.

By default, the service will be restarted and set to auto-start on boot.

Order of operations

Logically, all operations are collected before any are performed, according to the tags.

Then operations are performed in the following order:

options packages files sysctls services

Ties are broken as follows

  • A task that required more tags is run after a task that required fewer tags
  • Sorted by name
  • Custom packages (install a deb) are run after OS provided packages

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServerConfig

type APIServerConfig struct {
	CloudProvider string `flag:"cloud-provider"`

	SecurePort           int    `flag:"secure-port"`
	Address              string `flag:"address"`
	EtcdServers          string `flag:"etcd-servers"`
	EtcdServersOverrides string `flag:"etcd-servers-overrides"`
	// TODO: []string and join with commas?
	AdmissionControl      string `flag:"admission-control"`
	ServiceClusterIPRange string `flag:"service-cluster-ip-range"`
	ClientCAFile          string `flag:"client-ca-file"`
	BasicAuthFile         string `flag:"basic-auth-file"`
	TLSCertFile           string `flag:"tls-cert-file"`
	TLSPrivateKeyFile     string `flag:"tls-private-key-file"`
	TokenAuthFile         string `flag:"token-auth-file"`
	// TODO: Name verbosity or LogLevel
	LogLevel        int   `flag:"v"`
	AllowPrivileged *bool `flag:"allow-privileged"`

	PathSrvKubernetes string
	PathSrvSshproxy   string
	Image             string

	Certificate *fi.Certificate `flag:"-"`
	Key         *fi.PrivateKey  `flag:"-"`
}

type DNSConfig

type DNSConfig struct {
	Replicas int
	Domain   string
	ServerIP string
}

type DockerConfig

type DockerConfig struct {
	Bridge   string `flag:"bridge"`
	LogLevel string `flag:"log-level"`
	IPTables bool   `flag:"iptables"`
	IPMasq   bool   `flag:"ip-masq"`
	Storage  string `flag:"s"`
}

type KubeControllerManagerConfig

type KubeControllerManagerConfig struct {
	CloudProvider string `flag:"cloud-provider"`

	Master            string `flag:"master"`
	ClusterName       string `flag:"cluster-name"`
	ClusterCIDR       string `flag:"cluster-cidr"`
	AllocateNodeCIDRs *bool  `flag:"allocate-node-cidrs"`
	// TODO: Name verbosity or LogLevel
	LogLevel int `flag:"v"`

	ServiceAccountPrivateKeyFile string `flag:"service-account-private-key-file"`
	RootCAFile                   string `flag:"root-ca-file"`

	Image string

	PathSrvKubernetes string
}

type KubeProxyConfig

type KubeProxyConfig struct {
	Master string `flag:"master"`
	// TODO: Name verbosity or LogLevel
	LogLevel int `flag:"v"`

	// TODO: Better type ?
	CPURequest string // e.g. "20m"

	Image string
}

type KubeSchedulerConfig

type KubeSchedulerConfig struct {
	Image string
}

type KubeletConfig

type KubeletConfig struct {
	CloudProvider string `flag:"cloud-provider"`

	NonMasqueradeCdir string `flag:"non-masquerade-cidr"`
	APIServers        string `flag:"api-servers"`

	CgroupRoot     string `flag:"cgroup-root"`
	SystemCgroups  string `flag:"system-cgroups"`
	RuntimeCgroups string `flag:"runtime-cgroups"`
	KubeletCgroups string `flag:"kubelet-cgroups"`

	HairpinMode string `flag:"hairpin-mode"`

	EnableDebuggingHandlers *bool  `flag:"enable-debugging-handlers"`
	Config                  string `flag:"config"`
	AllowPrivileged         *bool  `flag:"allow-privileged"`
	Verbosity               *int   `flag:"v"`
	ClusterDNS              string `flag:"cluster-dns"`
	ClusterDomain           string `flag:"cluster-domain"`
	ConfigureCBR0           *bool  `flag:"configure-cbr0"`
	BabysitDaemons          *bool  `flag:"babysit-daemons"`

	RegisterSchedulable *bool  `flag:"register-schedulable"`
	ReconcileCIDR       *bool  `flag:"reconcile-cidr"`
	PodCIDR             string `flag:"pod-cidr"`

	Certificate *fi.Certificate `flag:"-"`
	Key         *fi.PrivateKey  `flag:"-"`
	// Allow override of CA Certificate
	CACertificate *fi.Certificate `flag:"-"`
}

type Loader

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

func NewLoader

func NewLoader(config *NodeConfig, assets *fi.AssetStore) *Loader

func (*Loader) Build

func (l *Loader) Build(baseDir string) (map[string]fi.Task, error)

type NodeConfig

type NodeConfig struct {
	Kubelet               KubeletConfig
	KubeProxy             KubeProxyConfig
	KubeControllerManager KubeControllerManagerConfig
	KubeScheduler         KubeSchedulerConfig
	Docker                DockerConfig
	APIServer             APIServerConfig
	CACertificate         *fi.Certificate

	DNS DNSConfig

	KubeUser     string
	KubePassword string

	Tokens map[string]string

	Tags   []string
	Assets []string
}

TODO: Can we replace some of all of this with pkg/apis/componentconfig/types.go ?

func (*NodeConfig) GetToken

func (n *NodeConfig) GetToken(key string) string

A helper so that templates can get tokens which are not valid identifiers

type NodeUpCommand

type NodeUpCommand struct {
	Config         *NodeConfig
	ConfigLocation string
	ModelDir       string
	AssetDir       string
	Target         string
}

func (*NodeUpCommand) Run

func (c *NodeUpCommand) Run(out io.Writer) error

type TaskBuilder

type TaskBuilder func(name string, contents string, meta string) (fi.Task, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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