process

package
v1.2.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PrometheusContainer    = "cloudletPrometheus"
	PrometheusImagePath    = "prom/prometheus"
	PrometheusImageVersion = "v2.19.2"
	PrometheusRulesPrefix  = "rulefile_"
	CloudletPrometheusPort = "9092"
)

Variables

View Source
var DefaultBindAddr = "127.0.0.1:8088"
View Source
var DefaultHttpAddr = "127.0.0.1:8086"

SsetupInflux sets up the InfluxDB dir and config file. The config file name is returned to be used when running InfluxDB. The passed in directory is where all the data and config file will be placed. Note that InfluxDB requires a config file, and does not accept configuration options as command line arguments.

View Source
var EtcdRamDiskSizeVar = "ETCD_RAMDISK_SIZEG"
View Source
var InfluxCredsFile = "/tmp/influx.json"
View Source
var LocalRedisPort = "6379"
View Source
var LocalRedisSentinelPort = "26379"
View Source
var MaxRamDiskSizeG = 3.0
View Source
var RamDisk = "ramdisk"

Functions

func AddHostDockerInternal

func AddHostDockerInternal(args []string) ([]string, error)

OS-specific function to add host.docker.internal mapping if needed, so that process from inside container can reach service running outside container.

func CheckBindOk

func CheckBindOk(portsInUse map[string]string, addrs []string) error

func CleanupEtcdRamDisk

func CleanupEtcdRamDisk() error

This should be called after etcd processes are stopped

func CloudletPrometheusExists

func CloudletPrometheusExists(ctx context.Context) bool

func CrmServiceWait

func CrmServiceWait(key edgeproto.CloudletKey) error

func EnsureProcessesByName

func EnsureProcessesByName(processName string, processArgs string) bool

func GetCRMCmdArgs

func GetCRMCmdArgs(cloudlet *edgeproto.Cloudlet, pfConfig *edgeproto.PlatformConfig, haRole HARole, crmOps ...CrmServiceOp) ([]string, *map[string]string, error)

func GetCloudletLog

func GetCloudletLog(ctx context.Context, key *edgeproto.CloudletKey) (string, error)

Parses cloudlet logfile and fetches FatalLog output

func GetCloudletLogFile

func GetCloudletLogFile(filePrefix string) string

func GetCloudletPrometheusCmdArgs

func GetCloudletPrometheusCmdArgs() []string

command line options for prometheus container

func GetCloudletPrometheusConfigHostFilePath

func GetCloudletPrometheusConfigHostFilePath() string

func GetCloudletPrometheusDockerArgs

func GetCloudletPrometheusDockerArgs(cloudlet *edgeproto.Cloudlet, cfgFile string) []string

base docker run args

func GetCrmAccessKeyFile

func GetCrmAccessKeyFile() string

func GetCrmProc

func GetCrmProc(cloudlet *edgeproto.Cloudlet, pfConfig *edgeproto.PlatformConfig, HARole HARole) (CrmProcess, []StartOp, error)

func GetDummyPrivateKey

func GetDummyPrivateKey() (*os.File, error)

func GetLocalAccessKeyDir

func GetLocalAccessKeyDir() string

func GetLocalAccessKeyFile

func GetLocalAccessKeyFile(filePrefix string, haRole HARole) string

func GetPortsInUse

func GetPortsInUse() (map[string]string, error)

Get ports in use by the OS. Key is port, val is description of process. This pretty much ignores the discrepancy between ipv4 and ipv6, because this is only for local listeners which are all ipv4 right now.

func GetShepherdCmdArgs

func GetShepherdCmdArgs(cloudlet *edgeproto.Cloudlet, pfConfig *edgeproto.PlatformConfig) ([]string, *map[string]string, error)

func GetTypeString

func GetTypeString(p interface{}) string

func KillProcessesByName

func KillProcessesByName(processName string, maxwait time.Duration, processArgs string, c chan string)

first tries to kill process with SIGINT, then waits up to maxwait time for it to die. After that point it kills with SIGKILL

func SetupInflux

func SetupInflux(dir string, ops ...InfluxOp) (string, error)

func SplitAddr

func SplitAddr(addr string) (string, string)

Splits an address into host/ip and port.

func StartCRMService

func StartCRMService(ctx context.Context, cloudlet *edgeproto.Cloudlet, pfConfig *edgeproto.PlatformConfig, haRole HARole, redisCfg *rediscache.RedisConfig, crmOps ...CrmServiceOp) error

