version1

package
v1.7.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 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 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
	ProxySendTimeout     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 {
	AccessLogOff                   bool
	DefaultServerAccessLogOff      bool
	ErrorLogLevel                  string
	HealthStatus                   bool
	HealthStatusURI                string
	HTTP2                          bool
	HTTPSnippets                   []string
	KeepaliveRequests              int64
	KeepaliveTimeout               string
	LogFormat                      []string
	LogFormatEscaping              string
	MainSnippets                   []string
	NginxStatus                    bool
	NginxStatusAllowCIDRs          []string
	NginxStatusPort                int
	OpenTracingEnabled             bool
	OpenTracingLoadModule          bool
	OpenTracingTracer              string
	OpenTracingTracerConfig        string
	ProxyProtocol                  bool
	ResolverAddresses              []string
	ResolverIPV6                   bool
	ResolverTimeout                string
	ResolverValid                  string
	ServerNamesHashBucketSize      string
	ServerNamesHashMaxSize         string
	ServerTokens                   string
	SSLCiphers                     string
	SSLDHParam                     string
	SSLPreferServerCiphers         bool
	SSLProtocols                   string
	StreamLogFormat                []string
	StreamLogFormatEscaping        string
	StreamSnippets                 []string
	StubStatusOverUnixSocketForOSS bool
	TLSPassthrough                 bool
	VariablesHashBucketSize        uint64
	VariablesHashMaxSize           uint64
	WorkerConnections              string
	WorkerCPUAffinity              string
	WorkerProcesses                string
	WorkerRlimitNofile             string
	WorkerShutdownTimeout          string
}

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
	TLSPassthrough        bool
	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
	UpstreamZoneSize string
}

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
	MaxConns    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