service

package
v0.0.0-...-3479ee1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterMember

type ClusterMember struct {
	MachineID     string
	ClusterIP     string // IP address of member used for internal cluster traffic (e.g. etcd)
	PrivateHostIP string // IP address of member host (can be same as ClusterIP)
	EtcdProxy     bool
}

type Etcd

type Etcd struct {
	ClusterState  string
	UseVaultCA    bool // If set, use vault to create peer (and optional client) TLS certificates
	SecureClients bool // If set, force clients to connect over TLS
	ClientPort    int
}

ETCD

func (*Etcd) CreateEndpoint

func (flags *Etcd) CreateEndpoint(ip string) string

CreateEndpoint returns the client URL to reach an ETCD server at the given cluster IP.

type Kubernetes

type Kubernetes struct {
	Enabled               bool
	KubernetesMasterImage string
	APIServerPort         int
	ServiceClusterIPRange string
	ClusterDNS            string // IP address of DNS server
	ClusterDomain         string // Name of culster domain
	APIDNSName            string
	Metadata              string
}

K8s config

func (*Kubernetes) IsEnabled

func (flags *Kubernetes) IsEnabled() bool

IsEnabled returns true if kubernetes should be installed on the cluster.

type Service

type Service interface {
	Name() string
	Setup(deps ServiceDependencies, flags *ServiceFlags) error
}

type ServiceDependencies

type ServiceDependencies struct {
	Systemd *systemd.SystemdClient
	Logger  *logging.Logger
}

type ServiceFlags

type ServiceFlags struct {
	Force bool // Start/reload even if nothing has changed

	// gluon
	GluonImage       string
	VaultMonkeyImage string
	Roles            []string

	// Docker
	Docker struct {
		DockerIP                string
		DockerSubnet            string
		PrivateRegistryUrl      string
		PrivateRegistryUserName string
		PrivateRegistryPassword string
	}

	// Rkt
	Rkt struct {
		RktSubnet string
	}

	// Network
	Network struct {
		PrivateClusterDevice string
		ClusterSubnet        string // 'a.b.c.d/x'
		ClusterIP            string // IP address of member used for internal cluster traffic (e.g. etcd)
	}

	// ETCD
	Etcd Etcd

	// Kubernetes config
	Kubernetes Kubernetes

	// Vault config
	Vault Vault

	// Weave
	Weave Weave
	// contains filtered or unexported fields
}

func (*ServiceFlags) GetClusterMembers

func (flags *ServiceFlags) GetClusterMembers(log *logging.Logger) ([]ClusterMember, error)

GetClusterMembers returns a list of the private IP addresses of all the cluster members

func (*ServiceFlags) HasRole

func (flags *ServiceFlags) HasRole(role string) bool

HasRole returns true if the given role is found in flags.Roles.

func (*ServiceFlags) PrivateHostIP

func (flags *ServiceFlags) PrivateHostIP(log *logging.Logger) (string, error)

PrivateHostIP returns the private IPv4 address of the host.

func (*ServiceFlags) ReadClusterID

func (flags *ServiceFlags) ReadClusterID() (string, error)

ReadClusterID reads the cluster ID from /etc/pulcy/cluster-id

func (*ServiceFlags) Save

func (flags *ServiceFlags) Save(log *logging.Logger) (bool, error)

Save applicable flags to their respective files Returns true if anything has changed, false otherwise

func (*ServiceFlags) SetupDefaults

func (flags *ServiceFlags) SetupDefaults(log *logging.Logger) error

SetupDefaults fills given flags with default value

type Vault

type Vault struct {
	VaultImage string
}

Vault config

type Weave

type Weave struct {
	Seed       string
	Hostname   string // Weave DNS of exposed host
	IPRange    string // Value to `--ipalloc-range` (e.g. 10.32.0.0/16)
	IPInit     string // Value for `--ipalloc-init` (default empty)
	RktSubnet  string // Subnet used by rkt (e.g. 10.22.0.0/16)
	RktGateway string // Gateway used by rkt (e.g. 10.22.0.1)
}

Weave config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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