func StartCRMServicesHA

func StartCRMServicesHA(ctx context.Context, cloudlet *edgeproto.Cloudlet, pfConfig *edgeproto.PlatformConfig, redisCfg *rediscache.RedisConfig, crmOps ...CrmServiceOp) error

func StartCloudletPrometheus

func StartCloudletPrometheus(ctx context.Context, remoteWriteAddr string, cloudlet *edgeproto.Cloudlet, settings *edgeproto.Settings) error

Starts prometheus container and connects it to the default ports

func StartLocal

func StartLocal(name, bin string, args, envs []string, logfile string) (*exec.Cmd, error)

func StopCRMService

func StopCRMService(ctx context.Context, cloudlet *edgeproto.Cloudlet, haRole HARole, crmOps ...CrmServiceOp) error

StopCRMService stops the crmserver on the specified cloudlet, or kills any crm process if the cloudlet specified is nil

func StopCloudletPrometheus

func StopCloudletPrometheus(ctx context.Context) error

func StopFakeEnvoyExporters

func StopFakeEnvoyExporters(ctx context.Context) error

func StopLocal

func StopLocal(cmd *exec.Cmd)

func StopProcess

func StopProcess(p Process, maxwait time.Duration, c chan string)

func StopShepherdService

func StopShepherdService(ctx context.Context, cloudlet *edgeproto.Cloudlet) error

func WriteAllCAs

func WriteAllCAs(inputCAFile, outputCAFile string) error

func WriteCloudletPromConfig

func WriteCloudletPromConfig(ctx context.Context, remoteWriteAddr string, promScrapeInterval *time.Duration, alertEvalInterval *time.Duration) error

Types

type AutoProv

type AutoProv struct {
	Common      `yaml:",inline"`
	NodeCommon  `yaml:",inline"`
	NotifyAddrs string
	CtrlAddrs   string
	InfluxAddr  string
	Region      string
	// contains filtered or unexported fields
}

func (*AutoProv) GetBindAddrs

func (p *AutoProv) GetBindAddrs() []string

func (*AutoProv) GetExeName

func (p *AutoProv) GetExeName() string

func (*AutoProv) LookupArgs

func (p *AutoProv) LookupArgs() string

func (*AutoProv) StartLocal

func (p *AutoProv) StartLocal(logfile string, opts ...StartOp) error

func (*AutoProv) StopLocal

func (p *AutoProv) StopLocal()

type CCRM

type CCRM struct {
	Common                        `yaml:",inline"`
	NodeCommon                    `yaml:",inline"`
	RedisClientCommon             `yaml:",inline"`
	Region                        string
	APIAddr                       string
	AppDNSRoot                    string
	CloudletRegistryPath          string
	CloudletVMImagePath           string
	VersionTag                    string
	ControllerApiAddr             string
	ControllerNotifyAddr          string
	ControllerPublicAccessApiAddr string
	ControllerPublicNotifyAddr    string
	ThanosRecvAddr                string
	AnsibleListenAddr             string
	AnsiblePublicAddr             string
	EtcdAddrs                     string
	FederationExternalAddr        string
	TestMode                      bool
	DNSZone                       string
	EnvoyWithCurlImage            string
	NginxWithCurlImage            string
	// contains filtered or unexported fields
}

func (*CCRM) GetBindAddrs

func (p *CCRM) GetBindAddrs() []string

func (*CCRM) GetExeName

func (p *CCRM) GetExeName() string

func (*CCRM) LookupArgs

func (p *CCRM) LookupArgs() string

func (*CCRM) StartLocal

func (p *CCRM) StartLocal(logfile string, opts ...StartOp) error

func (*CCRM) StopLocal

func (p *CCRM) StopLocal()

type ClusterSvc

type ClusterSvc struct {
	Common         `yaml:",inline"`
	NodeCommon     `yaml:",inline"`
	NotifyAddrs    string
	CtrlAddrs      string
	PromPorts      string
	InfluxDB       string
	Interval       string
	Region         string
	PluginRequired bool
	// contains filtered or unexported fields
}

func (*ClusterSvc) GetBindAddrs

func (p *ClusterSvc) GetBindAddrs() []string

func (*ClusterSvc) GetExeName

func (p *ClusterSvc) GetExeName() string

func (*ClusterSvc) LookupArgs

func (p *ClusterSvc) LookupArgs() string

