version1

package
v1.5.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheck

type HealthCheck struct {
	UpstreamName   string
	URI            string
	Interval       int32
	Fails          int32
	Passes         int32
	Scheme         string
	Mandatory      bool
	Headers        map[string]string
	TimeoutSeconds int64
}

HealthCheck describes an active HTTP health check.

type Ingress

type Ingress struct {
	Name        string
	Namespace   string
	Annotations map[string]string
}

Ingress holds information about an Ingress resource.

type IngressNginxConfig

type IngressNginxConfig struct {
	Upstreams []Upstream
	Servers   []Server
	Keepalive string
	Ingress   Ingress
}

IngressNginxConfig describes an NGINX configuration.

type JWTAuth

type JWTAuth struct {
	Key                  string
	Realm                string
	Token                string
	RedirectLocationName string
}

JWTAuth holds JWT authentication configuration.

type JWTRedirectLocation

type JWTRedirectLocation struct {
	Name     string
	LoginURL string
}

JWTRedirectLocation describes a location for redirecting client requests to a login URL for JWT Authentication.

type Location

type Location struct {
	LocationSnippets     []string
	Path                 string
	Upstream             Upstream
	ProxyConnectTimeout  string
	ProxyReadTimeout     string
	ClientMaxBodySize    string
	Websocket            bool
	Rewrite              string
	SSL                  bool
	GRPC                 bool
	ProxyBuffering       bool
	ProxyBuffers         string
	ProxyBufferSize      string
	ProxyMaxTempFileSize string
	JWTAuth              *JWTAuth

	MinionIngress *Ingress
}

Location describes an NGINX location.

type MainConfig

type MainConfig struct {
	ServerNamesHashBucketSize      string
	ServerNamesHashMaxSize         string
	AccessLogOff                   bool
	LogFormat                      string
	ErrorLogLevel                  string
	StreamLogFormat                string
	HealthStatus                   bool
	NginxStatus                    bool
	NginxStatusAllowCIDRs          []string
	NginxStatusPort                int
	StubStatusOverUnixSocketForOSS bool
	MainSnippets                   []string
	HTTPSnippets                   []string
	StreamSnippets                 []string
	SSLProtocols                   string
	SSLPreferServerCiphers         bool
	SSLCiphers                     string
	SSLDHParam                     string
	HTTP2                          bool
	ServerTokens                   string
	ProxyProtocol                  bool
	WorkerProcesses                string
	WorkerCPUAffinity              string
	WorkerShutdownTimeout          string
	WorkerConnections              string
	WorkerRlimitNofile             string
	ResolverAddresses              []string
	ResolverIPV6                   bool
	ResolverValid                  string
	ResolverTimeout                string
	KeepaliveTimeout               string
	KeepaliveRequests              int64
	VariablesHashBucketSize        uint64
	VariablesHashMaxSize           uint64
}

MainConfig describe the main NGINX configuration file.

type Server

type Server struct {
	ServerSnippets        []string
	Name                  string
	ServerTokens          string
	Locations             []Location
	SSL                   bool
	SSLCertificate        string
	SSLCertificateKey     string
	SSLCiphers            string
	GRPCOnly              bool
	StatusZone            string
	HTTP2                 bool
	RedirectToHTTPS       bool
	SSLRedirect           bool
	ProxyProtocol         bool
	HSTS                  bool
	HSTSMaxAge            int64
	HSTSIncludeSubdomains bool
	HSTSBehindProxy       bool
	ProxyHideHeaders      []string
	ProxyPassHeaders      []string

	HealthChecks map[string]HealthCheck

	RealIPHeader    string
	SetRealIPFrom   []string
	RealIPRecursive bool

	JWTAuth              *JWTAuth
	JWTRedirectLocations []JWTRedirectLocation

	Ports    []int
	SSLPorts []int
}

Server describes an NGINX server.

type TemplateExecutor

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

TemplateExecutor executes NGINX configuration templates.

func NewTemplateExecutor

func NewTemplateExecutor(mainTemplatePath string, ingressTemplatePath string) (*TemplateExecutor, error)

NewTemplateExecutor creates a TemplateExecutor.

func (*TemplateExecutor) ExecuteIngressConfigTemplate

func (te *TemplateExecutor) ExecuteIngressConfigTemplate(cfg *IngressNginxConfig) ([]byte, error)

ExecuteIngressConfigTemplate generates the content of a NGINX configuration file for an Ingress resource.

func (*TemplateExecutor) ExecuteMainConfigTemplate

func (te *TemplateExecutor) ExecuteMainConfigTemplate(cfg *MainConfig) ([]byte, error)

ExecuteMainConfigTemplate generates the content of the main NGINX configuration file.

func (*TemplateExecutor) UpdateIngressTemplate

func (te *TemplateExecutor) UpdateIngressTemplate(templateString *string) error

UpdateIngressTemplate updates the ingress template.

func (*TemplateExecutor) UpdateMainTemplate

func (te *TemplateExecutor) UpdateMainTemplate(templateString *string) error

UpdateMainTemplate updates the main NGINX template.

type Upstream

type Upstream struct {
	Name            string
	UpstreamServers []UpstreamServer
	StickyCookie    string
	LBMethod        string
	Queue           int64
	QueueTimeout    int64
}

Upstream describes an NGINX upstream.

func NewUpstreamWithDefaultServer

func NewUpstreamWithDefaultServer(name string) Upstream

NewUpstreamWithDefaultServer creates an upstream with the default server. proxy_pass to an upstream with the default server returns 502. We use it for services that have no endpoints.

type UpstreamServer

type UpstreamServer struct {
	Address     string
	Port        string
	MaxFails    int
	FailTimeout string
	SlowStart   string
	Resolve     bool
}

UpstreamServer describes a server in an NGINX upstream.

Jump to

Keyboard shortcuts

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