config

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	*CertificateInternal
}

Certificate only exists for parser trickery

func (*Certificate) UnmarshalYAML

func (c *Certificate) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is a custom deserializer for 'Certificate' in order to transparently provide default values where applicable

type CertificateInternal

type CertificateInternal struct {
	// How the certificate is named internally
	Name string `yaml:"name"`
	// Path to certificate directory
	Cert string `yaml:"cert"`
	// List of domains this certificate is valid for
	Domains []string `yaml:"domains"`
}

CertificateInternal contains everything you ever wanted to know about a certificate

type Cluster

type Cluster struct {
	*ClusterInternal
}

Cluster only exists for parser trickery

func (*Cluster) UnmarshalYAML

func (c *Cluster) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is a custom deserializer for 'Cluster' in order to transparently provide default values where applicable

type ClusterInternal

type ClusterInternal struct {
	// Name of the cluster (used for logging)
	Name string `yaml:"name"`
	// Path to kubeconfig used to connect to the cluster
	Kubeconfig string `yaml:"kubeconfig"`
	// Namespace where the Ingress is located
	IngressNamespace string `yaml:"ingressNamespace"`
	// Name of the ingress deployment (the pod label "app.kubernetes.io/name" will be checked)
	IngressAppName string `yaml:"ingressDeamonSetName"`
	// Port the ingress pods use
	IngressPort int `yaml:"ingressPort"`
}

ClusterInternal describes all information we need to know about a cluster

type Config

type Config struct {
	// Path to the config template to use for HAProxy
	HAProxyTemplatePath string `yaml:"haproxyTemplatePath"`
	// Path to HAProxy config dropin to create for this service
	HAProxyDropinPath string `yaml:"haproxyDropinPath"`
	// Mode to use in case the config file is created
	HAProxyDropinMode string `yaml:"haproxyDropinMode"`
	// List of clusters to route to
	Clusters []Cluster `yaml:"clusters"`
	// List of TLS certificates to use
	Certificates []Certificate `yaml:"certificates"`
	// List of IPs to listen on
	IPs []*net.IP `yaml:"ips"`
}

Config represents the main k8router config. This is deserialized from YAML using the annotations

func FromFile

func FromFile(path string) (*Config, error)

FromFile creates a config object by parsing it from file

Jump to

Keyboard shortcuts

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