func (*ClusterSvc) StartLocal

func (p *ClusterSvc) StartLocal(logfile string, opts ...StartOp) error

func (*ClusterSvc) StopLocal

func (p *ClusterSvc) StopLocal()

type ColorWriter

type ColorWriter struct {
	Name  string
	Color ct.Color
}

func NewColorWriter

func NewColorWriter(name string) *ColorWriter

func (*ColorWriter) Write

func (c *ColorWriter) Write(p []byte) (int, error)

type Common

type Common struct {
	Kind        string
	Name        string
	Hostname    string
	DockerImage string
	EnvVars     map[string]string
}

func (*Common) GetEnv

func (c *Common) GetEnv() []string

func (*Common) GetEnvVarsP

func (c *Common) GetEnvVarsP() *map[string]string

func (*Common) GetHostname

func (c *Common) GetHostname() string

func (*Common) GetName

func (c *Common) GetName() string

type Controller

type Controller struct {
	Common            `yaml:",inline"`
	NodeCommon        `yaml:",inline"`
	RedisClientCommon `yaml:",inline"`
	EtcdAddrs         string
	ApiAddr           string
	HttpAddr          string
	NotifyAddr        string
	NotifyRootAddrs   string
	NotifyParentAddrs string
	EdgeTurnAddr      string
	InfluxAddr        string
	Region            string

	TestMode             bool
	RegistryFQDN         string
	ArtifactoryFQDN      string
	VersionTag           string
	CheckpointInterval   string
	AppDNSRoot           string
	DNSZone              string
	PlatformServiceAddrs []string
	// contains filtered or unexported fields
}

func (*Controller) ConnectAPI

func (p *Controller) ConnectAPI(timeout time.Duration) (*grpc.ClientConn, error)

func (*Controller) GetBindAddrs

func (p *Controller) GetBindAddrs() []string

func (*Controller) GetExeName

func (p *Controller) GetExeName() string

func (*Controller) GetTlsFile

func (p *Controller) GetTlsFile() string

func (*Controller) LookupArgs

func (p *Controller) LookupArgs() string

func (*Controller) StartLocal

func (p *Controller) StartLocal(logfile string, opts ...StartOp) error

func (*Controller) StopLocal

func (p *Controller) StopLocal()

type Crm

type Crm struct {
	Common            `yaml:",inline"`
	NodeCommon        `yaml:",inline"`
	RedisClientCommon `yaml:",inline"`
	NotifyAddrs       string
	NotifySrvAddr     string
	CloudletKey       string
	Platform          string
	Plugin            string

	PhysicalName        string
	TestMode            bool
	Span                string
	ContainerVersion    string
	VMImageVersion      string
	CloudletVMImagePath string
	EnvoyWithCurlImage  string
	NginxWithCurlImage  string
	Region              string
	CommercialCerts     bool
	AppDNSRoot          string
	AnsiblePublicAddr   string
	CacheDir            string
	HARole              HARole
	// contains filtered or unexported fields
}

func (*Crm) CrmProc

func (p *Crm) CrmProc() *Crm

func (*Crm) GetArgs

func (p *Crm) GetArgs(opts ...StartOp) []string

func (*Crm) GetBindAddrs

func (p *Crm) GetBindAddrs() []string

func (*Crm) GetExeName

func (p *Crm) GetExeName() string

func (*Crm) LookupArgs

func (p *Crm) LookupArgs() string

func (*Crm) LookupArgsWithHARole

func (p *Crm) LookupArgsWithHARole(HARole HARole) string

func (*Crm) StartLocal

func (p *Crm) StartLocal(logfile string, opts ...StartOp) error

func (*Crm) StopLocal

func (p *Crm) StopLocal()

func (*Crm) String

func (p *Crm) String(opts ...StartOp) string

func (*Crm) Wait

func (p *Crm) Wait() error

type CrmProcess

type CrmProcess interface {
	Process
	CrmProc() *Crm
}

type CrmServiceOp

type CrmServiceOp func(options *CrmServiceOptions)

func WithExeName

func WithExeName(name string) CrmServiceOp

func WithGetCrmProc

func WithGetCrmProc(getCrmProc GetCrmProcFunc) CrmServiceOp

type CrmServiceOptions

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

func GetCrmServiceOptions

func GetCrmServiceOptions(ops ...CrmServiceOp) *CrmServiceOptions

type Dme

