component

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EtcdCaCrt              = "ca.crt"
	EtcdCaKey              = "ca.key"
	SnapshotFilenameBucket = "snapshot.db"
)
View Source
const (
	MasterSaKey     = "sa.key"
	MasterSaPub     = "sa.pub"
	MasterFProxyCrt = "front-proxy-ca.crt"
	MasterFProxyKey = "front-proxy-ca.key"
	MasterCaKey     = "ca.key"
	MasterCaCrt     = "ca.crt"
)
View Source
const (
	JoinFile                 string        = "join.sh"
	BucketPath               string        = "join"
	LocalJoinFilePath        string        = "."
	DefaultJointTimeoutValue time.Duration = 30
)
View Source
const (
	OpenVPNServerCert = "server.crt"
	OpenVPNServerKey  = "server.key"
	OpenVPNCaCert     = "ca.crt"
	OpenVPNCaKey      = "ca.key"
	OpenVPNTaKey      = "ta.key"
	OpenVPNPath       = "pki/vpn"
)
View Source
const (
	OpenVPNClientCert   = "client.crt"
	OpenVPNClientKey    = "client.key"
	OpenVPNClientCaCert = "ca.crt"
	OpenVPNClientCaKey  = "ca.key"
	OpenVPNClinetTaKey  = "ta.key"
)
View Source
const (
	SSHUserSpecs                  = "ssh-users.yml"
	SSHBucketDir                  = "ssh"
	SSHAuthorizedKeysFileName     = "authorized_keys"
	SSHAuthorizedKeysTempFileName = "authorized_keys_tmp"
	SSHSudoerDir                  = "/etc/sudoers.d"
)

Variables

View Source
var (
	CertConfig = certutil.Config{
		CommonName:   "SIGHUP s.r.l. Server",
		Organization: []string{"SIGHUP s.r.l."},
		AltNames:     certutil.AltNames{DNSNames: []string{}, IPs: []net.IP{}},
		Usages:       []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
	}
)

Functions

func GetUidGid added in v0.0.9

func GetUidGid(username string) (uid, gid int)

Types

type BackoffNode added in v0.0.8

type BackoffNode struct {
	Node
	OverWrite bool
}

type BackupConfig

type BackupConfig struct {
	BackupFrequency string `mapstructure:"backupFrequency"`
	BackupRetention string `mapstructure:"backupRetention"`
}

BackupConfig are used to generalyze backuconfiguration

type ClusterComponent

type ClusterComponent interface {
	Backup() error
	Restore() error
	Configure(bool) error
	Init(string) error
}

ClusterComponent interface represent the basic concept of the component: etcd, master, node

type ClusterComponentData

type ClusterComponentData struct {
	*ClusterConfig
	*storage.Data
}

type ClusterConfig

type ClusterConfig struct {
	NodeName      string              `mapstructure:"nodeName"`
	Etcd          EtcdConfig          `mapstructure:"etcd"`
	Master        MasterConfig        `mapstructure:"master"`
	Node          NodeConfig          `mapstructure:"node"`
	OpenVPN       OpenVPNConfig       `mapstructure:"openvpn"`
	OpenVPNClient OpenVPNClientConfig `mapstructure:"openvpn-client"`
	SSH           SSHConfig           `mapstructure:"sshkeys"`
}

ClusterConfig represents the configuration for the whole cluster

type Etcd

type Etcd struct {
	ClusterComponentData
}

Etcd implements the ClusterComponent Interface

func (Etcd) Backup

func (e Etcd) Backup() error

Backup implements

func (Etcd) Configure

func (e Etcd) Configure(overwrite bool) error

func (Etcd) Init

func (e Etcd) Init(dir string) error

func (Etcd) Restore

func (e Etcd) Restore() error

Restore implements

type EtcdConfig

type EtcdConfig struct {
	DataDir             string `mapstructure:"dataDir"`
	CertDir             string `mapstructure:"certDir"`
	CaCertFilename      string `mapstructure:"caCertFilename"`
	CaKeyFilename       string `mapstructure:"caKeyFilename"`
	ClientCertFilename  string `mapstructure:"clientCertFilename"`
	InitialClusterToken string `mapstructure:"initialClusterToken"`
	SnapshotFile        string `mapstructure:"snapshotFile"`
	ClientKeyFilename   string `mapstructure:"clientKeyFilename"`
	Endpoint            string `mapstructure:"endpoint"`
	BackupConfig
}

EtcdConfig is used to backup/restore/configure etcd nodes

