config

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AntidoteConfig added in v0.6.0

type AntidoteConfig struct {
	InstanceID string `yaml:"instanceId"`

	Tier string `yaml:"tier"`

	// HepsDomain is the domain on which HEPS hostnames should be provisioned. This domain is used
	// as the direct parent for any subdomains that are configured for ingresses that allow access to
	// HTTP endpoints. Note that these subdomains automatically include the antidote instance ID, so
	// it's safe to have multiple instances of antidote running with the same HepsDomain
	// configured.
	HEPSDomain string `yaml:"hepsDomain"`

	ImageOrg string `yaml:"imageOrg"`
	GRPCPort int    `yaml:"grpcPort"`
	HTTPPort int    `yaml:"httpPort"`

	// Both TTL options are in minutes
	LiveSessionTTL int `yaml:"liveSessionTTL"`
	LiveLessonTTL  int `yaml:"liveLessonTTL"`

	// Limits the number of sessions that can be requested by a single IP address
	LiveSessionLimit int `yaml:"liveSessionLimit"`

	// Less important but still useful. LiveLessons are already bound to a session ID, so the
	// number of livelessons that can be spun up by a single session is bound to the number of
	// lessons in a given curriculum. This option, however, can be used to further limit the number
	// of concurrent livelessons for a single session
	LiveLessonLimit int `yaml:"liveLessonLimit"`

	Stats struct {
		URL      string `yaml:"url"`
		Username string `yaml:"username"`
		Password string `yaml:"password"`
	} `yaml:"stats"`

	AlwaysPull  bool `yaml:"alwaysPull"`
	AllowEgress bool `yaml:"allowEgress"`

	SecretsNamespace string `yaml:"secretsNamespace"`
	TLSCertName      string `yaml:"tlsCertName"`
	PullCredName     string `yaml:"pullCredName"`

	CurriculumDir     string `yaml:"curriculumDir"`
	CurriculumVersion string `yaml:"curriculumVersion"`

	EnabledServices []string `yaml:"enabledServices"`

	// K8sInCluster controls whether or not the scheduler service uses an in-cluster
	// configuration for communicating with kubernetes. Since this is the typical deployment
	// scenario, this defaults to true.
	//
	// However, for development, it may be useful to use an out of cluster configuration,
	// so you can run antidoted directly instead of packaging it in a container image and deploying
	// to your cluster. In this case, set K8sInCluster to false, and provide the path to
	// your kubeconfig via K8sOutOfClusterConfigPath
	K8sInCluster              bool   `yaml:"k8sInCluster"`
	K8sOutOfClusterConfigPath string `yaml:"k8sOutOfClusterConfigPath"`

	NATSUrl string `yaml:"natsUrl"`
}

func LoadConfig added in v0.6.0

func LoadConfig(configFile string) (AntidoteConfig, error)

func (*AntidoteConfig) IsServiceEnabled added in v0.6.0

func (c *AntidoteConfig) IsServiceEnabled(serviceName string) bool

IsServiceEnabled checks the config for a given service name, and if included, returns true. Otherwise, returns false.

func (*AntidoteConfig) JSON added in v0.6.0

func (c *AntidoteConfig) JSON() string

Jump to

Keyboard shortcuts

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