type Dme struct {
	Common      `yaml:",inline"`
	NodeCommon  `yaml:",inline"`
	ApiAddr     string
	HttpAddr    string
	NotifyAddrs string
	LocVerUrl   string
	TokSrvUrl   string
	QosPosUrl   string
	QosSesAddr  string
	Carrier     string
	CloudletKey string
	CookieExpr  string
	Region      string
	// contains filtered or unexported fields
}

func (*Dme) ConnectAPI

func (p *Dme) ConnectAPI(timeout time.Duration) (*grpc.ClientConn, error)

func (*Dme) GetBindAddrs

func (p *Dme) GetBindAddrs() []string

func (*Dme) GetExeName

func (p *Dme) GetExeName() string

func (*Dme) GetRestClient

func (p *Dme) GetRestClient(timeout time.Duration) (*http.Client, error)

func (*Dme) LookupArgs

func (p *Dme) LookupArgs() string

func (*Dme) StartLocal

func (p *Dme) StartLocal(logfile string, opts ...StartOp) error

func (*Dme) StopLocal

func (p *Dme) StopLocal()

type DockerGeneric

type DockerGeneric struct {
	Common        `yaml:",inline"`
	Links         []string
	DockerNetwork string
	DockerEnvVars map[string]string
	TLS           TLSCerts
	// contains filtered or unexported fields
}

func (*DockerGeneric) GetCmd

func (p *DockerGeneric) GetCmd() *exec.Cmd

func (*DockerGeneric) GetExeName

func (p *DockerGeneric) GetExeName() string

func (*DockerGeneric) GetRunArgs

func (p *DockerGeneric) GetRunArgs() []string

func (*DockerGeneric) LookupArgs

func (p *DockerGeneric) LookupArgs() string

func (*DockerGeneric) SetCmd

func (p *DockerGeneric) SetCmd(cmd *exec.Cmd)

func (*DockerGeneric) StopLocal

func (p *DockerGeneric) StopLocal()

type DockerNetwork

type DockerNetwork struct {
	Common `yaml:",inline"`
}

func (*DockerNetwork) Create

func (d *DockerNetwork) Create() error

func (*DockerNetwork) Delete

func (d *DockerNetwork) Delete() error

type EdgeTurn

type EdgeTurn struct {
	Common     `yaml:",inline"`
	NodeCommon `yaml:",inline"`

	ListenAddr string
	ProxyAddr  string
	Region     string
	TestMode   bool
	// contains filtered or unexported fields
}

func (*EdgeTurn) GetBindAddrs

func (p *EdgeTurn) GetBindAddrs() []string

func (*EdgeTurn) GetExeName

func (p *EdgeTurn) GetExeName() string

func (*EdgeTurn) LookupArgs

func (p *EdgeTurn) LookupArgs() string

func (*EdgeTurn) StartLocal

func (p *EdgeTurn) StartLocal(logfile string, opts ...StartOp) error

func (*EdgeTurn) StopLocal

func (p *EdgeTurn) StopLocal()

type ElasticSearch

type ElasticSearch struct {
	DockerGeneric `yaml:",inline"`
	Type          string
	Port          string
}

func (*ElasticSearch) GetBindAddrs

func (p *ElasticSearch) GetBindAddrs() []string

func (*ElasticSearch) StartElasticSearch

func (p *ElasticSearch) StartElasticSearch(logfile string, opts ...StartOp) error

func (*ElasticSearch) StartKibana

func (p *ElasticSearch) StartKibana(logfile string, opts ...StartOp) error

func (*ElasticSearch) StartLocal

func (p *ElasticSearch) StartLocal(logfile string, opts ...StartOp) error

type Etcd

type Etcd struct {
	Common         `yaml:",inline"`
	DataDir        string
	PeerAddrs      string
	ClientAddrs    string
	InitialCluster string
	// contains filtered or unexported fields
}

func (*Etcd) GetBindAddrs

func (p *Etcd) GetBindAddrs() []string

func (*Etcd) GetExeName

func (p *Etcd) GetExeName() string

func (*Etcd) LookupArgs

func (p *Etcd) LookupArgs() string

func (*Etcd) ResetData

func (p *Etcd) ResetData() error

func (*Etcd) StartLocal

func (p *Etcd) StartLocal(logfile string, opts ...StartOp) error

func (*Etcd) StopLocal

func (p *Etcd) StopLocal()

type GetCrmProcFunc