type HTTPAdapterSet added in v0.0.9

type HTTPAdapterSet struct {
	Name string
	Uri  string
}

type Master

type Master struct {
	ClusterComponentData
}

Master implements the ClusterComponent interface

func (Master) Backup

func (m Master) Backup() error

Backup implements

func (Master) Configure

func (m Master) Configure(overwrite bool) error

Configure implements

func (Master) Init

func (m Master) Init(dir string) error

func (Master) Restore

func (m Master) Restore() error

Restore implements

type MasterConfig

type MasterConfig struct {
	CertDir          string `mapstructure:"certDir"`
	CaCertFile       string `mapstructure:"caCertFilename"`
	CaKeyFile        string `mapstructure:"caKeyFilename"`
	SaPubFile        string `mapstructure:"saPubFilename"`
	SaKeyFile        string `mapstructure:"saKeyFilename"`
	ProxyCaCertFile  string `mapstructure:"proxyCaCertFilename"`
	ProxyKeyCertFile string `mapstructure:"proxyKeyCertFilename"`
	BackupConfig
}

MasterConfig is used to backup/restore/configure master nodes

type Node

type Node struct {
	ClusterComponentData
}

Node represent the object that reflects what nodes need (implements ClusterComponent)

func (Node) Backup

func (n Node) Backup() error

Backup of a node is Empty

func (Node) Configure

func (n Node) Configure(overwrite bool) error

Configure basically joins the nodes to the cluster

func (Node) Init added in v0.0.8

func (n Node) Init(s string) error

Init is for interface compliance, now is empty

func (Node) Restore

func (n Node) Restore() error

Restore of a node is Empty

type NodeConfig

type NodeConfig struct {
	CloudProvider string `mapstructure:"caKeyFilename"`
	// contains filtered or unexported fields
}

NodeConfig is used to backup/restore/configure worker nodes (backup and restore have an empty implementation right now)

type OpenVPN

type OpenVPN struct {
	ClusterComponentData
}

func (OpenVPN) Backup

func (o OpenVPN) Backup() error

func (OpenVPN) Configure

func (o OpenVPN) Configure(overwrite bool) error

func (OpenVPN) Init

func (o OpenVPN) Init(dir string) error

func (OpenVPN) Restore

func (o OpenVPN) Restore() error

type OpenVPNClient

type OpenVPNClient struct {
	ClusterComponentData
}

func (OpenVPNClient) Backup

func (o OpenVPNClient) Backup() error

func (OpenVPNClient) Configure

func (o OpenVPNClient) Configure(overwrite bool) error

func (OpenVPNClient) Init

func (o OpenVPNClient) Init(dir string) error

func (OpenVPNClient) Restore

func (o OpenVPNClient) Restore() error

type OpenVPNClientConfig

type OpenVPNClientConfig struct {
	TargetDir string   `mapstructure:"targetDir"`
	Users     []string `mapstructure:"users"`
}

type OpenVPNConfig

type OpenVPNConfig struct {
	CertDir string `mapstructure:"certDir"`
}

type SSHComponent added in v0.0.9

type SSHComponent struct {
	ClusterComponentData
}

func (SSHComponent) Backup added in v0.0.9

func (o SSHComponent) Backup() error

Backup is a nil function to match the interface

func (SSHComponent) Configure added in v0.0.9

func (o SSHComponent) Configure(overwrite bool) error

Configure setup for each file entry the github configured ssh keys in the authorized_keys file

func (SSHComponent) Init added in v0.0.9

func (o SSHComponent) Init(dir string) error

func (SSHComponent) Restore added in v0.0.9

func (o SSHComponent) Restore() error

Restore is a nil function to match the interface

type SSHConfig added in v0.0.9

type SSHConfig struct {
	User            string         `mapstructure:"user"`
	TempDir         string         `mapstructure:"tempDir"`
	LocalDirConfigs string         `mapstructure:"localDirConfigs"`
	Adapter         HTTPAdapterSet `mapstructure:"adapter"`
}

type SSHUsersFile added in v0.0.9

type SSHUsersFile struct {
	Users []UserSpec `yaml:"users"`
}

type SystemUser added in v0.0.9

type SystemUser struct {
	Name string
	Home string
	Gid  int
	Uid  int
}

type UserSpec added in v0.0.9

type UserSpec struct {
	Name   string `yaml:"name"`
	UserID string `yaml:"user_id"`
}

Jump to

Keyboard shortcuts

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