type GetCrmProcFunc func(cloudlet *edgeproto.Cloudlet, pfConfig *edgeproto.PlatformConfig, HARole HARole) (CrmProcess, []StartOp, error)

type HARole

type HARole string
var HARoleAll HARole = "all"
var HARolePrimary HARole = "primary"
var HARoleSecondary HARole = "secondary"

type Influx

type Influx struct {
	Common   `yaml:",inline"`
	DataDir  string
	HttpAddr string
	BindAddr string
	Config   string // set during Start
	TLS      TLSCerts
	Auth     LocalAuth
	// contains filtered or unexported fields
}

func (*Influx) GetBindAddrs

func (p *Influx) GetBindAddrs() []string

func (*Influx) GetClient

func (p *Influx) GetClient() (influxclient.Client, error)

func (*Influx) GetExeName

func (p *Influx) GetExeName() string

func (*Influx) LookupArgs

func (p *Influx) LookupArgs() string

func (*Influx) ResetData

func (p *Influx) ResetData() error

func (*Influx) StartLocal

func (p *Influx) StartLocal(logfile string, opts ...StartOp) (reterr error)

func (*Influx) StopLocal

func (p *Influx) StopLocal()

type InfluxOp

type InfluxOp func(opts *InfluxOptions)

func WithAuth

func WithAuth(auth bool) InfluxOp

func WithBindAddr

func WithBindAddr(addr string) InfluxOp

func WithHttpAddr

func WithHttpAddr(addr string) InfluxOp

func WithServerCert

func WithServerCert(cert string) InfluxOp

func WithServerCertKey

func WithServerCertKey(key string) InfluxOp

type InfluxOptions

type InfluxOptions struct {
	// DataDir is where all the data will be stored (plus config file)
	DataDir string
	// HttpAddr is the listener addr for clients
	HttpAddr string
	// BindAddr is the listener addr for clustering multiple instances
	BindAddr string
	// TLS server certificate
	TlsCertfile string
	// TLS server cert key
	TlsCertKey string
	// Authentication
	Auth bool
}

func (*InfluxOptions) Apply

func (s *InfluxOptions) Apply(ops ...InfluxOp)

func (*InfluxOptions) SetDefaults

func (s *InfluxOptions) SetDefaults(dir string)

type Jaeger

type Jaeger struct {
	DockerGeneric `yaml:",inline"`
}

func (*Jaeger) GetBindAddrs

func (p *Jaeger) GetBindAddrs() []string

func (*Jaeger) StartLocal

func (p *Jaeger) StartLocal(logfile string, opts ...StartOp) error

func (*Jaeger) StartLocalNoTraefik

func (p *Jaeger) StartLocalNoTraefik(logfile string, opts ...StartOp) error

type LocApiSim

type LocApiSim struct {
	Common  `yaml:",inline"`
	Port    int
	Locfile string
	Geofile string
	Country string
	// contains filtered or unexported fields
}

func (*LocApiSim) GetBindAddrs

func (p *LocApiSim) GetBindAddrs() []string

func (*LocApiSim) GetExeName

func (p *LocApiSim) GetExeName() string

func (*LocApiSim) LookupArgs

func (p *LocApiSim) LookupArgs() string

func (*LocApiSim) StartLocal

func (p *LocApiSim) StartLocal(logfile string, opts ...StartOp) error

func (*LocApiSim) StopLocal

func (p *LocApiSim) StopLocal()

type LocalAuth

type LocalAuth struct {
	User string `json:"user"`
	Pass string `json:"pass"`
}

type NginxProxy

type NginxProxy struct {
	DockerGeneric `yaml:",inline"`
	Servers       []NginxServerConfig
}

func (*NginxProxy) GetBindAddrs

func (p *NginxProxy) GetBindAddrs() []string

func (*NginxProxy) StartLocal

func (p *NginxProxy) StartLocal(logfile string, opts ...StartOp) error

type NginxServerConfig

type NginxServerConfig struct {
	ServerName string
	Port       string
	TlsPort    string
	Target     string
}

type NodeCommon

type NodeCommon struct {
	TLS           TLSCerts
	VaultAddr     string
	UseVaultPki   bool
	DeploymentTag string
	AccessApiAddr string
	AccessKeyFile string
	ValidDomains  string
}

Common args for all nodeMgr processes

func (*NodeCommon) GetNodeMgrArgs

func (p *NodeCommon) GetNodeMgrArgs() []string

type NotifyRoot

type NotifyRoot struct {
	Common     `yaml:",inline"`
	NodeCommon `yaml:",inline"`
	NotifyAddr string
	// contains filtered or unexported fields
}

func (*NotifyRoot) GetBindAddrs

func (p *NotifyRoot) GetBindAddrs() []string

func (*NotifyRoot) GetExeName

func (p *NotifyRoot) GetExeName() string

func (*NotifyRoot) LookupArgs

func (p *NotifyRoot) LookupArgs() string

func (*NotifyRoot) StartLocal

func (p *NotifyRoot) StartLocal(logfile string, opts ...StartOp) error

func (*NotifyRoot) StopLocal

func (p *NotifyRoot) StopLocal()

type Process

type Process interface {
	// Get the name of the process
	GetName() string
	// Get the hostname of the process
	GetHostname() string
	// Get EnvVars
	GetEnv() []string
	// Start the process
	StartLocal(logfile string, opts ...StartOp) error
	// Stop the process
	StopLocal()
	// Get the exe name of the process binary
	GetExeName() string
	// Get lookup args that can be used to find the local process using pgrep
	LookupArgs() string
	// Get Addresses that process binds to
	GetBindAddrs() []string
}

type ProcessInfo

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

type QosSesSrvSim

type QosSesSrvSim struct {
	Common `yaml:",inline"`
	Port   int
	// contains filtered or unexported fields
}

func (*QosSesSrvSim) GetBindAddrs

func (p *QosSesSrvSim) GetBindAddrs() []string

func (*QosSesSrvSim) GetExeName

func (p *QosSesSrvSim) GetExeName() string

func (*QosSesSrvSim) LookupArgs

func (p *QosSesSrvSim) LookupArgs() string

func (*QosSesSrvSim) StartLocal

func (p *QosSesSrvSim) StartLocal(logfile string, opts ...StartOp) error

func (*QosSesSrvSim) StopLocal

func (p *QosSesSrvSim) StopLocal()

type RedisCache

type RedisCache struct {
	Common `yaml:",inline"`

	Type       string
	Port       string
	MasterPort string
	// contains filtered or unexported fields
}

func (*RedisCache) GetBindAddrs

func (p *RedisCache) GetBindAddrs() []string

func (*RedisCache) GetExeName

func (p *RedisCache) GetExeName() string

func (*RedisCache) LookupArgs

func (p *RedisCache) LookupArgs() string

func (*RedisCache) ResetData

func (p *RedisCache) ResetData(logfile string) error

func (*RedisCache) StartLocal

func (p *RedisCache) StartLocal(logfile string, opts ...StartOp) error

func (*RedisCache) StopLocal

func (p *RedisCache) StopLocal()

type RedisClientCommon

type RedisClientCommon struct {
	RedisMasterName     string
	RedisSentinelAddrs  string
	RedisStandaloneAddr string
}

Common args for all redis clients

func (*RedisClientCommon) GetRedisClientArgs

func (p *RedisClientCommon) GetRedisClientArgs() []string

type Shepherd

type Shepherd struct {
	Common         `yaml:",inline"`
	NodeCommon     `yaml:",inline"`
	NotifyAddrs    string
	Platform       string
	MetricsAddr    string
	PromTargetAddr string
	PhysicalName   string
	CloudletKey    string

	Span           string
	Region         string
	AppDNSRoot     string
	ThanosRecvAddr string
	// contains filtered or unexported fields
}

func StartShepherdService

func StartShepherdService(ctx context.Context, cloudlet *edgeproto.Cloudlet, pfConfig *edgeproto.PlatformConfig) (*Shepherd, error)

func (*Shepherd) GetArgs

func (p *Shepherd) GetArgs(opts ...StartOp) []string

func (*Shepherd) GetBindAddrs

func (p *Shepherd) GetBindAddrs() []string

func (*Shepherd) GetExeName

func (p *Shepherd) GetExeName() string

func (*Shepherd) LookupArgs

func (p *Shepherd) LookupArgs() string

func (*Shepherd) StartLocal

func (p *Shepherd) StartLocal(logfile string, opts ...StartOp) error

func (*Shepherd) StopLocal

func (p *Shepherd) StopLocal()

func (*Shepherd) String

func (p *Shepherd) String(opts ...StartOp) string

func (*Shepherd) Wait

func (p *Shepherd) Wait()

type StartOp

type StartOp func(op *StartOptions)

func WithCleanStartup

func WithCleanStartup() StartOp

func WithCustomExeName

func WithCustomExeName(exeName string) StartOp

func WithDebug

func WithDebug(debug string) StartOp

func WithExtraArgs

func WithExtraArgs(params []string) StartOp

func WithNoConfig

func WithNoConfig() StartOp

func WithRolesFile

func WithRolesFile(rolesfile string) StartOp

type StartOptions

type StartOptions struct {
	Debug        string
	RolesFile    string
	CleanStartup bool
	ExtraArgs    []string
	NoConfig     bool
	ExeName      string
}

func (*StartOptions) ApplyStartOptions

func (s *StartOptions) ApplyStartOptions(opts ...StartOp)

type TLSCerts

type TLSCerts struct {
	ServerCert string
	ServerKey  string
	CACert     string
	ClientCert string
	ApiCert    string
	ApiKey     string
}

func (*TLSCerts) AddInternalPkiArgs

func (s *TLSCerts) AddInternalPkiArgs(args []string) []string

type Vault

type Vault struct {
	Common     `yaml:",inline"`
	DmeSecret  string
	Regions    string
	VaultDatas []VaultData
	ListenAddr string
	RootToken  string
	CADir      string
	RunCACert  string
	PKIDomain  string

	DNSZone          string
	CloudflareAPIKey string
	// contains filtered or unexported fields
}

func (*Vault) GetAppRole

func (p *Vault) GetAppRole(region, name string, roleID, secretID *string, err *error)

func (*Vault) GetBindAddrs

func (p *Vault) GetBindAddrs() []string

func (*Vault) GetExeName

func (p *Vault) GetExeName() string

func (*Vault) LookupArgs

func (p *Vault) LookupArgs() string

func (*Vault) PutSecret

func (p *Vault) PutSecret(region, name, secret string, err *error)

func (*Vault) PutSecretsJson

func (p *Vault) PutSecretsJson(SecretsPath, jsonFile string, err *error)

func (*Vault) Run

func (p *Vault) Run(bin, args string, err *error) string

func (*Vault) RunWithInput

func (p *Vault) RunWithInput(bin, args string, input io.Reader, err *error) string

func (*Vault) Setup

func (p *Vault) Setup(opts ...StartOp) error

func (*Vault) StartLocal

func (p *Vault) StartLocal(logfile string, opts ...StartOp) error

func (*Vault) StartLocalRoles

func (p *Vault) StartLocalRoles() (*VaultRoles, error)

func (*Vault) StopLocal

func (p *Vault) StopLocal()

type VaultData

type VaultData struct {
	Path string
	Data map[string]string
}

type VaultRegionRoles

type VaultRegionRoles struct {
	DmeRoleID          string `json:"dmeroleid"`
	DmeSecretID        string `json:"dmesecretid"`
	RotatorRoleID      string `json:"rotatorroleid"`
	RotatorSecretID    string `json:"rotatorsecretid"`
	CtrlRoleID         string `json:"controllerroleid"`
	CtrlSecretID       string `json:"controllersecretid"`
	ClusterSvcRoleID   string `json:"clustersvcroleid"`
	ClusterSvcSecretID string `json:"clustersvcsecretid"`
	EdgeTurnRoleID     string `json:"edgeturnroleid"`
	EdgeTurnSecretID   string `json:"edgeturnsecretid"`
	AutoProvRoleID     string `json:"autoprovroleid"`
	AutoProvSecretID   string `json:"autoprovsecretid"`
	FrmRoleID          string `json:"frmroleid"`
	FrmSecretID        string `json:"frmsecretid"`
}

type VaultRoles

type VaultRoles struct {
	NotifyRootRoleID        string `json:"notifyrootroleid"`
	NotifyRootSecretID      string `json:"notifyrootsecretid"`
	MCRoleID                string `json:"mcroleid"`
	MCSecretID              string `json:"mcsecretid"`
	RotatorRoleID           string `json:"rotatorroleid"`
	RotatorSecretID         string `json:"rotatorsecretid"`
	AlertMgrSidecarRoleID   string `json:"alertmgrsidecarroleid"`
	AlertMgrSidecarSecretID string `json:"alertmgrsidecarsecretid"`
	RegionRoles             map[string]*VaultRegionRoles
}

func (*VaultRoles) GetRegionRoles

func (s *VaultRoles) GetRegionRoles(region string) *VaultRegionRoles

Jump to

Keyboard shortcuts

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